Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fabric Tasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
TPA
Fabric Tasks
Commits
686dde76
Verified
Commit
686dde76
authored
1 year ago
by
anarcat
Browse files
Options
Downloads
Patches
Plain Diff
tool to audit gitlab logs for
team#41470
parent
7a694704
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
audit-gitlab-logs.py
+33
-0
33 additions, 0 deletions
audit-gitlab-logs.py
with
33 additions
and
0 deletions
audit-gitlab-logs.py
0 → 100644
+
33
−
0
View file @
686dde76
#!/usr/bin/python3
import
fileinput
import
json
import
logging
def
main
():
logging
.
basicConfig
(
level
=
"
INFO
"
)
try
:
for
line
in
fileinput
.
input
(
openhook
=
fileinput
.
hook_compressed
):
if
fileinput
.
isfirstline
():
logging
.
info
(
"
parsing %s
"
,
fileinput
.
filename
())
try
:
blob
=
json
.
loads
(
line
)
except
ValueError
as
e
:
logging
.
warning
(
"
failed to parse %s:%d: %s
"
,
fileinput
.
filename
(),
fileinput
.
lineno
(),
e
)
continue
for
param
in
blob
.
get
(
'
params
'
,
[]):
try
:
email
=
param
.
get
(
'
value
'
,
{}).
get
(
'
email
'
)
except
AttributeError
:
logging
.
debug
(
"
ignoring string value: %s
"
,
param
.
get
(
'
value
'
))
continue
if
email
:
logging
.
info
(
"
email: %r
"
,
email
)
except
OSError
as
e
:
logging
.
error
(
"
error while processing file %s at line %s: %s, skipping
"
,
fileinput
.
filename
(),
fileinput
.
lineno
(),
e
)
fileinput
.
nextfile
()
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
anarcat
@anarcat
mentioned in incident
team#41470 (closed)
·
1 year ago
mentioned in incident
team#41470 (closed)
mentioned in incident team#41470
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment