Skip to content

[comp] Production Deploy#3051

Merged
tofikwest merged 7 commits into
releasefrom
main
Jun 5, 2026
Merged

[comp] Production Deploy#3051
tofikwest merged 7 commits into
releasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 5, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Fixes AWS auto-fix for CloudWatch metric filters by enforcing required params, allowing empty filterPattern, normalizing metric transformations, and aligning prompt guidance so plans stop falling back to manual steps. Improves reliability of CIS CloudTrail metric-filter remediation.

  • Bug Fixes
    • Pre-execution validation for PutMetricFilterCommand: require non-empty logGroupName, filterName, metricTransformations; require filterPattern to be present but allow "".
    • Added normalizeMetricFilterTransformations to wrap a single transformation into an array and coerce metricValue to a string.
    • Updated remediation prompt and tests: always use the discovered, real CloudTrail logGroupName (not "CloudTrail/DefaultLogGroup"); reflect array shape, string metricValue, and the empty-filterPattern case.

Written for commit 80d3275. Summary will update on new commits.

Review in cubic

github-actions Bot and others added 3 commits June 5, 2026 16:57
Customer (aymenrc) reported AWS auto-fix falling back to manual steps with
"required parameters were not properly provided… metric transformations were
not properly provided to the CloudWatch Logs API" on the CIS CloudWatch
metric-filter checks. That finding IS meant to be auto-fixable (PutMetricFilter
+ CreateTopic + PutMetricAlarm — all standard API calls), so this is a bug, not
an inherently-manual finding.

Root cause: PutMetricFilterCommand was absent from REQUIRED_PARAMS, so a step
with a missing/mis-shaped `metricTransformations` wasn't caught before
execution — it went to AWS, got rejected, and fell back to manual steps. The
model commonly emits metricTransformations as a single object instead of an
array, or metricValue as the number 1 instead of "1", both of which AWS rejects.

- aws-command-executor: add PutMetricFilterCommand to REQUIRED_PARAMS
  (logGroupName, filterName, filterPattern, metricTransformations) so a missing
  field fails fast and triggers the existing AI repair pass; and add a
  deterministic normalizer (normalizeMetricFilterTransformations) that wraps a
  single transformation object in an array and coerces metricValue to a string.
- ai-remediation.prompt: explicit PutMetricFilter shape guidance
  (metricTransformations array, string metricValue, real logGroupName).
- Tests: REQUIRED_PARAMS enforcement + normalizer cases.

Full cloud-security suite green (310 passing); changed files typecheck clean.
Not yet verified against a live failing finding — covers the failure class.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
fix(cloud-security): make CloudWatch metric-filter auto-fix reliable
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor (staging) Ready Ready Preview, Comment Jun 5, 2026 10:46pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app (staging) Skipped Skipped Jun 5, 2026 10:46pm
portal (staging) Skipped Skipped Jun 5, 2026 10:46pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 3/5

  • There is a concrete behavior mismatch in apps/api/src/cloud-security/aws-command-executor.ts: PutMetricFilterCommand currently rejects an empty filterPattern, even though AWS permits "", which can block valid requests.
  • Given the medium severity (6/10) and high confidence (9/10), this is a real regression risk for users relying on empty metric filter patterns, so merge risk is moderate rather than low.
  • Pay close attention to apps/api/src/cloud-security/aws-command-executor.ts - validation logic for filterPattern should align with AWS semantics for PutMetricFilterCommand.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/cloud-security/aws-command-executor.ts Outdated
tofikwest and others added 2 commits June 5, 2026 18:19
… validation

Cubic review on #3050: PutMetricFilterCommand had `filterPattern` in
REQUIRED_PARAMS, which (via hasRequiredParamValue) rejects an empty string —
but AWS allows an empty filterPattern (min length 0; an empty pattern matches
all log events). The parameter must be PRESENT, but its value may be "".

- Move `filterPattern` out of REQUIRED_PARAMS (which also rejects "") into a new
  REQUIRED_PRESENT_PARAMS check that only rejects a missing/null value, so ""
  is accepted while a truly-omitted pattern is still caught before execution.
- logGroupName / filterName / metricTransformations stay non-empty-required.
- Tests: empty filterPattern is accepted; a missing one is reported via the
  present-check.

Low practical impact (our CIS metric-filter remediations always emit a non-empty
pattern), but aligns the validator with AWS semantics. Executor spec green (43);
typecheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…tern

fix(cloud-security): allow empty filterPattern for PutMetricFilter validation
@tofikwest
Copy link
Copy Markdown
Contributor

@cubic-dev-ai review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Jun 5, 2026

@cubic-dev-ai review it

@tofikwest I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 4/5

  • This PR looks safe to merge with minimal risk: the only reported issue is medium-low severity (5/10) and is limited to prompt logic rather than a clear runtime break.
  • In apps/api/src/cloud-security/ai-remediation.prompt.ts, conflicting instructions for logGroupName can produce inconsistent PutMetricFilter remediation plans, so behavior may vary across generated outputs.
  • Given the high confidence (9/10), this is worth a follow-up fix, but it does not appear merge-blocking for core functionality.
  • Pay close attention to apps/api/src/cloud-security/ai-remediation.prompt.ts - conflicting logGroupName guidance may lead to inconsistent remediation output.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/api/src/cloud-security/ai-remediation.prompt.ts">

<violation number="1" location="apps/api/src/cloud-security/ai-remediation.prompt.ts:178">
P2: Prompt instructions conflict on `logGroupName` source, which can cause inconsistent remediation plans for PutMetricFilter.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/cloud-security/ai-remediation.prompt.ts
tofikwest and others added 2 commits June 5, 2026 18:40
…ix prompt

Cubic follow-up on the metric-filter work: the prompt told the model two
different things about the CloudWatch logGroupName — the new CLOUDWATCH METRIC
FILTERS section said "use the REAL log group from the read step, never a
placeholder", while the older NO-PLACEHOLDERS section said to use a made-up
"CloudTrail/DefaultLogGroup" default. That inconsistency could produce varying
PutMetricFilter plans.

Nothing in code resolves the literal "CloudTrail/DefaultLogGroup" string (real
values are filled by the refine pass from read-step output), so the real log
group is what's needed. Align the older guidance to "discover the trail's
CloudWatch Logs log group in a read step and use that exact name — do not invent
one", matching the metric-filter section.

Prompt-only change; typecheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…prompt

fix(cloud-security): reconcile conflicting logGroupName guidance in fix prompt
@tofikwest
Copy link
Copy Markdown
Contributor

@cubic-dev-ai review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Jun 5, 2026

@cubic-dev-ai review it

@tofikwest I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit 3a697b3 into release Jun 5, 2026
14 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.73.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants