You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 76ae56c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cloud-security): add missing logGroupName to CreateLogGroup remediation (#3515)
* fix(cloud-security): add missing logGroupName to CreateLogGroup remediation
## Problem
Auto-remediation for the CloudTrail/CloudWatch Logs compliance finding fails silently. The CreateLogGroup API call rejects the request because no log group name is supplied, leaving the resource non-compliant. Customers who fall back to manual remediation steps also report difficulty completing them independently.
## Root cause
The CreateLogGroupCommand in the auto-remediation flow does not enforce or supply the required logGroupName parameter. Unlike PutMetricFilter (which has both a required-params check and a deterministic name injector), CreateLogGroup lacks these guards. The parameter reaches the AWS API as undefined, causing rejection.
## Fix
Add logGroupName to REQUIRED_PARAMS in aws-command-executor.ts alongside an injector that defaults the name to aws-cloudtrail-logs, mirroring the pattern already established for PutMetricFilter. This ensures the CreateLogGroup call always includes a valid name without manual configuration.
## Explicitly NOT touched
Manual remediation step clarity (addressed separately if needed). Parser or orchestration logic outside cloud-security scope. Any other compliance remediations.
## Verification
Added regression test asserting that CreateLogGroup remediation includes a valid logGroupName parameter and passes validation. Unit tests for aws-command-executor and the injector logic pass locally ✅
* fix(bug-todo): address cubic review
Address review findings.
* fix(cloud-security): fail-fast on missing log group name; no false-success backfill (CS-787)
Two gaps in the CreateLogGroup remediation fix:
1. Add CreateLogGroupCommand: ['logGroupName'] to REQUIRED_PARAMS. A CreateLogGroup
with no name was reaching AWS and failing with an opaque "Member must not be
null", silently failing the whole remediation. This also protects every sibling
remediation that mints a log group (Step Functions, SSM, Transfer Family), which
the CloudTrail-only name backfill deliberately skips.
2. The name backfill only fills a name it can DERIVE from the trail's log-group ARN
(guarantees the created group matches what UpdateTrail links to = complete fix).
When no step carries a parseable CloudWatchLogsLogGroupArn, nothing links the
trail to the group, so defaulting the name created an orphan log group and
reported a FALSE success on a still-non-compliant finding. Now it leaves the
step unfilled so REQUIRED_PARAMS rejects it and the fix falls back honestly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments