cortex-pentest-gate
Universal Cortex security gate for anything being built, shipped, deployed, published, pushed, sent out, or launched. Use for web apps, public pages, courses/LMS releases, APIs, automations, repos, static sites, client deliverables, and any production-bound workflow before it leaves Cortex. Runs OWASP ZAP/web checks, secrets scanning, dependency/security scanning, and API authorization evidence ch
Front matter
name: cortex-pentest-gate
description: Universal Cortex security gate for anything being built, shipped, deployed, published, pushed, sent out, or launched. Use for web apps, public pages, courses/LMS releases, APIs, automations, repos, static sites, client deliverables, and any production-bound workflow before it leaves Cortex. Runs OWASP ZAP/web checks, secrets scanning, dependency/security scanning, and API authorization evidence checks.Cortex Pentest Gate
Rule
Nothing leaves Cortex without a pentest gate report.
Trigger this skill before any workflow that says or implies: ship, launch, deploy, publish, push to production, release, send to a client, make live, expose a URL, merge to main, create a public course/page, or hand off a production artifact.
Quick Start
From the project or artifact root:
python3 ~/.codex/skills/cortex-pentest-gate/scripts/cortex_pentest_gate.py . --output securityFor a live or local web target:
python3 ~/.codex/skills/cortex-pentest-gate/scripts/cortex_pentest_gate.py . --url http://localhost:3000 --output securityFor an app with user accounts, tenants, roles, admin endpoints, or APIs:
python3 ~/.codex/skills/cortex-pentest-gate/scripts/cortex_pentest_gate.py . --url http://localhost:3000 --requires-authz --output securityThe runner writes:
security/pentest-gate-report.mdsecurity/pentest-gate-report.json- tool artifacts such as ZAP reports when a URL is supplied
Gate Contract
A Cortex deliverable can leave only when the report status is pass or the user explicitly accepts a documented risk.
Status cannot-evaluate (exit 3) means a REQUIRED scanner did not run to the end (secrets scan always; npm audit with a lockfile; header check + ZAP with --url), e.g. Docker could not pull the trufflehog/ZAP image. It is not a crash and it is NOT a pass: fix the scanner (see incompleteRequiredScans in the report) and re-run. Before 2026-11-10 such a run could say pass (ship-1110 a5420aa run 1).
Blocking conditions:
- Verified secrets or likely live credentials.
- Critical/high dependency vulnerabilities where the scanner provides evidence.
- OWASP ZAP high-risk alerts on the target URL.
- Missing API authorization evidence when the app has auth, tenancy, roles, admin endpoints, or user-owned data.
- Security scanner failure that prevents coverage of a production-bound surface.
Warnings are allowed only when they are explicitly reviewed and documented in the report.
Workflow
- Identify the release surface: repo path, public URL or localhost URL, API base, OpenAPI/GraphQL schema, auth/tenant/role model, and final destination.
- Run
scripts/cortex_pentest_gate.py. - If the product has auth or multi-tenant data, run or collect API authorization evidence:
- Change
user_id/ user-owned resource IDs. - Change
org_id,tenant_id, or workspace/account IDs. - Modify role or admin claims if JWT/session architecture allows safe local testing.
- Try direct admin endpoints as a low-privilege user.
- Fix blockers and rerun the gate.
- Save the report path in the task, PR, deployment note, or course release note.
Tool Notes
The runner uses installed CLIs when available and Docker images when safer/available. Read references/toolchain.md only when you need install details, source repos, or to adjust the toolchain.
Burp Suite is useful for manual API interception, but it is not configured as an automated open-source dependency here. Use it manually when authenticated API testing needs a proxy, and attach the evidence summary to the gate report.
Output Standard
When reporting back:
- State pass/fail.
- Link or name the report paths.
- List blockers first.
- List warnings second.
- State any surface that was not testable and why.
- Never claim something is secure; say it passed this gate at the tested scope and timestamp.
Source: written by One Giant Leap.
Related entries
There are more like this in the members library
The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.