drift-dataset-image-upload-download - #20
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 — 21 benchmarks across 5 families
Summary
Adds
versionized_gt/— 21 independent parallel evolutions of thesimple-image-upload-download-websiteCDK stack, one per drift scenario. Every benchmarkis a real git repository with real commits (4 to 14 each, 4 minimum) and a per-commit
synthesized CloudFormation template. All 21 share commit C1 =
0cac3cdbyte-for-byte;divergence starts at C2.
Total: 21 benchmarks, 194 commits, 31 MB, 100% verified and typechecked. Five suites
now total 25 + 30 + 28 + 32 + 21 = 136 benchmarks.
Sized to the architecture, not to a number
Each family holds only the drift mechanisms this stack genuinely supports — no padding to
hit a round total. The three reachability drifts (SG bypass, public subnet, IMDSv2/SSRF)
are the real ways internal compute here becomes reachable; E is the largest family because
S3 is the data store and carries several distinct controls (BlockPublicAccess, bucket
policy, at-rest encryption, CORS) alongside EBS and CloudFront.
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.
*, E5 EBS encryption, E6 CloudFront HTTPCross-family pairs are scoreable — G4↔T2 (
AdministratorAccess: internal vscross-account), and the S3
BlockPublicAccessdrift E1 is a quintuple-baseline oracle(paste E5 / ecs E3 / support E1 / chatbot E1 / image E1). Baseline-distinctive axes: R3
IMDSv2→IMDSv1 (EC2 SSRF-to-credential) and E4 S3 CORS
*(browser-upload exposure).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
0cac3cd; divergence starts at C2.Commit-count distribution (no drift-position collision within a length):
Per-benchmark layout
Each
benchmarks-image/<ID>/mirrors the source dataset's<app>/cdk/folder shape:Tooling written against
simple-image-upload-download-website/cdk/cdk.out/*.template.jsonworks against
benchmarks-image/R1/commits/C5/cdk/cdk.out/*.template.jsonwith only theroot path changed. Resource counts run 37 (baseline) → 44.
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 diffs (254–270 lines); severe commits typically flip one
field:
arn:aws:s3:::*)AV_FAIL_OPENfalse → true)*)Any detector triaging by diff magnitude scores worse than chance.
Quintuple-baseline oracle (free ground truth)
The source dataset's image bucket uses
BlockPublicAccess.BLOCK_ALL; E1 drifts it toall-false — the same mechanism as
benchmarks/E5,benchmarks-ecs/E3,benchmarks-support/E1andbenchmarks-chatbot/E1. Detector performance on synthetic vs.real curated drift for one mechanism is now comparable across five 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.
No source normalization was needed — the baseline compiles and synthesizes under 2.150.0 as
written (only a harmless
keyNamedeprecation warning). Because rawts-nodesynth does notread
cdk.json, the required context (applicationName, environmentType, instance type, keypair, and the encryption feature flags) is injected via
synth_context.json; a key pair issupplied so the SSH-0.0.0.0/0 ingress present in the source is realized at C1.
Not included
threat-model.json,canonical_ir.json, the7.*graph IRs,architecture.png,diagram.py, thev1/andv2/variant folders and their checkov/threat-model artifactsfrom the source dataset are absent — they come from tooling outside this generator. A stale
threat model copied forward would falsely assert "nothing changed" at exactly the commits
where the instance is exposed or the bucket goes public, which is worse than having none.
Run your own pipeline over
commits/C*/cdk/to produce them.