Skip to content

Commit 226680d

Browse files
committed
Completely remove CSLS, configuring only Cribl
1 parent 2d40107 commit 226680d

13 files changed

Lines changed: 35 additions & 155 deletions

File tree

infra/modules/access-logs-bucket/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ data "aws_iam_policy_document" "access_logs_policy" {
6868
module "cyber_s3_log_shipping" {
6969
count = var.send_access_logs_to_cyber ? 1 : 0
7070

71-
source = "../cyber_s3_log_shipping"
72-
s3_name = aws_s3_bucket.access_logs.id
73-
destination = var.access_log_shipping_destination
71+
source = "../cyber_s3_log_shipping"
72+
s3_name = aws_s3_bucket.access_logs.id
7473
}
7574

7675
data "aws_iam_policy_document" "access_logs_combined_policy" {

infra/modules/access-logs-bucket/variables.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,3 @@ variable "extra_bucket_policies" {
1515
description = "Extra bucket policies to apply to this bucket. List of json policies"
1616
default = []
1717
}
18-
19-
variable "access_log_shipping_destination" {
20-
type = string
21-
description = "The destination for log shipping. Valid values are 'cribl' or 'csls'."
22-
default = "cribl"
23-
24-
validation {
25-
condition = contains(["cribl", "csls"], var.access_log_shipping_destination)
26-
error_message = "Invalid destination. Valid values are 'cribl' or 'csls'."
27-
}
28-
}

infra/modules/cyber_s3_log_shipping/cribl.tf

Lines changed: 0 additions & 34 deletions
This file was deleted.

infra/modules/cyber_s3_log_shipping/csls.tf

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
1-
# S3 bucket notifications for both CSLS and Cribl
1+
module "cribl_well_known" {
2+
source = "../well-known/cribl"
3+
}
4+
5+
# IAM policy for Cribl role to access S3 bucket
6+
data "aws_iam_policy_document" "cribl_s3_access" {
7+
statement {
8+
sid = "CriblS3Access"
9+
10+
principals {
11+
type = "AWS"
12+
identifiers = [module.cribl_well_known.cribl_role_arn]
13+
}
214

3-
locals {
4-
enable_cribl = var.destination == "cribl"
5-
enable_csls = var.destination == "csls"
15+
effect = "Allow"
16+
17+
actions = [
18+
"s3:GetObject",
19+
"s3:ListBucket",
20+
"s3:GetObjectTagging",
21+
"s3:PutObjectTagging"
22+
]
23+
24+
resources = [
25+
"arn:aws:s3:::${var.s3_name}",
26+
"arn:aws:s3:::${var.s3_name}/*",
27+
]
28+
}
629
}
730

31+
# S3 bucket notifications
832
resource "aws_s3_bucket_notification" "s3_bucket_notification" {
933
bucket = var.s3_name
1034

1135
# We can't push events to multiple SQS queues at once, so we conditionally choose
1236
# which queue to use based on the destination variable.
1337
queue {
14-
queue_arn = local.enable_cribl ? module.cribl_well_known[0].cribl_sqs_queue_arn : module.csls_well_known.s3_to_splunk_queue_arn
38+
queue_arn = module.cribl_well_known.cribl_sqs_queue_arn
1539
events = ["s3:ObjectCreated:*"]
1640
}
1741
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
output "s3_policy" {
22
description = "S3 bucket policy for cyber security log shipping"
3-
value = local.enable_cribl ? data.aws_iam_policy_document.cribl_s3_access[0].json : data.aws_iam_policy_document.csls_s3_access[0].json
3+
value = data.aws_iam_policy_document.cribl_s3_access[0].json
44
}

infra/modules/cyber_s3_log_shipping/variables.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,3 @@ variable "s3_name" {
22
type = string
33
description = "The name of the S3 bucket to configure for log shipping"
44
}
5-
6-
variable "destination" {
7-
type = string
8-
description = "The destination for log shipping. Valid values are 'cribl' or 'csls'."
9-
default = "cribl"
10-
11-
validation {
12-
condition = contains(["cribl", "csls"], var.destination)
13-
error_message = "Invalid destination. Valid values are 'cribl' or 'csls'."
14-
}
15-
}

infra/modules/deployer-access/policy.tf

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,6 @@ data "aws_iam_policy_document" "eventbridge" {
666666
}
667667
}
668668

669-
module "csls_well_known" {
670-
source = "../well-known/csls"
671-
}
672-
673669
data "aws_iam_policy_document" "cloudwatch_logging" {
674670
statement {
675671
actions = [
@@ -685,15 +681,6 @@ data "aws_iam_policy_document" "cloudwatch_logging" {
685681
effect = "Allow"
686682
}
687683

688-
statement {
689-
sid = "PutSubscriptionFilterForCSLS"
690-
actions = [
691-
"logs:PutSubscriptionFilter",
692-
]
693-
resources = values(module.csls_well_known.cloudwatch_to_splunk_destination_arns)
694-
effect = "Allow"
695-
}
696-
697684
statement {
698685
sid = "ManageSubscriptionFilterForCRIBL"
699686
actions = [

infra/modules/secure-bucket/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ module "access_logs_bucket" {
9090

9191
bucket_name = "${var.name}-access-logs"
9292

93-
send_access_logs_to_cyber = var.send_access_logs_to_cyber
94-
access_log_shipping_destination = var.access_log_shipping_destination
93+
send_access_logs_to_cyber = var.send_access_logs_to_cyber
9594
}
9695

9796
resource "aws_s3_bucket_logging" "this" {

infra/modules/secure-bucket/variables.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,3 @@ variable "send_access_logs_to_cyber" {
3434
default = true
3535
nullable = false
3636
}
37-
38-
variable "access_log_shipping_destination" {
39-
type = string
40-
description = "The destination for log shipping. Valid values are 'cribl' or 'csls'."
41-
default = "cribl"
42-
43-
validation {
44-
condition = contains(["cribl", "csls"], var.access_log_shipping_destination)
45-
error_message = "Invalid destination. Valid values are 'cribl' or 'csls'."
46-
}
47-
}

0 commit comments

Comments
 (0)