Skip to content
Guides
On this page
  1. Authentication and cryptography
  2. Defense-in-depth HTTP headers & CSRF
  3. Access control, visibility, and revocation
  4. Webhooks
  5. Admin audit log, durability & supply chain (/admin)
  6. Next

Forge security & auth

arks serve ships built-in authentication, transport headers, role-based access control (RBAC), and audit logging for self-hosted deployments.

Important

arks serve does not claim “WAN secure by default” without proper operations. Place a TLS-terminating reverse proxy (Caddy or nginx), firewall, and DNS layer in front of Internet-facing hosts. See Operations & deploy.

Authentication and cryptography

arks serve Defense-in-Depth Security Pipeline

Mechanism Details
Password hashing Salted 100,000-iteration PBKDF2-HMAC-SHA256
Session tokens 192-bit OS CSPRNG session IDs with Secure cookie attributes under HTTPS
Two-factor auth (2FA) RFC 4226 / RFC 6238 TOTP with inline SVG QR enrollment and one-time recovery codes (supported on both single-repo and multi-repo root /login)
OAuth Device Flow Self-hosted RFC 8628 Device Authorization Grant (/login/device) usable from arks auth login --web; approval requires an authenticated session (401), valid cookie-session CSRF (403), and binds approved_user strictly to the authenticated actor to prevent impersonation
Personal Access Tokens & Basic Auth Unified across Smart HTTP Git, LFS, and REST API endpoints
SSH keys Automatically wired authorized_keys management with crash-safe atomic writes for multi-repo SSH access

Defense-in-depth HTTP headers & CSRF

  • Mandatory CSRF & Origin checks: State-changing Web UI requests (including multi-repo root actions, /admin, and OAuth device approvals) require valid _csrf tokens and matching Origin headers.
  • Security headers: Central X-Frame-Options: DENY, Referrer-Policy: same-origin, strict Content Security Policy (script-src 'none' on SSR HTML), HTTPS Strict-Transport-Security (HSTS), and /robots.txt.
  • Rate, Slowloris, body, and decompression limits: Root POST /login rate limiting (429), cumulative header-timeout Slowloris eviction (ARKS_HTTP_HEADER_TIMEOUT_SECS, 408 Request Timeout), request body and gzip decompression bomb caps (413 Payload Too Large), plus lock-free CAS pre-spawn concurrency capping (503 Service Unavailable + Retry-After: 1). See Stress & resilience for cgroup-capped saturation receipts.

Access control, visibility, and revocation

  • Registration & role controls: Lock down self-registration with ARKS_DISABLE_REGISTRATION=1 and configure the default role for new accounts via ARKS_DEFAULT_REGISTER_ROLE. Repository deletion is restricted to admin role users.
  • Private repository visibility (401): Repositories marked private are hidden from unauthenticated root / listings and cross-repo /search, and return 401 across Smart HTTP, LFS, Web UI GET routes, /repos/*, and /api/v1/*.
  • Archived repository read-only enforcement (403): Archived repositories block git-receive-pack (both HTTP and SSH), PUT /info/lfs/*, REST API writes, and Web UI POST mutations (except /settings/repo to unarchive).
  • Global session revocation: Logging out via multi-repo root POST /logout immediately purges revoked arks_gsess_* sessions across all child repositories.

Webhooks

  • Outbound HTTP/HTTPS webhooks signed with RFC 4231 HMAC-SHA256 (X-Hub-Signature-256) with SSRF protection and exponential backoff retry (clean-room verified in Docker).
  • Configured per repository via Web UI settings or REST API; never commit webhook secrets to the repository tree.

Admin audit log, durability & supply chain (/admin)

  • Strictly restricted to admin role users, with CSV and JSONL exports bounded by ARKS_AUDIT_MAX_ENTRIES.
  • Tamper-evident SHA-256 hash-chained audit log with live chain verification (GET /admin/audit/verify).
  • Atomic durability & zero production unwraps: All 68 Web UI write paths run through per-repo mutex ForgeStoreTx atomic transactions (atomic_write_file, Windows-safe retry) with zero production .unwrap() calls in arks-server/src/web_ui/; lease, loose-object, LFS upload, credential wallet, and migration paths use unique sibling .tmp atomic writes verified under 32-thread contention (Round 2 receipt).
  • CVE-zero supply chain & provenance: Verified at 0/135 OSV.dev RustSec/CVE advisories (rustls-pki-types, url >= 2.5.9), guarded by nightly OSV-Scanner and CycloneDX SBOM CI, with CycloneDX 1.5 SBOMs (arks-<tag>-cyclonedx.sbom.json) and GitHub Artifact Attestations (actions/attest-build-provenance) attached to every release archive and multi-arch GHCR container (atomic store receipt · CVE-zero receipt · OAuth device auth receipt).

Next

Forge Web UI REST API reference Operations & deploy Ports Self-host

Edit this page

Back to top