Skip to content

Commit

Permalink
GH: Support for migration events on AuditLog (#854)
Browse files Browse the repository at this point in the history
* Pseudonymize payload from audit log

* Redact not required properties

* Fix yaml
  • Loading branch information
aperez-worklytics authored Feb 6, 2025
1 parent 95945f7 commit 674b3b7
Show file tree
Hide file tree
Showing 5 changed files with 682 additions and 601 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,30 @@
"user": "octocat",
"user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0",
"user_id": 13968776
},
{
"repo": [
"some-org/test"
],
"repo_id": [
12324
],
"org": "some-org",
"org_id": 870,
"action": "migration.destroy_file",
"@timestamp": 1737730851061,
"created_at": 1737730851061,
"operation_type": "remove",
"data": {
"job": "MigrationDestroyFileJob",
"active_job_id": "some-job-id",
"aqueduct_job_id": "some-aqueduct-job-id",
"catalog_service": "github/unknown",
"migration_id": 2,
"public_repo": true,
"started_by": "octocat",
"started_by_id": 42,
"category_type": "Resource Management"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"repository":"some-org/test",
"repository_public":false,
"user":"null",
"user_id":0
"user_id":"{\"hash\":\"uXY-rAXeOzg_TOxA3id5pRgzfCc7sMGRAnsZJK0Ds0U\"}"
},
{
"@timestamp":1688668100244,
Expand All @@ -27,7 +27,7 @@
"repository":"some-org/test",
"repository_public":false,
"user":"null",
"user_id":0
"user_id":"{\"hash\":\"uXY-rAXeOzg_TOxA3id5pRgzfCc7sMGRAnsZJK0Ds0U\"}"
},
{
"@timestamp":1688667848231,
Expand All @@ -48,6 +48,26 @@
"repo":"some-org/test",
"repository":"some-org/test",
"user":"{\"hash\":\"IAUEqSLLtP3EjjkzslH-S1ULJZRLQnH9hT54jiI1gbM\"}",
"user_id":13968776
"user_id":"{\"hash\":\"S3Nh4slc2XnLp5Qy1CD-pQew9-j0cePbX3U7-DE56Co\"}"
},
{
"repo":[
"some-org/test"
],
"repo_id":[
12324
],
"org":"some-org",
"org_id":870,
"action":"migration.destroy_file",
"@timestamp":1737730851061,
"created_at":1737730851061,
"operation_type":"remove",
"data":{
"public_repo":true,
"started_by":"{\"hash\":\"IAUEqSLLtP3EjjkzslH-S1ULJZRLQnH9hT54jiI1gbM\"}",
"started_by_id":42,
"category_type":"Resource Management"
}
}
]
18 changes: 15 additions & 3 deletions docs/sources/github/github-enterprise-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,17 @@ endpoints:
- "$..transport_protocol_name"
- "$..pull_request_title"
- "$..user_agent"
- "$..job"
- "$..active_job_id"
- "$..aqueduct_job_id"
- "$..catalog_service"
- "$..migration_id"
- !<pseudonymize>
jsonPaths:
- "$..actor"
- "$..user"
- "$..userId"
- "$..user_id"
- "$..started_by"
encoding: "JSON"
- pathTemplate: "/api/{enterpriseServerVersion}/organizations/{installationId}/audit-log"
allowedQueryParams:
Expand All @@ -286,11 +292,17 @@ endpoints:
- "$..transport_protocol_name"
- "$..pull_request_title"
- "$..user_agent"
- "$..job"
- "$..active_job_id"
- "$..aqueduct_job_id"
- "$..catalog_service"
- "$..migration_id"
- !<pseudonymize>
jsonPaths:
- "$..actor"
- "$..user"
- "$..userId"
- "$..user_id"
- "$..started_by"
encoding: "JSON"
- pathTemplate: "/api/{enterpriseServerVersion}/orgs/{org}/repos"
allowedQueryParams:
Expand Down Expand Up @@ -847,4 +859,4 @@ endpoints:
jsonPaths:
- "$..assignees[*].login"
includeReversible: true
encoding: "URL_SAFE_TOKEN"
encoding: "URL_SAFE_TOKEN"
18 changes: 15 additions & 3 deletions docs/sources/github/github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,17 @@ endpoints:
- "$..transport_protocol_name"
- "$..pull_request_title"
- "$..user_agent"
- "$..job"
- "$..active_job_id"
- "$..aqueduct_job_id"
- "$..catalog_service"
- "$..migration_id"
- !<pseudonymize>
jsonPaths:
- "$..actor"
- "$..user"
- "$..userId"
- "$..user_id"
- "$..started_by"
encoding: "JSON"
- pathTemplate: "/organizations/{installationId}/audit-log"
allowedQueryParams:
Expand All @@ -286,11 +292,17 @@ endpoints:
- "$..transport_protocol_name"
- "$..pull_request_title"
- "$..user_agent"
- "$..job"
- "$..active_job_id"
- "$..aqueduct_job_id"
- "$..catalog_service"
- "$..migration_id"
- !<pseudonymize>
jsonPaths:
- "$..actor"
- "$..user"
- "$..userId"
- "$..user_id"
- "$..started_by"
encoding: "JSON"
- pathTemplate: "/orgs/{org}/repos"
allowedQueryParams:
Expand Down Expand Up @@ -847,4 +859,4 @@ endpoints:
jsonPaths:
- "$..assignees[*].login"
includeReversible: true
encoding: "URL_SAFE_TOKEN"
encoding: "URL_SAFE_TOKEN"
Loading

0 comments on commit 674b3b7

Please sign in to comment.