Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions .github/workflows/gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ name: Security gate
# checked out as data only: nothing from it is executed, no secrets are exposed,
# and the token is read-only. The toolchain is installed before any pull request
# file is on disk.
#
# The scanner is the latest stable am-i-hacked release from npm, pinned to an exact
# version, never the unreleased source on main. Bump AIH_VERSION when a new release
# ships (docs/RELEASING.md).
on:
push:
branches: [main]
Expand All @@ -13,6 +17,9 @@ on:
permissions:
contents: read

env:
AIH_VERSION: 2.0.1

jobs:
security-gate:
name: Security gate
Expand Down Expand Up @@ -41,9 +48,9 @@ jobs:
- name: Scan
env:
TARGET: ${{ github.event_name == 'pull_request_target' && '.review' || '.' }}
run: bash apps/am-i-hacked/bin/scanner.sh "$TARGET"
run: npx --yes "am-i-hacked@${AIH_VERSION}" "$TARGET"

- name: Scan runner (login items, crontab, shell startup, agent config, processes)
run: bash apps/am-i-hacked/bin/scanner.sh --system
run: npx --yes "am-i-hacked@${AIH_VERSION}" --system
# The hosted runner image is not ours; report its findings without blocking merges.
continue-on-error: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Newest first. One line per change. Default-behavior changes marked **CHANGED**. Package versions in brackets.

## 2026-10-10

### CI
- **CHANGED:** the security gate (`.github/workflows/gate.yml`) runs the latest stable `am-i-hacked` release from npm, pinned to an exact version, instead of the unreleased scanner on `main` (#6).

## 2026-10-05

### Skills
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ gh api -X POST repos/IsaacBell/secure-devtools/security-advisories --input advis

## CI gates

The security gate (`.github/workflows/gate.yml`) runs on `pull_request_target` and on pushes to `main`. For pull requests, the workflow file, the scanner, and the toolchain come from the base branch. The pull request's code is checked out into `.review` as data and is never executed. The job has read-only permissions and no secrets. Keep it that way: any step that runs code from `.review` turns this into a way to attack the repository.
The security gate (`.github/workflows/gate.yml`) runs on `pull_request_target` and on pushes to `main`. For pull requests, the workflow file and the toolchain come from the base branch, and the scanner is the latest stable `am-i-hacked` release from npm, pinned to an exact version (`AIH_VERSION`), not the unreleased source on `main`. The pull request's code is checked out into `.review` as data and is never executed. The job has read-only permissions and no secrets. Keep it that way: any step that runs code from `.review` turns this into a way to attack the repository.
1 change: 1 addition & 0 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ npm publish needs 2FA.
```

4. Create the GitHub release from the tag.
5. For `am-i-hacked`, bump `AIH_VERSION` in `.github/workflows/gate.yml` to the new version so the security gate keeps running the latest stable release.

`scripts/release.sh` refuses a private package, a version already on npm, and any
`package.json` with lifecycle scripts (`prepare`, `prepack`, `postinstall` and the like) that
Expand Down
Loading