Skip to content

Security Controls Matrix

Maps engineering standards to OWASP ASVS themes, OWASP API Security Top 10 (2023) items, enforcement mechanisms, and required tests. Use this during security reviews and release checklists.

Status legend: M = mandatory, A = advisory, P = project-specific (document in ADR or use-case doc).

Agent Quick Rules {#agent-quick-rules}

  • Every {id} route MUST have object-level authorization tests (API1).
  • JWT validation and claims-only actor identity are mandatory (API2).
  • Rate limits and pagination caps MUST protect sensitive flows (API4, API6).
  • OpenAPI freshness and diff gates MUST run in CI (API9).
  • Outbound HTTP MUST use allow-lists documented in project ADR until a dedicated standard exists (API7).

Full convention: docs/conventions/shared/security-controls.md


API Security Top 10 Mapping

API Top 10 2023ControlStandardEnforcementTests
API1 Broken Object Level AuthorizationObject-level auth on every {id} routebackend/object-authorization.md, backend/authentication-and-authorization.mdIntegration tests403 negative tests per endpoint
API2 Broken AuthenticationJWT validation, claims-only actor identitybackend/authentication-and-authorization.mdAuth middleware, options validation401 tests, TestAuthHandler
API3 Broken Object Property Level AuthorizationResponse DTOs expose only authorized fieldsbackend/api-layer.md, read projectionsCode reviewContract tests
API4 Unrestricted Resource ConsumptionRate limits, pagination limitsbackend/api-layer.md, backend/raw-sql-and-reporting.mdRate limiter policiesLoad test evidence in release checklist
API5 Broken Function Level AuthorizationPolicy constants, role checksbackend/authentication-and-authorization.mdRequireAuthorization(policy)Role-based integration tests
API6 Unrestricted Access to Sensitive Business FlowsIdempotency, rate limits on sensitive flowsbackend/reliability.md, backend/api-layer.mdIdempotency storeReplay tests
API7 Server Side Request ForgeryURL allow-lists for outbound HTTPP — document in project ADR until dedicated standardCode reviewSandbox contract tests
API8 Security MisconfigurationTyped options, CORS, CSPbackend/options-and-configuration.md, shared/security.mdValidateOnStart, CIStartup validation
API9 Improper Inventory ManagementOpenAPI freshness and diffshared/api-compatibility.md, backend/testing.mdCI OpenAPI gatesFreshness + diff jobs
API10 Unsafe Consumption of APIsAnti-corruption in Infrastructurebackend/infrastructure-layer.mdCode reviewProvider sandbox tests

ASVS-Themed Baseline

ASVS areaControlStandardAutomation
V1 ArchitectureClean Architecture, one-way depsarchitecture/clean-architecture.md, principles.mdNetArchTest
V2 AuthenticationJWT bearer, no body actor IDsbackend/authentication-and-authorization.mdIntegration tests
V3 Session ManagementBearer tokens; cookie auth Pfrontend/admin-api-auth.mdProject ADR for CSRF
V4 Access ControlPolicies + object-level checksbackend/object-authorization.mdIntegration tests
V5 ValidationValidators vs domain invariantsprinciples.md, backend/exception-hierarchy.mdUnit + integration
V6 Stored DataParameterized SQL, no secrets in repobackend/raw-sql-and-reporting.md, shared/security.mdSecret scan, static SQL scan
V7 Errors and LoggingProblem Details, no stack in 500backend/exception-hierarchy.mdContract tests
V8 Data ProtectionPII classificationshared/security.mdProject data classification doc
V9 CommunicationsTLS, CORS, CSPshared/security.md, frontend CSP blueprintCI, manual prod checklist
V10 Malicious CodeDependency scanning, action SHA pinsshared/supply-chain-security.mdpnpm audit, dotnet list package --vulnerable, workflow lint
V11 Business LogicDomain invariants in aggregatesbackend/domain-layer.mdDomain tests
V12 Files and ResourcesFile upload safetyP — project ADR until dedicated standardMIME/size tests
V13 API and Web ServiceOpenAPI, versioningbackend/api-layer.md, shared/api-compatibility.mdCI
V14 ConfigurationStrongly typed optionsbackend/options-and-configuration.mdRoslyn / review

CI Gates (Mandatory Before Production)

GateToolStandard reference
Secret scanningGitHub Secret Protection, Gitleaks, or equivalentshared/security.md
SASTCodeQL or equivalentThis matrix
Dependency vulnerabilitiespnpm audit, dotnet list package --vulnerableshared/supply-chain-security.md
Architecture testsNetArchTestbackend/testing.md
OpenAPI freshnessGenerated vs committed specbackend/testing.md
OpenAPI breaking diffoasdiff or equivalentshared/api-compatibility.md
Action SHA / workflow lintactionlint, zizmor, or customshared/supply-chain-security.md

Project Artifacts

Production launches MUST include:

ArtifactPath (consumer project)
Data classificationdocs/security/data-classification.md or ADR
Rate limit load test evidenceRelease checklist attachment or runbook link
Public API compatibility baselineCommitted OpenAPI at last release tag

Enforcement matrix (rule to tool)

Maps high-risk MUST rules to verification tools. Consumer CI SHOULD implement gates marked Required before production.

RuleSeverity if violatedEnforcementCI gateStatus
Domain has no Infrastructure/Application referencesCriticalNetArchTestRequiredDocumented
No MVC controllersHighNetArchTestRequiredDocumented
Handlers internal sealedMediumNetArchTestRequiredDocumented
No SaveChangesAsync outside pipelineHighRoslyn analyzer or allow-list scriptRequiredDocumented
No direct configuration["Key"]!HighRoslyn / reviewRecommendedDocumented
Raw SQL parameterizationCriticalStatic scan for string concatRequiredDocumented
OpenAPI freshnessHighBuild export + git diffRequired when frontend consumes APIDocumented
OpenAPI breaking diffHighoasdiff vs release baselineRequired for public APIsDocumented
Package versions match manifestHighvalidate-manifest scriptRequiredPartial
Object-level auth testsCriticalIntegration testsRequiredDocumented
Secret scanningCriticalGitleaks / GitHubRequiredRecommended
SASTHighCodeQLRequiredRecommended
Third-party action SHA pinsHighactionlint / customRequiredDocumented
Submodule pinned to tag or SHAHighgit describe --exact-match or SHA checkRequiredDocumented
Manifest schema validMediumJSON schema validationRequiredNew
LangVersion=preview in productionHighTemplate validation scriptRequiredNew
WebApi registers no durable BackgroundServiceHighNetArchTest / reviewRecommendedDocumented
Domain value objects throw DomainException onlyCriticalNetArchTest + reviewRecommendedDocumented

Rules without automation depend on code review and agent guardrails. Prioritize automating Critical and High rows before v1 adoption.

Agent context loading plans live in standards.manifest.jsonagentLoadPlans.