-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cdr) - support empty audit logs block (#54)
* fix(cdr) - support empty audit logs block * Makefile fix
- Loading branch information
Showing
8 changed files
with
205 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
lint: | ||
tflint --recursive --module | ||
tflint --recursive --call-module-type=all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test/examples/modular_organization/pub-sub-admin-write-only1.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#--------------------------------------------------------------------------------------------- | ||
# Ensure installation flow for foundational onboarding has been completed before | ||
# installing additional Sysdig features. | ||
#--------------------------------------------------------------------------------------------- | ||
|
||
module "pub-sub" { | ||
source = "../../../modules/integrations/pub-sub" | ||
project_id = module.onboarding.project_id | ||
is_organizational = module.onboarding.is_organizational | ||
organization_domain = module.onboarding.organization_domain | ||
sysdig_secure_account_id = module.onboarding.sysdig_secure_account_id | ||
ingestion_sink_filter = "" | ||
audit_log_config = [ | ||
{ | ||
service = "allServices" | ||
log_config = [] | ||
} | ||
] | ||
exclude_logs_filter = [] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "threat_detection" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_THREAT_DETECTION" | ||
enabled = true | ||
components = [ module.pub-sub.pubsub_datasource_component_id ] | ||
depends_on = [ module.pub-sub ] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT" | ||
enabled = true | ||
components = [module.pub-sub.pubsub_datasource_component_id] | ||
depends_on = [sysdig_secure_cloud_auth_account_feature.config_posture, module.pub-sub] | ||
} |
31 changes: 31 additions & 0 deletions
31
test/examples/modular_organization/pub-sub-admin-write-only2.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#--------------------------------------------------------------------------------------------- | ||
# Ensure installation flow for foundational onboarding has been completed before | ||
# installing additional Sysdig features. | ||
#--------------------------------------------------------------------------------------------- | ||
|
||
module "pub-sub" { | ||
source = "../../../modules/integrations/pub-sub" | ||
project_id = module.onboarding.project_id | ||
is_organizational = module.onboarding.is_organizational | ||
organization_domain = module.onboarding.organization_domain | ||
sysdig_secure_account_id = module.onboarding.sysdig_secure_account_id | ||
ingestion_sink_filter = "" | ||
audit_log_config = [] | ||
exclude_logs_filter = [] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "threat_detection" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_THREAT_DETECTION" | ||
enabled = true | ||
components = [ module.pub-sub.pubsub_datasource_component_id ] | ||
depends_on = [ module.pub-sub ] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT" | ||
enabled = true | ||
components = [module.pub-sub.pubsub_datasource_component_id] | ||
depends_on = [sysdig_secure_cloud_auth_account_feature.config_posture, module.pub-sub] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,40 @@ module "pub-sub" { | |
is_organizational = module.onboarding.is_organizational | ||
organization_domain = module.onboarding.organization_domain | ||
sysdig_secure_account_id = module.onboarding.sysdig_secure_account_id | ||
ingestion_sink_filter = "protoPayload.@type = \"type.googleapis.com/google.cloud.audit.AuditLog\" (protoPayload.methodName!~ \"\\.(get|list)$\" OR protoPayload.serviceName != (\"k8s.io\" and \"storage.googleapis.com\"))" | ||
audit_log_config = [ | ||
{ | ||
service = "cloudsql.googleapis.com" | ||
log_config = [{ log_type = "DATA_READ", | ||
exempted_members = [ | ||
"serviceAccount:[email protected]", | ||
] | ||
}, | ||
{ log_type = "DATA_WRITE" } | ||
] | ||
}, | ||
{ | ||
service = "storage.googleapis.com" | ||
log_config = [{ log_type = "DATA_WRITE" | ||
}] | ||
}, | ||
{ | ||
service = "container.googleapis.com" | ||
log_config = [{ log_type = "DATA_READ" }] | ||
} | ||
] | ||
exclude_logs_filter = [ | ||
{ | ||
name = "nsexcllusion2" | ||
description = "Exclude logs from namespace-2 in k8s" | ||
filter = "resource.type = k8s_container resource.labels.namespace_name=\"namespace-2\" " | ||
}, | ||
{ | ||
name = "nsexcllusion1" | ||
description = "Exclude logs from namespace-1 in k8s" | ||
filter = "resource.type = k8s_container resource.labels.namespace_name=\"namespace-1\" " | ||
} | ||
] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "threat_detection" { | ||
|
@@ -25,4 +59,4 @@ resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement" { | |
enabled = true | ||
components = [module.pub-sub.pubsub_datasource_component_id] | ||
depends_on = [sysdig_secure_cloud_auth_account_feature.config_posture, module.pub-sub] | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/examples/modular_single_project/pub-sub-admin-write-only1.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#--------------------------------------------------------------------------------------------- | ||
# Ensure installation flow for foundational onboarding has been completed before | ||
# installing additional Sysdig features. | ||
#--------------------------------------------------------------------------------------------- | ||
|
||
module "pub-sub" { | ||
source = "../../../modules/integrations/pub-sub" | ||
project_id = module.onboarding.project_id | ||
sysdig_secure_account_id = module.onboarding.sysdig_secure_account_id | ||
ingestion_sink_filter = "" | ||
audit_log_config = [ | ||
{ | ||
service = "allServices" | ||
log_config = [] | ||
} | ||
] | ||
exclude_logs_filter = [] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "threat_detection" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_THREAT_DETECTION" | ||
enabled = true | ||
components = [ module.pub-sub.pubsub_datasource_component_id ] | ||
depends_on = [ module.pub-sub ] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT" | ||
enabled = true | ||
components = [module.pub-sub.pubsub_datasource_component_id] | ||
depends_on = [sysdig_secure_cloud_auth_account_feature.config_posture, module.pub-sub] | ||
} |
29 changes: 29 additions & 0 deletions
29
test/examples/modular_single_project/pub-sub-admin-write-only2.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#--------------------------------------------------------------------------------------------- | ||
# Ensure installation flow for foundational onboarding has been completed before | ||
# installing additional Sysdig features. | ||
#--------------------------------------------------------------------------------------------- | ||
|
||
module "pub-sub" { | ||
source = "../../../modules/integrations/pub-sub" | ||
project_id = module.onboarding.project_id | ||
sysdig_secure_account_id = module.onboarding.sysdig_secure_account_id | ||
ingestion_sink_filter = "" | ||
audit_log_config = [] | ||
exclude_logs_filter = [] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "threat_detection" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_THREAT_DETECTION" | ||
enabled = true | ||
components = [ module.pub-sub.pubsub_datasource_component_id ] | ||
depends_on = [ module.pub-sub ] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement" { | ||
account_id = module.onboarding.sysdig_secure_account_id | ||
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT" | ||
enabled = true | ||
components = [module.pub-sub.pubsub_datasource_component_id] | ||
depends_on = [sysdig_secure_cloud_auth_account_feature.config_posture, module.pub-sub] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,40 @@ module "pub-sub" { | |
source = "../../../modules/integrations/pub-sub" | ||
project_id = module.onboarding.project_id | ||
sysdig_secure_account_id = module.onboarding.sysdig_secure_account_id | ||
ingestion_sink_filter = "protoPayload.@type = \"type.googleapis.com/google.cloud.audit.AuditLog\" (protoPayload.methodName!~ \"\\.(get|list)$\" OR protoPayload.serviceName != (\"k8s.io\" and \"storage.googleapis.com\"))" | ||
audit_log_config = [ | ||
{ | ||
service = "cloudsql.googleapis.com" | ||
log_config = [{ log_type = "DATA_READ", | ||
exempted_members = [ | ||
"serviceAccount:[email protected]", | ||
] | ||
}, | ||
{ log_type = "DATA_WRITE" } | ||
] | ||
}, | ||
{ | ||
service = "storage.googleapis.com" | ||
log_config = [{ log_type = "DATA_WRITE" | ||
}] | ||
}, | ||
{ | ||
service = "container.googleapis.com" | ||
log_config = [{ log_type = "DATA_READ" }] | ||
} | ||
] | ||
exclude_logs_filter = [ | ||
{ | ||
name = "nsexcllusion2" | ||
description = "Exclude logs from namespace-2 in k8s" | ||
filter = "resource.type = k8s_container resource.labels.namespace_name=\"namespace-2\" " | ||
}, | ||
{ | ||
name = "nsexcllusion1" | ||
description = "Exclude logs from namespace-1 in k8s" | ||
filter = "resource.type = k8s_container resource.labels.namespace_name=\"namespace-1\" " | ||
} | ||
] | ||
} | ||
|
||
resource "sysdig_secure_cloud_auth_account_feature" "threat_detection" { | ||
|
@@ -23,4 +57,4 @@ resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement" { | |
enabled = true | ||
components = [module.pub-sub.pubsub_datasource_component_id] | ||
depends_on = [sysdig_secure_cloud_auth_account_feature.config_posture, module.pub-sub] | ||
} | ||
} |