security-scan
Runs static analysis, secret detection (via gitleaks), dependency vulnerability auditing (via bun audit), and auth-surface auditing (unauthenticated signup endpoints) across the workspace.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 25
- Forks
- 9
01 前言 Front Matter
- name
- security-scan
- owner
- pm
- scope
- common
- status
- active
- version
- 1.3.0
- metadata
- { "type": "process", "triggers": [ "security scan", "scan for vulnerabilities", "security check", "run security" ] }
- description
- Runs static analysis, secret detection (via gitleaks), dependency vulnerability auditing (via bun audit), and auth-surface auditing (unauthenticated signup endpoints) across the workspace.
- last_reviewed
- 1793750400000
- prerequisites
- gitleaks
03 SKILL.md 正文
🛠️ Skill: security-scan
Context
Used by the security-expert agent to ensure that no hardcoded credentials or malicious scripts exist in the ai-workspace-standards repository.
Execution Steps
- Execute the built-in secret scan hook:
- Check if
gitleaksis available. If so, rungitleaks detect -v. - Always pass the workspace config explicitly:
gitleaks detect -v --config .gitleaks.toml. Gitleaks only auto-discovers.gitleaks.tomlin the scan target directory — a subdirectory scan (e.g.--source templates) without--configsilently falls back to the upstream default ruleset, losing every workspace allowlist entry and reporting documentation placeholders as leaks (observed 2026-08-30). - For working-tree / untracked scans, add
--no-git(config still required). - If not available, manually check
.envpatterns using regex search across all tracked files.
- Check if
- Check dependency vulnerabilities (on-demand CVE gate):
- Run
bun auditin the repo root (and in any project directory under review). - Fail on high or critical vulnerabilities — same threshold as the CI gate
(
.github/workflows/test.yml"Security audit - dependency vulnerabilities"). Low/moderate findings are reported as a summary without failing. - Remediation path: dispatch
update-bun-packages(do not hand-edit lockfiles). - This complements CI: CI catches regressions at PR time, this step gives immediate visibility when a newly disclosed CVE arrives between runs.
- Run
- Verify
.githooks/permissions (should be executable on Unix-like systems). - Verify
.gitignorerules effectively excludememory/,scripts/temp/, and.envfiles. - Auth-surface audit — unauthenticated registration/signup endpoints (added v1.3.0, T-20261103-006):
- Sweep each web app under review (variant templates and
Projects/<co-x>/appweb trees) for account-creation endpoints reachable WITHOUT an authenticated session (register / signup / self-service invite acceptance), and determine which authenticated role a successful signup grants. - Flag as a finding any unauthenticated signup endpoint that grants ANY authenticated role — a default-open auth surface lets anyone who can reach the login page mint an account and inherit everything that role can read (business pipelines, MNPI-adjacent material). Default-open is the finding; the granted role's privilege only sets the severity.
- Reference remediation shape (co-newbiz #796,
Projects/co-newbiz/app/web-next/app/api/auth/register/route.ts, owner decision 2026-11-02):- Default-closed: registration refused unless an explicit environment
flag enables it (co-newbiz:
CO_NEWBIZ_ALLOW_REGISTER === "1", read per request so an operator can flip it without a code change); - Refusal BEFORE body-parse and throttle: while closed the endpoint returns one uniform 403 at the door — no request-shape oracle, no rate-limit quota consumption by closed-surface traffic;
- Dated owner-decision comment in the route source (who closed it, when, why, and which provisioning paths are unaffected);
- Admin-provisioned accounts as the default identity path (CLI or admin-session-gated flows, never public signup);
- Documented reversibility: the enabling flag recorded in the env sample so reopening is a deliberate operator action.
- Default-closed: registration refused unless an explicit environment
flag enables it (co-newbiz:
- Sweep each web app under review (variant templates and
- Report any security violations immediately.
04 同仓库更多 Skills
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.