Slice 1: golden fixture + account sanitizer (#9) - #16
Merged
Conversation
- 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
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.
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 (inaccount, 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-lintclean.