Supply-Chain Security, License Compliance & Proxy Governance
Combine identity, repository grants, egress controls, vulnerability scanning, and SBOM license policies so every package entering or leaving Arka is governed fail-closed.
1. Credential Encryption & Online Rotation
Arka protects recoverable secrets in PostgreSQL (upstream & proxy passwords, S3/Azure pool keys, LDAP bind passwords, OIDC client secrets, migration credentials) using versioned AES-256-GCM envelopes (enc:v1:<key-id>:...). API responses never emit plaintext secrets; write-only fields expose boolean flags such as hasPassword.
ARKA_CREDENTIAL_KEY: Exactly 32 bytes encoded as 64 hex characters (openssl rand -hex 32) or standard Base64. Required for botharka migrateandarka servein production.ARKA_CREDENTIAL_KEY_ID: Active key identifier (defaultprimary).ARKA_CREDENTIAL_PREVIOUS_KEYS: JSON map of additional readable key IDs during rotation, e.g.{"key-2026-01":"<32-byte-key>"}. Do not duplicate the active ID inside this map.- Zero-downtime rotation:
- Back up PostgreSQL and store the current and replacement keys safely outside the database.
- Roll out the new key inside
ARKA_CREDENTIAL_PREVIOUS_KEYSacross all replicas first. - Promote the new key to
ARKA_CREDENTIAL_KEY/ARKA_CREDENTIAL_KEY_IDwhile moving the old key intoARKA_CREDENTIAL_PREVIOUS_KEYS, and roll all replicas. - Run
ARKA_CREDENTIAL_REENCRYPT=true arka migrateto re-seal existing envelopes under the new active key, verify pools/upstreams/LDAP/OIDC, then remove the old key once no running replica or active backup needs it.
ARKA_AUTH_SIGNING_KEYis independent: rotating it invalidates browser sessions (arka1.*) and short-lived OCI bearer tokens; long-lived CI tokens (arkat_*, stored hashed in PostgreSQL) continue working.
2. OIDC, LDAP, RBAC & Delegated Capabilities
- OIDC (Authorization Code + PKCE): Verifies state, single-use nonce, JWKS signature, issuer, audience, expiry, and UserInfo subject match, with automatic external group sync to Teams (
/api/v1/auth/oidc/providers). - LDAP / Active Directory: Pure-Go RFC 4511 over
ldaps://or StartTLS with service bind + user DN re-bind andmemberOf/groupBaseDnteam synchronization. Test before enabling viaPOST /api/v1/auth/ldap/providers/{id}/test. - Fail-Closed RBAC & Teams: Grants attach to users or Teams with live role inheritance, path/coordinate prefixes, and Portable CSEL predicates. Group reads check permissions on both the Group and the resolved member path.
- Scoped API Token Ceilings: Create least-privilege CI/CD tokens with
arkactl tokens create --name ci --scope read(orwrite,admin). Scoped tokens intersect with the owner's live grants as an upper bound, cannot manage credentials, and cannot exchange for unscoped protocol sessions. - CI Workload OIDC Federation (
v1.1): Configure trust policies (/api/v1/auth/workload-providersor Console → Access → Workload OIDC) so GitHub Actions, GitLab CI, and Kubernetes ServiceAccounts exchange short-lived OIDC JWTs (POST /api/v1/auth/oidc/exchange/arkactl auth exchange-oidc) for short-livedread/writetokens (TTL ≤ 3600s, zero static CI secrets). Every policy enforces a concrete identity constraint, dial-time SSRF protection, and immediate revocation when disabled or deleted. - Delegated Capabilities: Teams can be delegated
audit:read,security:scan:read,security:waiver:manage,routing:manage,selector:manage, andrepo:adminwithout full platform admin privileges.
3. Portable CSEL & Proxy Governance
Portable CSEL Content Selectors
Portable CSEL evaluates normalized format and leading-slash path (maven2 normalizes to maven). Supports ==, !=, =^ (prefix), =~ (full-string RE2), parentheses, and/&&, or/|| (AND binds tighter than OR). Preview before binding to grants:
arkactl content-selectors preview --repository-id "$REPO_ID" \
--expression "format == 'raw' && path =^ '/samples/'" --jsonRouting Rules, Outbound Proxy, Offline Mode & Release Cooldown
- Routing Rules: Full-path RE2
alloworblockmatchers bound to Proxy repositories viaroutingRuleId. Test before binding:basharkactl routing-rules test --rule-id "$RULE_ID" --path blocked/demo.txt --json - Outbound Proxy (
inherit/repo/direct): Configure global HTTP/HTTPS/SOCKS5 egress (arkactl outbound-proxy set) and override per Proxy repository viaproxyPolicy.outboundProxyMode. - Single-Repo Cache-Only Mode: Set
proxyPolicy.outboundBlocked: trueto serve cached assets while rejecting all upstream calls:basharkactl repo update "$REPO_ID" --data '{"proxyPolicy":{"outboundBlocked":true}}' - Minimum Release Age Cooldown: Supported on npm, Maven, PyPI, and Go Proxy repositories via
proxyPolicy.minimumReleaseAgeMinutes(0–5256000). Blocks newly published versions younger than the threshold (and fails closed if upstream release timestamp is missing).
4. Vulnerability Scanning, Quarantine & arka-scanner
Set a repository security policy to scannerDriver=grype and scannerExecution=sidecar (or shorthand scannerDriver=sidecar), enable scanOnPublish: true, and optionally turn on quarantineEnabled: true + blockUnscanned: true to block vulnerable or unscanned downloads fail-closed with HTTP 403.
- Sidecar architecture:
arka-scanner(ghcr.io/ccsert/arka-scanner:<version>) runs Syft (CycloneDX 1.5 & SPDX 2.3 SBOMs) + Grype against a read-only offline vulnerability database with zero database/S3 credentials and zero internet egress (egress: []). - Two-stage DB rotation (
scanner.dbUpdater.enabled=true): In Helm, a single-writer CronJob (concurrencyPolicy: Forbid) stages and validates new Grype DBs before atomically swapping the/var/lib/grype/currentsymlink, keepingkeepReleases: 2generations for instant rollback. - DB freshness observability:
arka-scanner's/metricsalways returns HTTP200even when/readyzreturns503(missing/expired DB), exposingarka_scanner_db_ready,arka_scanner_db_built_at_timestamp_seconds,arka_scanner_db_age_seconds,arka_scanner_db_max_age_seconds, andarka_scanner_db_status. Alert at 96 hours (345600s), well ahead of Grype's default 120-hour (432000s) hard expiry. - Group SHA-256 evidence reuse: Set
groupScanReuse: trueon a Group repository to reuse verified sidecar scan results and SBOMs across members sharing identical SHA-256 digests and scanner input profiles, while evaluating each Group's own severity thresholds and waivers.
See the dedicated External Scanner & Two-Stage DB Rotation Guide for deployment, Prometheus alerts, and manual air-gap DB transfers.
5. SBOM License Compliance Gate (v1.1+)
Arka includes a repository-level SBOM License Compliance Gate that evaluates digest-bound scanner SBOMs (CycloneDX & SPDX) on every protected download using a pure-Go SPDX 2.3 expression engine.
Policy Modes & SPDX 2.3 Semantics
| Mode | Download Behavior | Recommended Rollout Stage |
|---|---|---|
off | Displays scanner SBOM license evidence; pauses policy enforcement | Default on existing repositories |
audit | Evaluates every download, records compliance outcomes & Prometheus metrics, does not block downloads | Start here first — measure real violation & unknown rates safely |
enforce | Blocks non-exempt violating downloads with HTTP 403 and a structured LicensePolicyProblem JSON payload | Enable once audit shows zero false positives and required exemptions are recorded |
How the pure-Go SPDX 2.3 evaluator handles real-world expressions:
- Dual licenses (
OR) avoid false positives:MIT OR GPL-3.0-onlypasses whenMITis permitted (or onlyGPL-3.0-onlyis denied), because consumers can choose theMITbranch. - Conjunctive licenses (
AND):MIT AND GPL-3.0-onlyis blocked whenGPL-3.0-onlyis denied (or not on a non-empty allowlist). - Exceptions (
WITH) & custom refs: SupportsGPL-2.0-only WITH Classpath-exception-2.0,LicenseRef-*,DocumentRef-*:LicenseRef-*, and legacy+normalization (e.g.GPL-3.0+→GPL-3.0-or-later). - Unknown licenses (
NONE,NOASSERTION, empty, or unparseable): Controlled independently byblockUnknownLicense(--block-unknown). Keepfalseinitially until SBOM coverage matures. - Time-bounded exemptions: Scoped by exact
purl,packageName, or repository-relativeassetPath(optionally narrowed bylicenseExpression), with a mandatoryreasonand RFC 3339expiresAt. Expired exemptions automatically stop matching.
Recommended Gradual Rollout (audit → enforce)
Step 1 — Ensure Scanner SBOM Evidence Is Enabled
License evaluation uses trusted digest-bound SBOMs generated by arka-scanner. Make sure scanOnPublish and scannerExecution=sidecar are active on the target repository.
Step 2 — Enable audit Mode First (CLI or Console)
Console: Open the repository → Security → Licenses (Policy mode: Audit), add denied or allowed SPDX IDs / WITH terms, and save. Inspect individual package components in Asset Detail → Component licenses.
CLI (arkactl):
# 1. Inspect current repository security & license policy
arkactl security licenses get "$REPO_ID" --json
# 2. Start in audit mode (denies copyleft licenses without blocking downloads yet)
arkactl security licenses set "$REPO_ID" \
--mode audit \
--deny AGPL-3.0-only \
--deny GPL-3.0-only \
--deny SSPL-1.0 \
--json
# 3. Review repository-wide compliance, unknown rate, SPDX distribution & violations
arkactl security licenses summary "$REPO_ID" --json
arkactl security licenses summary "$REPO_ID" --outcome attention --limit 50 --jsonStep 3 — Add Expiring Exemptions Where Approved, Then Switch to enforce
Use --data to attach time-bounded exemptions (or add them in Console → Repository → Security → Licenses → License exemptions):
arkactl security licenses set "$REPO_ID" --data '{
"licensePolicyMode": "enforce",
"deniedLicenses": ["AGPL-3.0-only", "GPL-3.0-only", "SSPL-1.0"],
"blockUnknownLicense": false,
"licenseExemptions": [
{
"purl": "pkg:npm/legacy-lib@1.2.3",
"licenseExpression": "GPL-3.0-only",
"reason": "LEGAL-1042 approved internal-only tool exception",
"expiresAt": "2027-06-01T00:00:00Z"
}
]
}' --json- Monitor enforcement in Prometheus via
arka_license_policy_evaluations_total{mode="...",outcome="..."}(outcomes:pass,audit_violation,blocked,exempted,unknown). - Use
--clear-allowlistor--clear-denylistonarkactl security licenses setto reset either list cleanly. - To roll back immediately during an incident, switch back to
auditoroff:basharkactl security licenses set "$REPO_ID" --mode audit --json