feat(single-vm/aws): add VPC Flow Logs to close SECURITY-DEFAULTS gap#9
Open
dmchaledev wants to merge 1 commit into
Open
feat(single-vm/aws): add VPC Flow Logs to close SECURITY-DEFAULTS gap#9dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
SECURITY-DEFAULTS.md has long claimed VPC Flow Logs are enabled by default, but the single-vm/aws core module had no flow-log resources. This gap meant customers relying on the documented default had no flow logs at all. Adds the same pattern already present in unlimited-scale/aws: - aws_cloudwatch_log_group (30-day retention, optional CMK) - aws_iam_role + aws_iam_role_policy scoped to that log group - aws_flow_log targeting the caller-provided vpc_id Variable enable_flow_logs defaults to true (matching SECURITY-DEFAULTS.md). Wrappers asm-aws-single and sat-aws-single are updated to forward the variable and re-export the new flow_log_group_name output so the wrapper-forwarding CI gate passes. ha-hot-hot/aws has the same gap and is tracked separately. https://claude.ai/code/session_01B6D637ANdrxC826zTQmSYi
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SECURITY-DEFAULTS.mdhas always stated:But
modules/single-vm/awshad zero flow-log resources — noaws_flow_log, no CloudWatch log group, no IAM role. Customers reading the security documentation and deploying the single-vm tier had no flow logs at all, creating a silent compliance and forensics gap.unlimited-scale/awsalready ships the correct implementation. This PR ports that pattern tosingle-vm/awsand updates both product wrappers to keep thewrapper-forwardingCI gate green.Changes
modules/single-vm/aws/variables.tfenable_flow_logs(bool, defaulttrue)modules/single-vm/aws/main.tfaws_cloudwatch_log_group,aws_iam_role,aws_iam_role_policy,aws_flow_log— identical pattern tounlimited-scale/awsmodules/single-vm/aws/outputs.tfflow_log_group_nameoutputmodules/asm-aws-single/{variables,main,outputs}.tfenable_flow_logs, re-exportflow_log_group_namemodules/sat-aws-single/{variables,main,outputs}.tfNo new Checkov suppressions needed —
CKV_AWS_338(CW log retention < 1 year) andCKV_AWS_158(CW log group KMS when CMK is off) are already suppressed with documented rationale, and the#tfsec:ignore:aws-iam-no-policy-wildcardsinline annotation handles thelogs:DescribeLogGroups Resource = "*"requirement exactly as inunlimited-scale/aws.What this does NOT change
ha-hot-hot/awshas the same gap. That's a larger module with its own VPC and more surface area — tracked separately so this small, self-contained fix can ship now.single-vm/azureNSG flow log parity is a follow-on.enable_flow_logs = true(the new default) on a VPC that already has a flow log is additive — AWS supports multiple flow log configurations per VPC. Operators who want to opt out can setenable_flow_logs = false.Test plan
terraform validatepasses onmodules/single-vm/aws,asm-aws-single,sat-aws-singlewrapper-forwardingcheck passes (new variable is forwarded by both wrappers)tflintpassescheckovpasses (no new suppressions added)flow_log_group_nameoutput is non-empty afterterraform applyon a test VPChttps://claude.ai/code/session_01B6D637ANdrxC826zTQmSYi
Generated by Claude Code