Skip to content

Commit

Permalink
✨ Add Audit Log Streaming Infrastructure for GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
connormaglynn committed Jan 15, 2025
1 parent 740ce6e commit 6eb5739
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module "github-cloudtrail-auditlog" {
source = "github.com/ministryofjustice/operations-engineering-cloudtrail-lake-github-audit-log-terraform-module?ref=main"
create_github_auditlog_s3bucket = true
github_auditlog_s3bucket = "github-audit-log-landing"
cloudtrail_lake_channel_arn = aws_cloudtrail_channel.github_channel.arn
github_audit_allow_list = ".*"
}

resource "aws_cloudtrail_event_data_store" "github_audit_logs" {
name = "github-audit-logs-store"
retention_period = 90
termination_protection_enabled = true

advanced_event_selector {
name = "GitHubAuditLogs"
field_selector {
field = "eventSource"
equals = ["GitHub"]
}
}
}

resource "aws_cloudtrail_channel" "github_channel" {
name = "github-audit-log-channel"
source = "Github"
destinations = [aws_cloudtrail_event_data_store.github_audit_logs.arn]
advanced_event_selector = aws_cloudtrail_event_data_store.github_audit_logs.advanced_event_selector
}

0 comments on commit 6eb5739

Please sign in to comment.