Repository navigation
feat: segmentation policy checks, dual-stack exposure, signed evidence, unknown-service grouping - #16
Merged
Merged
Conversation
…e, unknown-service grouping Four audit features aimed at verifying one's own network: - `tcpcat policy check <policy.yaml> --from <vantage>`: segmentation testing as code. A YAML policy declares zones and, per vantage, which TCP ports may (allow) or must (require) be reachable. Checked with connect probes; exit 1 on violation, JSON + SARIF reports. `tcpcat policy matrix` merges the reports of several vantages. Unknown policy keys are rejected. - `--dual-stack`: scan the DNS-published IPv6 address of each IPv4 target on the same ports and report ports open on IPv6 only (firewall rules written for IPv4 alone). New `dual_stack` JSON field, DUAL-STACK-IPV6-ONLY SARIF rule; the IPv6 leg uses TCP connect since raw scans only build IPv4. - `--evidence <file>` / `--evidence-key`: bundle of every open port (when, from where, how it answered) with secrets redacted, a SHA-256 digest and an optional Ed25519 signature. `tcpcat evidence keygen|verify` and `tcpcat replay`, which refuses a tampered bundle, re-probes each finding and exits 0 only when all are fixed. - With -sV, unrecognized services are grouped across hosts by normalized banner and printed with a suggested signature; `--fingerprints-out` exports the groups without addresses or raw banners. Subcommands are dispatched before the scanner's flag parsing. SARIF locations now bracket IPv6 addresses. Adds go.yaml.in/yaml/v3.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Four audit features for verifying one's own network:
tcpcat policy check <policy.yaml> --from <vantage>: segmentation testing as code. A YAML policy declares zones and, per vantage point, which TCP ports may (allow) or must (require) be reachable. Checked with TCP connect probes (no root). Exit0compliant /1violation /2error, with JSON and SARIF reports, so it can gate CI after a firewall change.tcpcat policy matrixmerges reports from several vantages. Unknown policy keys are rejected (a typo can't turn a rule into "allow nothing");--scope-fileis honored.--dual-stack: scans the DNS-published IPv6 address of each IPv4 target on the same ports and reports ports open on IPv6 only — the usual sign of firewall rules written for IPv4 alone. tcpcat previously scanned only the IPv4 address of dual-stack names. Newdual_stackJSON field andDUAL-STACK-IPV6-ONLYSARIF rule.--evidence <file>/--evidence-key,tcpcat evidence keygen|verify,tcpcat replay: a bundle of every open port (when, from where, how it answered; secrets redacted) with a SHA-256 digest and an optional Ed25519 signature (standard PKCS#8/PKIX PEM).replayrefuses a tampered bundle, re-probes each finding and exits0only when all are fixed.-sV): unrecognized banners are normalized and grouped across hosts, each group printed with a suggested signature;--fingerprints-outexports groups without addresses or raw banners.Other changes: subcommands are dispatched before the scanner's flag parsing; SARIF locations bracket IPv6 addresses (
tcp://[::1]:22). New dependency:go.yaml.in/yaml/v3(the maintained YAML fork).Checklist
gofmt -l .produces no outputgo vet ./...passesgo test -race ./...passesREADME.md/docs/for user-facing changesTest plan
internal/policy,internal/dualstack,internal/evidence,internal/fingerprint).-race,go vet, golangci-lint (0 issues) and gosec run in a Linux container; also run on macOS.::1only is flagged as IPv6-only forlocalhost;127.0.0.1and::1is grouped with a working suggested regex, and the export contains no address.