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 servedoes 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
| 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_csrftokens and matchingOriginheaders. - Security headers: Central
X-Frame-Options: DENY,Referrer-Policy: same-origin, strict Content Security Policy (script-src 'none'on SSR HTML), HTTPSStrict-Transport-Security(HSTS), and/robots.txt. - Rate, Slowloris, body, and decompression limits: Root
POST /loginrate 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=1and configure the default role for new accounts viaARKS_DEFAULT_REGISTER_ROLE. Repository deletion is restricted toadminrole users. - Private repository visibility (
401): Repositories markedprivateare hidden from unauthenticated root/listings and cross-repo/search, and return401across Smart HTTP, LFS, Web UI GET routes,/repos/*, and/api/v1/*. - Archived repository read-only enforcement (
403): Archived repositories blockgit-receive-pack(both HTTP and SSH),PUT /info/lfs/*, REST API writes, and Web UI POST mutations (except/settings/repoto unarchive). - Global session revocation: Logging out via multi-repo root
POST /logoutimmediately purges revokedarks_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
adminrole users, with CSV and JSONL exports bounded byARKS_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
ForgeStoreTxatomic transactions (atomic_write_file, Windows-safe retry) with zero production.unwrap()calls inarks-server/src/web_ui/; lease, loose-object, LFS upload, credential wallet, and migration paths use unique sibling.tmpatomic writes verified under 32-thread contention (Round 2 receipt). - CVE-zero supply chain & provenance: Verified at
0/135OSV.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