Skip to content

Slice 1: map scan output to topology.json (#8) - #15

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

Slice 1: map scan output to topology.json (#8)#15
nkcoder merged 1 commit into
mainfrom
slice-1/scan-impl

Conversation

@nkcoder

@nkcoder nkcoder commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Closes #8. Turns scan from an exploratory --raw dump into a real, normalized topology.json.

What

  • Scanner: added DescribeVpcEndpoints collector; account id resolved via STS GetCallerIdentity.
  • Mapper (internal/awsscan/mapper.go): pure RawBackbone -> topology.Snapshot. Routes collapsed to {destination,target,state} (GatewayId sub-typed local/igw/vpce; unmapped -> unknown); SG permissions flattened to atomic rules; tags -> maps; ENI ownership signals stored raw.
  • scan (without --raw) now writes topology.json and prints a summary.

Verified against real data

Ran the mapper over the testenv dump (raw.json + vpce.raw.json) with a throwaway test (removed before commit):

  • 1 VPC / 2 subnets / 2 route tables / 5 ENIs / 4 SGs / 1 endpoint
  • gateway-endpoint route pl-6ca54005 -> vpc-endpoint-gw/vpce-…
  • SG-ref chain alb->app->db + default self-ref all flattened
  • ENI signals instance / amazon-elb / amazon-rds preserved

Follow-ups

CI

go build / go test / golangci-lint clean locally.

- awsscan: add DescribeVpcEndpoints collector; STS-based account id
- mapper: RawBackbone -> topology.Snapshot (routes/SG-rules/endpoints
  normalized per the schema; ENI ownership signals stored raw)
- scan (non --raw) now writes a normalized topology.json
- verified mapping against the real testenv dump (5 ENIs, SG chain,
  gateway-endpoint route all map correctly)

Closes #8
@nkcoder
nkcoder merged commit 752c111 into main Jul 12, 2026
1 check passed
@nkcoder
nkcoder deleted the slice-1/scan-impl branch July 12, 2026 10:46
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.

Implement scan -> write topology.json

1 participant