Skip to content

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 both arka migrate and arka serve in production.
  • ARKA_CREDENTIAL_KEY_ID: Active key identifier (default primary).
  • 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:
    1. Back up PostgreSQL and store the current and replacement keys safely outside the database.
    2. Roll out the new key inside ARKA_CREDENTIAL_PREVIOUS_KEYS across all replicas first.
    3. Promote the new key to ARKA_CREDENTIAL_KEY / ARKA_CREDENTIAL_KEY_ID while moving the old key into ARKA_CREDENTIAL_PREVIOUS_KEYS, and roll all replicas.
    4. Run ARKA_CREDENTIAL_REENCRYPT=true arka migrate to 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_KEY is 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 and memberOf / groupBaseDn team synchronization. Test before enabling via POST /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 (or write, 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-providers or 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-lived read/write tokens (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, and repo:admin without 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:

bash
arkactl content-selectors preview --repository-id "$REPO_ID" \
  --expression "format == 'raw' && path =^ '/samples/'" --json

Routing Rules, Outbound Proxy, Offline Mode & Release Cooldown ​

  • Routing Rules: Full-path RE2 allow or block matchers bound to Proxy repositories via routingRuleId. Test before binding:
    bash
    arkactl 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 via proxyPolicy.outboundProxyMode.
  • Single-Repo Cache-Only Mode: Set proxyPolicy.outboundBlocked: true to serve cached assets while rejecting all upstream calls:
    bash
    arkactl 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/current symlink, keeping keepReleases: 2 generations for instant rollback.
  • DB freshness observability: arka-scanner's /metrics always returns HTTP 200 even when /readyz returns 503 (missing/expired DB), exposing arka_scanner_db_ready, arka_scanner_db_built_at_timestamp_seconds, arka_scanner_db_age_seconds, arka_scanner_db_max_age_seconds, and arka_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: true on 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 ​

ModeDownload BehaviorRecommended Rollout Stage
offDisplays scanner SBOM license evidence; pauses policy enforcementDefault on existing repositories
auditEvaluates every download, records compliance outcomes & Prometheus metrics, does not block downloadsStart here first — measure real violation & unknown rates safely
enforceBlocks non-exempt violating downloads with HTTP 403 and a structured LicensePolicyProblem JSON payloadEnable 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-only passes when MIT is permitted (or only GPL-3.0-only is denied), because consumers can choose the MIT branch.
  • Conjunctive licenses (AND): MIT AND GPL-3.0-only is blocked when GPL-3.0-only is denied (or not on a non-empty allowlist).
  • Exceptions (WITH) & custom refs: Supports GPL-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 by blockUnknownLicense (--block-unknown). Keep false initially until SBOM coverage matures.
  • Time-bounded exemptions: Scoped by exact purl, packageName, or repository-relative assetPath (optionally narrowed by licenseExpression), with a mandatory reason and RFC 3339 expiresAt. Expired exemptions automatically stop matching.

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):

bash
# 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 --json

Step 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):

bash
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-allowlist or --clear-denylist on arkactl security licenses set to reset either list cleanly.
  • To roll back immediately during an incident, switch back to audit or off:
    bash
    arkactl security licenses set "$REPO_ID" --mode audit --json

Released under the Apache 2.0 License.