Contributing¶
Bug reports, fixes and documentation improvements are welcome. Report suspected vulnerabilities privately; see Security. Everyone taking part follows the Code of Conduct.
Development setup¶
git clone https://github.com/anaynayak/aws-security-viz
cd aws-security-viz
bundle install
- Tests:
bundle exec rspec. The integration specs need the Graphvizdotbinary. - Lint:
bundle exec standardrb. Both commands must pass before a pull request. - Browser specs:
spec/html_renderer_spec.rbdrives the HTML viewer in headless Chromium. Install it once withuv run --group browser playwright install chromium(add--with-depson Linux); the specs are pending, with a reason, whileuvor Chromium is missing. CI setsBROWSER_SPECS=required, so a missing install fails there. - Run from the checkout:
bundle exec exe/aws_security_viz -o spec/integration/dummy.json -f /tmp/out.svg.
Supported Ruby versions are 3.3, 3.4 and 4.0.
Code layout¶
| Path | Contents |
|---|---|
lib/aws_security_viz/cli.rb, cli_guard.rb |
Option parsing, exit codes and error messages. |
lib/aws_security_viz/provider/ |
Where security groups come from: the EC2 API or a JSON file. |
lib/aws_security_viz/ec2/, model.rb |
Security group model and traffic derivation. |
lib/aws_security_viz/graph.rb, graph_filter.rb |
The graph, source and target filters, risk counting. |
lib/aws_security_viz/risk.rb |
The risky ingress rule. |
lib/aws_security_viz/renderer/ |
One renderer per output family: html, json, mermaid, graphviz. |
lib/aws_security_viz/export/html/ |
The HTML viewer template. |
spec/ |
Specs; fixtures in spec/fixtures and spec/integration. |
Adding a renderer¶
- Add a class under
lib/aws_security_viz/renderer/withinitialize(file_name, config),add_node(name, opts),add_edge(from, to, opts)andoutput. - Register it in
renderer/all.rb: theALLtable and, for extension inference,EXTENSIONS. - Add specs and document the format on the Outputs page.
Pull requests¶
- Keep commits small and single-purpose. Every behaviour change or bug fix comes with a spec that fails before the change and passes after.
- Keep the suite and
standardrbgreen at every commit. - Update
CHANGELOG.mdunder[Unreleased]for user-visible changes. - Write prose in plain ASCII and without working notes.
Building the documentation¶
The site is MkDocs Material. Its dependencies are locked with uv in pyproject.toml and uv.lock.
uv run --group docs mkdocs serve
uv run --locked --group docs mkdocs build --strict
Pages live in docs/. The changelog and security pages include CHANGELOG.md and SECURITY.md, so edit those files,
not the pages. The viewer screenshots and the social card are generated from spec/integration/docs_vpcs.json (three VPCs, so the pictures show grouping) by
script/docs-screenshots (needs uv and headless Chromium installed through Playwright). A spec checks that every
command line option appears on the Configuration page.
Releases¶
Releases are cut by the maintainer from a version tag. The process is in RELEASING.md.