Repository navigation
Test every guardrail limit and stop flagging dead-letter queues - #267
Merged
Merged
Conversation
…[skip ci] The require-dead-letter-queue guardrail and the queue-without-dead-letter-queue posture rule asked every queue for a redrivePolicy, including the queue another queue sends its failures to. An organization with the guardrail could only deploy a queue with a dead-letter queue by making the two queues redrive into each other, and the Console's suggested fix (add a dead-letter queue) produced a new finding for the queue it added. A queue named as a stack queue's redrive target is now exempt from both rules. The guardrail spec now covers every limit the CLI enforces: each one admits its boundary and the defaults normalization applies, blocks the first configuration past it, and goes through the schema the Console uses when an admin saves it. Before this, stage, region, resource-type, memory/timeout, container, engine, instance-size (read replicas), custom-domain, resource-count and DLQ guardrails could be broken without any test failing. The posture spec now covers an OpenSearch domain left at its default internet accessibility, and the Trivy spec checks that a rejected download leaves no staging files behind. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Trivy test [skip ci] The MiniStack inventory scenario only ever had one earlier inventory in the bucket, so picking the oldest instead of the newest went unnoticed. It now deploys once more with the third deployment's packages and requires that inventory to be reused. The STACKTAPE_TRIVY_PATH unit test is deleted: the MiniStack inventory scenario runs through that override and fails when it is ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…olicy [skip ci] The require-dead-letter-queue pages still said every queue needs a redrivePolicy. Since the previous commit, a queue that another stack queue names as its redrive target is exempt, which is also what the example on the page relies on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
This is the second testing sweep for security inventories, guardrails and posture (slices S61, S62, S67). I broke the product code on purpose, one realistic fault at a time, and counted which faults a test noticed. The score goes from 34/52 to 52/52 across the three slices. The biggest gap was guardrails, at 2/14: stage, region, resource-type, container, engine, instance-size (read replicas), custom-domain, resource-count and dead-letter-queue limits could all be broken without any test failing. The 145-file CLI source suite also passed with every one of those faults applied.
The guardrail spec now has one table-driven scenario through the real ConfigManager. Each limit has to admit its boundary and the defaults normalization applies, block the first configuration past it, and pass the schema the Console uses when an admin saves the policy. The posture spec now includes an OpenSearch domain left at its default internet accessibility. The Trivy spec checks that a rejected download leaves no staging files behind. The MiniStack inventory scenario now deploys a fourth time, so choosing the oldest earlier inventory instead of the newest no longer goes unnoticed.
While writing the guardrail scenario I found a bug, which this PR fixes. The
require-dead-letter-queueguardrail and thequeue-without-dead-letter-queueposture rule also asked the dead-letter queue itself for aredrivePolicy. An organization with that guardrail could only deploy a queue with a dead-letter queue by making the two queues redrive into each other. The Console's suggested fix (add a dead-letter queue) also created a new finding for the queue it added. Queues that a stack queue names as its redrive target are now exempt from both rules. Both specs reproduced the bug before the fix.I deleted the
STACKTAPE_TRIVY_PATHunit test. The MiniStack inventory scenario runs through that override and fails when it is ignored. The Console side is stacktape/console-app#115. This PR does not move the Console pointer.Checked locally (CI is off):
cli-security-rules, the MiniStack inventory and deploy lanes, the CLI source suite (151 files) and smoke test,test:db --securityand--insights,test:tools, andpnpm check:integratedup toturbo run test. That run stopped on two failures that also happen on cleanorigin/main, outside these slices:helper-lambda-sdk.spec.tshits its 120 s timeout because packaging now compiles the code-swap benchmark three times, andfast-deploy.spec.tscounts 3 upload timeouts in the shared-layer scenario. I ran the gate's remaining steps on their own (build, tool types, pack, architecture, dead code, duplicates) and they pass.ministack-deploypassed except for that samefast-deploy.spec.tscase.After review: the guardrail docs still said every queue needs a
redrivePolicy, so they now describe the dead-letter queue exemption, and the generated LLM docs corpus is regenerated to match. The branch is merged with the latest main.pnpm check:integratedstops at the samehelper-lambda-sdk.spec.tstimeout as before, which also happens on main. Everything before it passes, including docs and generation checks, and so do the later steps (build, tool types, pack, architecture, dead code, duplicates) run on their own.