Skip to content

Commit 78dee01

Browse files
TMHSDigitalclaude
andcommitted
docs: document -sarif; gofmt the SARIF test
Follow-up to 41a23ea: the README flag row and the Monitoring upload step were not applied, and main_lab_test.go was not gofmt'ed. Refs #129 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 41a23ea commit 78dee01

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ make help # list all targets
285285
| `-exclude <list>` | n/a | Comma-separated out-of-scope names: exact (`vpn.example.com`) or `*.parent` (every name below `parent`, not `parent` itself). Excluded names are never queried, probed or expanded, and are counted as `excluded` |
286286
| `-exclude-file <file>` | n/a | Same patterns, one per line (`#` comments allowed), e.g. a bug-bounty program's out-of-scope list |
287287
| `-stats <file>` | n/a | Write a JSON run-quality report (outcomes, queries sent, verdict); see [Run-quality report](#run-quality-report) |
288+
| `-sarif <file>` | n/a | Write takeover candidates as SARIF 2.1.0 for GitHub code scanning; needs CNAME in `-type` |
288289
| `-tui` | `false` | Launch the interactive Terminal UI |
289290
| `-version` | n/a | Print version and exit |
290291
| `-retries <n>` | n/a | **Deprecated** - alias for `-attempts`, prints a warning |

‎docs/monitoring.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,22 @@ A failed, degraded or unreliable scan uploads nothing, so the next run still
147147
compares against the last complete baseline. To keep a baseline longer than 90 days,
148148
commit `previous.jsonl` to a branch or store it in object storage instead.
149149

150+
## Takeover candidates in code scanning
151+
152+
Add `-type A,AAAA,CNAME -sarif takeovers.sarif` to the scan and upload the file
153+
after it, and every dangling or takeover-prone CNAME becomes an alert in the
154+
repository's Security tab, where it can be triaged and dismissed. Alerts are
155+
fingerprinted per name, so a candidate seen every week stays one alert. The
156+
job needs `security-events: write`:
157+
158+
```yaml
159+
- name: Upload takeover candidates
160+
if: always() && hashFiles('takeovers.sarif') != ''
161+
uses: github/codeql-action/upload-sarif@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
162+
with:
163+
sarif_file: takeovers.sarif
164+
category: subenum
165+
```
166+
150167
A webhook works the same way as the issue step: post `changes.jsonl` (or the
151168
`added` names) to Slack, Teams or your alerting endpoint.

‎main_lab_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func TestE2ESARIF(t *testing.T) {
194194
} `json:"driver"`
195195
} `json:"tool"`
196196
Results []struct {
197-
RuleID string `json:"ruleId"`
197+
RuleID string `json:"ruleId"`
198198
Message struct{ Text string } `json:"message"`
199199
Locations []struct {
200200
PhysicalLocation struct {

0 commit comments

Comments
 (0)