Skip to content

Slice 1: golden fixture + account sanitizer (#9) - #16

Merged
nkcoder merged 1 commit into
mainfrom
slice-1/fixture
Jul 12, 2026
Merged

Slice 1: golden fixture + account sanitizer (#9)#16
nkcoder merged 1 commit into
mainfrom
slice-1/fixture

Conversation

@nkcoder

@nkcoder nkcoder commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Closes #9. The sanitized golden fixture every later slice tests against — no live AWS from here on.

What

  • internal/topology.Sanitize — redacts the AWS account id (in account, ARNs, SG-peer accounts, ENI instance-owner ids). Keeps resource ids + RFC1918 IPs (not sensitive, needed for reasoning); preserves service owners (amazon-elb/amazon-rds).
  • scan --scrub — applies the same redaction, so the fixture is reproducibly regenerable from a real scan (and doubles as the DESIGN "shareable snapshot" feature).
  • testdata/testenv.golden.json — sanitized snapshot of the testenv: 1 VPC / 2 subnets / 2 route tables / 5 ENIs (instance ×2, ALB ×2, RDS) / 4 SGs (alb→app→db chain + default self-ref) / 1 gateway endpoint + its prefix-list route.

Generated offline from the captured dumps (option 2) using ToSnapshot + Sanitize; verified 0 occurrences of the real account id.

Next

#10 adds round-trip + fixture-load tests over this file.

CI

go build / go test / golangci-lint clean.

- internal/topology.Sanitize: redact AWS account id (Account, ARNs,
  SG-peer accounts, ENI instance-owner ids); keep resource ids + RFC1918 IPs
- scan --scrub: reproducible sanitized snapshots (shareable / fixtures)
- testdata/testenv.golden.json: sanitized snapshot of the testenv
  (5 ENIs incl. ALB/RDS, alb->app->db SG chain, gateway-endpoint route)

Closes #9
@nkcoder
nkcoder merged commit 210f32f into main Jul 12, 2026
1 check passed
@nkcoder
nkcoder deleted the slice-1/fixture branch July 12, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sanitize + commit golden fixture

1 participant