Repository navigation
chore: pin actions by SHA, add CodeQL, Dependabot, and a working self-scan - #105
Merged
Merged
Conversation
Positive cases (nmap, port scan, portscan, network scan, host discovery, service enumeration) and negative cases where "port scan" sits inside a word: "import scan", "export scan", "support scan", "Report scanning". At this commit the 4 negative cases fail. Refs #103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
The first pattern had no word boundary, so "port\s*scan" matched inside "import scan", "export scan", "support scan", and "Report scanning". Python in this repo's own workflows (from scanner.scanner import scan) was a HIGH finding. Add a leading \b. The positive cases still match. Refs #103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
Real-rule tests: nmap, port scan, portscan, port scanning, network scan must fire; "import scan", "export scan", "support scan", and "Report scanning" must not. At this commit 4 cases fail: the 3 negatives fire, and "portscan" (no space) is missed by the literal "port scan". Refs #103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
The literal "port scan" matched inside "import scan" (this repo's own pr-review.yml) and missed "portscan". Use /\bport\s*scan/ and /\bnetwork\s*scan/, matching the pattern-engine fix. All 8 real-rule cases pass. Refs #103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
The bawbel-self-scan hook ran bawbel scan docs/ --recursive, and .bawbelignore lists docs/**, so it could never report anything. It also ran whatever bawbel was on PATH, not this checkout. Add scripts/self_scan.sh: scan CLAUDE.md, the top-level docs, bawbel.yml, server.json, and .github/ with python3 -m scanner.cli and fail on HIGH. Fixtures, rules, recorded scan data, docs/, and CHANGELOG.md describe attacks on purpose and are not scanned; the golden fixture must stay out of .bawbelignore. The hook now runs the script. Refs #103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
…ot, self-scan job Pin all 30 uses: lines to the commit their current tag or branch points to, with the version in a trailing comment. Add a top-level permissions block (contents: read) to ci.yml, pr-review.yml, and publish.yml; the publish jobs keep their own id-token: write and pr-title its pull-requests: read. Add code-scan.yml (CodeQL, Python), .github/dependabot.yml (pip and github-actions), and a self-scan CI job that runs scripts/self_scan.sh, replacing the commented-out job. Refs #103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Open
7 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #103
What and why
Supply-chain hardening for CI, plus a self-scan that can actually find something.
Commits, test first
Self-scan. The old hook ran
bawbel scan docs/ --recursive, and.bawbelignorelistsdocs/**, so it could never report a finding; it also ran whateverbawbelwas on PATH.scripts/self_scan.shscans CLAUDE.md, the top-level docs,bawbel.yml,server.json, and.github/withpython3 -m scanner.cli(this checkout) and fails on HIGH. The pre-commit hook and the newself-scanCI job (pip install -e ".[yara]") both run it.A literal
bawbel scan . --recursivereports 62 CRITICAL/HIGH findings, all in content that contains attack text on purpose: tests/fixtures (16), scripts/*.json scan data (23), scanner/rules/semgrep (14), tests/fixtures/golden (6), CHANGELOG.md (2), plus the false positive below. The golden fixture cannot go in.bawbelignore(its tests would see it suppressed), so the script lists targets instead.False positive the self-scan surfaced.
.github/workflows/pr-review.yml:56(from scanner.scanner import scan) matched bothbawbel-network-recon(pattern) andAVE_NetworkRecon(YARA): "port scan" inside "import scan". Both now need a word boundary before "port"; "port scanning" and "portscan" still match (the YARA literal missed "portscan" before).CI hardening
uses:lines pinned, version in a trailing comment:permissions: contents: readin ci.yml, pr-review.yml, publish.yml, code-scan.yml. Publish jobs keepid-token: write; pr-title keepspull-requests: readcode-scan.yml(CodeQL, Python), modeled on bawbel/gate's.github/dependabot.yml: pip and github-actions, weeklyNot in this PR: hash-pinned
pip installlines (14 in the workflows), which Scorecard Pinned-Dependencies also counts. That is a lockfile decision: #104.Output contract impact
Fields added: none
Fields renamed: none
Fields removed: none
Detection change: the network-recon rules stop matching "port scan" inside a word; they start matching "portscan" in YARA.
Checks
Commits were made with
--no-verify: the two test-first commits on purpose (their tests fail), the others right after pre-commit passed on the same staged tree.Seen, not changed: the same line appended to SECURITY.md or README.md is suppressed by design (negation context; README.md:194 is a line of documentation,
<!-- bawbel-ignore-start/end -->, that the scanner reads as an openingbawbel-ignore-startwith no matching end, so every line after 194 is suppressed). That marker parsing is worth its own issue.🤖 Generated with Claude Code