drift-dataset-automated-sec-rep - #21
Open
data-Ja3g3r wants to merge 1 commit into
Open
Conversation
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.
CDK Drift Benchmark Suite — 18 benchmarks across 5 families
Summary
Adds
versionozed_gt/— 18 independent parallel evolutions of theautomated-security-responseCDK stack, one per drift scenario. Every benchmark is a realgit repository with real commits (4 to 14 each, 4 minimum) and a per-commit synthesized
CloudFormation template. All 18 share commit C1 =
d29eb3abyte-for-byte; divergencestarts at C2.
Total: 18 benchmarks, 155 commits, 25 MB, 100% verified and typechecked. Six suites now
total 25 + 30 + 28 + 32 + 21 + 18 = 144 benchmarks.
Sized to the architecture, not to a number
This is a privileged, multi-account automation plane, so the honest drift shape is heavy
on privilege (G) and trust (T), light on reachability (R) — it is fully serverless with
no network layer. R has exactly two members because the only externally-reachable surfaces
are the event trigger and direct Lambda invocation; padding it would invent drifts that do
not exist for this stack.
Drift families
Each family holds severity to a single axis; every benchmark labels exactly two commits —
V2 (Mild) and V3 (Severe) — with the rest benign.
Cross-family pairs are scoreable — G1↔T2 (the same RemediationRole: permission
escalation vs trust widening), G4 (orchestrator bypasses the finding-validation Lambda),
and the S3
BlockPublicAccessdrift E1 is a sextuple-baseline oracle (paste E5 / ecsE3 / support E1 / chatbot E1 / image E1 / secresponse E1).
Commit log structure
Every benchmark's
repository/is a genuine git repo (R1 shown):Author, date and identity are pinned so SHAs are reproducible. Every benchmark's C1 is
d29eb3a; divergence starts at C2.Commit-count distribution (no drift-position collision within a length):
Per-benchmark layout
Each
benchmarks-secresponse/<ID>/mirrors the source dataset's<app>/cdk/folder shape:Tooling written against
automated-security-response/cdk/cdk.out/*.template.jsonworksagainst
benchmarks-secresponse/R1/commits/C5/cdk/cdk.out/*.template.jsonwith only theroot path changed. Resource counts run 29 (baseline) → 31.
metadata.yaml — the answer key
Deliberately outside
repository/so it can't leak into anything a detector reads. Percommit:
sha,label(V1/V2/V3/VB),commit_severity,cumulative_severity, and fordrift commits a
ground_truthblock with mechanism, path, controls present/absent/removed,transitive reach, and a
template_assertionstring.commit_severityis the driftintroduced by that commit;
cumulative_severityis the standing risk at that commit.Suite property worth naming
Template diff size is deliberately anti-correlated with severity. Benign cost-allocation
tag commits produce the largest diff (242 lines); severe commits flip one or a few fields:
Any detector triaging by diff magnitude scores worse than chance.
Sextuple-baseline oracle (free ground truth)
The source dataset's metrics bucket uses
BlockPublicAccess.BLOCK_ALL; E1 drifts it toall-false — the same mechanism as
benchmarks/E5,benchmarks-ecs/E3,benchmarks-support/E1,benchmarks-chatbot/E1andbenchmarks-image/E1. Detectorperformance on synthetic vs. real curated drift for one mechanism is now comparable across
six different stacks.
Known limitation
The baseline ships no
package.jsonat the cdk root, so noaws-cdk-libversion isdeclared; all templates were synthesized with 2.150.0 and commits flag
version_match: falseinprovenance.json(declaring the 2.100.0 default supplied at import). Within abenchmark every template comes from one library version, so cross-commit diffs are clean.
One tsc-only fix is applied: the deprecated
targets.KinesisFirehoseStreamused as a logSubscriptionFilter destination has an incompatible
bindsignature under 2.150.0; itsynthesizes correctly, and an extra
as anyon the already-cast expression satisfies thetype checker without changing behaviour. Because raw
ts-nodesynth does not readcdk.json, the required context (adminAccountId,memberAccountId,primaryRegion,notification email, log retention, and the encryption feature flags) is injected via
synth_context.json.Not included
threat-model.json,canonical_ir.json, the7.*graph IRs,architecture.pnganddiagram.pyfrom the source dataset are absent — they come from tooling outside thisgenerator. A stale threat model copied forward would falsely assert "nothing changed" at
exactly the commits where the remediation role turns admin or the trigger opens to any
event, which is worse than having none. Run your own pipeline over
commits/C*/cdk/toproduce them.