Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/repo-harness-guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ Security workflow:
- Add Dependabot config for both Python dependencies and GitHub Actions.
- Consider an Actions workflow linter such as `zizmor` once workflows become non-trivial.

CodeQL alert handling:

- This repo uses code scanning **default setup**; there is no checked-in CodeQL workflow.
- In-source `# codeql[query-id]` comments are **not applied** by GitHub code scanning here: a correctly placed comment (alone on the line immediately above the flagged line, the documented shape) does not stop the alert from being created — verified on `main` after PR #42, where four alerts were filed at commented lines. Keep the comments; they record intent for CLI/IDE readers and are valid CodeQL syntax, but they do not suppress the finding from analysis.
- A dismissal does persist: a dismissed alert stays dismissed across analyses while its code location is unchanged, and can come back as a new alert when a nearby edit shifts the line. Expect occasional re-dismissal, not a one-time cleanup.
- Dismiss alerts from the Security tab, or via the REST API: `PATCH /repos/{owner}/{repo}/code-scanning/alerts/{n}` with `state=dismissed`, `dismissed_reason=won't fix`, and `dismissed_comment` (max 280 characters, enforced by the API). A classic token with `repo` is accepted by this endpoint even though the REST docs list `security_events`.
- `py/clear-text-logging-sensitive-data` fires on the report print helpers (`report_sources.py`, `report_products.py`, `report_summary.py`). They print derived billing figures to the terminal of the user who ran the report — no credentials, tokens, or raw API payloads — so the standing decision is to dismiss as `won't fix` with that rationale on the alert. That decision assumes output stays local: if any path ever captures report stdout into shared CI or build logs, revisit the dismissal instead of letting it stand. In CI none does today — `scripts/check` runs the CLI with `env -u GITHUB_TOKEN` and expects the no-token failure, and the email workflow never uses `--dry-run`. `scripts/smoke` does exercise `--dry-run`, but only locally, with a fake token, writing to `/tmp`, and it is not wired into CI.
- Making in-source suppression effective would require the `advanced-security/dismiss-alerts` action reading a SARIF artifact, which in turn means advanced setup instead of default setup. Not adopted; revisit only if the alert volume becomes unmanageable.

Suggested `scripts/security` contents:

```sh
Expand Down
Loading