ArchSutra AI

ArchSutra AI / Handbook

Audit rule catalog

All 19 audit rules: what each detects, severity, confidence, false-positive notes and how to fix.

Version 0.1.0 · Source: docs/handbook/12-rule-catalog.md

Severity and confidence are the defaults emitted by the rule. IDs are stable; the #NNN suffix in a finding is positional per run.

RuleTitleSeverityConfidenceCategory
AS-SEC-001Possible hard-coded credentialcriticalmediumsecurity
AS-SEC-002Private key material committedcriticalhighsecurity
AS-SEC-003Environment file present in repository treehighmediumsecurity
AS-SEC-004Dynamic code or shell executionhighmediumsecurity
AS-SEC-005SQL built by string concatenation or interpolationhighmediumsecurity
AS-SEC-006TLS certificate verification disabledhighhighsecurity
AS-IAC-001Over-permissive infrastructure configurationmediummediuminfrastructure
AS-ARC-001Circular dependency between modulesmediumhigharchitecture
AS-ARC-002Lower layer depends on a higher layermediummediumarchitecture
AS-ARC-003Very large source fileslowmediummaintainability
AS-OPS-001No CI pipeline configuration foundmediummediumoperability
AS-OPS-002No test files foundmediummediummaintainability
AS-OPS-003Container runs as rootmediumhighsecurity
AS-SUP-001Dependency manifest without lockfilemediumhighsupply-chain
AS-SUP-002Unpinned dependency ranges (latest, *)mediumhighsupply-chain
AS-SUP-003Container base image not pinnedlowmediumsupply-chain
AS-AI-001LLM call co-located with dynamic code executionhighlowai-security
AS-DOC-001No README at repository rootlowhighdeveloper-experience
AS-DOC-002No architecture decision records (only if more than 200 source files)infomediumgovernance

Details#

AS-SEC-001 Possible hard-coded credential#

  • Detects: AWS access key IDs, GitHub tokens, sk- style keys, Slack tokens, Google API keys, and quoted password|secret|api_key|token|access_key assignments of 8+ characters.
  • Skips: test and fixture paths, .md/.txt, lines mentioning example/placeholder/changeme/your_/xxxx or reading process.env, os.environ, getenv.
  • Output: kind and a redacted excerpt. The value is never printed.
  • Fix: revoke and rotate first; then move to a secret manager or environment; purge history only after rotation.
  • Limits: misses unusual formats; may flag test-like values outside test paths.

AS-SEC-002 Private key material committed#

  • Detects: a BEGIN ... PRIVATE KEY header followed by base64 key material (next line, or on the same line). Regex literals and docs that merely mention the header do not trigger.
  • Fix: treat as compromised; rotate; remove.

AS-SEC-003 Environment file in tree#

  • Detects: .env, .env.* files not named *.example, *.sample, *.template. Contents are never read into the report.
  • Limits: reads the working tree, not git tracking; a git-ignored local .env is still listed.

AS-SEC-004 Dynamic code or shell execution#

  • Detects: eval(, new Function(, child_process exec with interpolated or concatenated strings, os.system(, Python subprocess with shell=True.
  • Skips: tests, docs, non-code files.
  • Fix: argument arrays, parsers, allowlists.
  • Limits: cannot prove tainted input.

AS-SEC-005 SQL string building#

  • Detects: query|execute|exec|raw|prepare( called with a template literal containing ${ or string concatenation; and uppercase SQL statements (SELECT .. FROM, INSERT INTO, UPDATE .. SET, DELETE FROM) combined with interpolation or concatenation on the same line.
  • Fix: bind parameters.
  • Limits: line-based; multi-line queries can be missed; constants may be flagged.

AS-SEC-006 TLS verification disabled#

  • Detects: rejectUnauthorized: false, verify=False, InsecureSkipVerify: true, NODE_TLS_REJECT_UNAUTHORIZED=0.
  • Limits: may be a dev-only profile.

AS-IAC-001 Over-permissive infrastructure#

  • Detects: Terraform cidr_blocks = ["0.0.0.0/0"]; Kubernetes privileged: true, allowPrivilegeEscalation: true, hostNetwork: true.
  • Limits: public load balancers on 80/443 are legitimate.

AS-ARC-001 Circular dependency#

  • Detects: strongly connected components of size > 1 in the module graph.
  • Limits: module = top-level directory heuristic.

AS-ARC-002 Layer inversion#

  • Detects: a file in a service/domain layer importing from presentation, or a data/persistence layer importing from service or presentation, using folder-name conventions (controllers/routes/handlers/api/views/pages/ui/web; services/usecases/application/domain; repositories/dao/db/database/models/persistence/infrastructure).
  • Limits: relies on naming conventions.

AS-ARC-003 Very large files#

  • Detects: non-test source files over 1000 lines.
  • Limits: generated code and tables.

AS-OPS-001 No CI#

  • Detects: none of GitHub Actions, GitLab CI, Azure Pipelines, Jenkinsfile, CircleCI. Evidence kind is unknown.

AS-OPS-002 No tests#

  • Detects: no test/, tests/, __tests__, spec, e2e, *.test.*, *.spec.*, *_test.go|py. Evidence kind is unknown.

AS-OPS-003 Container runs as root#

  • Detects: a Dockerfile with no USER, or whose last USER is root/0.

AS-SUP-001 Missing lockfile#

  • Detects: package.json with dependencies and no package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock(b) beside it or at the root.

AS-SUP-002 Unpinned ranges#

  • Detects: dependency version latest or * in package.json.

AS-SUP-003 Unpinned base image#

  • Detects: FROM image:latest or FROM image without tag or digest.

AS-AI-001 LLM plus execution sink#

  • Detects: a file that both calls an LLM API (OpenAI/Anthropic-style identifiers) and contains an AS-SEC-004 sink. Confidence is low because data flow is not proven.
  • Fix: never execute model output; allowlisted tools with validated arguments, sandboxing, human approval.

AS-DOC-001 / AS-DOC-002 Documentation gaps#

  • Detects: missing README; missing ADR directory in large codebases.

What the audit does not do#

It does not execute code, query live systems, scan networks, inspect cloud accounts, read git history, or assess runtime behavior. Use the skills and your own judgment to cover those areas.