Vérifié dans le code source

La sécurité n'est pas une fonctionnalité.
C'est le fondement.

Chaque affirmation sur cette page correspond à du vrai code dans la base de code sh0. 34 problèmes trouvés et corrigés à travers 3 audits parallèles. 6 vulnérabilités critiques résolues. Zéro raccourci.

Résultats de l'audit

Audit de sécurité complet couvrant l'authentification, la cryptographie, la surface API et le frontend.

34
Issues found & fixed
Across 3 parallel audits
6
Critical issues
All resolved
10
High-severity issues
All resolved
100%
Resolution rate
Critical + High

Ce que nous protégeons

Six couches de sécurité fondamentales, chacune vérifiée dans le code source Rust.

sh0-auth

AES-256-GCM Encryption

All secrets, env vars, backup files, SSH keys, and API tokens encrypted with AES-256-GCM via the ring crate. Nonce format: nonce(12) || ciphertext || tag(16). Authenticated encryption ensures both confidentiality and integrity.

sh0-auth

Argon2id Password Hashing

OWASP-recommended Argon2id for all password storage. PHC-format hash output with unique random salt per password. TOTP backup codes also hashed with Argon2id.

sh0-api

HTTP-Only Cookie Auth

Access tokens (15 min) and refresh tokens (30 days) stored in HTTP-only cookies with SameSite=Strict. Secure flag auto-enabled in production. CSRF double-submit cookie pattern.

sh0-auth

API Key Security

Format: sh0_ prefix + 32 random chars. SHA-256 hashed storage, prefix-based lookup (first 8 chars). Constant-time comparison via the subtle crate to prevent timing attacks.

sh0-api

RBAC & Project Permissions

Owner, Admin, Developer, Viewer roles with per-project membership. Dedicated extractors (AuthUser, AdminUser, ProjectAccess) verify authorization on every API endpoint.

sh0-auth

TOTP Two-Factor Auth

RFC 6238 compliant, 6-digit codes, 30-second step, SHA-1 with +/-1 skew tolerance. 8 backup codes per user, each Argon2id-hashed. Provisioning URI for QR code setup.

Défense en profondeur

01

Encrypted at rest

Master key derived via PBKDF2-HMAC-SHA256 with 100,000 iterations and a 16-byte salt. Every secret -- env vars, SSH private keys, backup dumps, API tokens -- is AES-256-GCM encrypted before touching disk.

02

Authenticated at every layer

JWT (HS256) from Bearer header or HTTP-only cookie, with API key fallback. Refresh tokens SHA-256 hashed in the database. Expired tokens caught with specific error codes. Multi-strategy auth on every request.

03

Rate-limited and throttled

Per-IP sliding window: 10 login attempts/15 min, 5 TOTP attempts/5 min, 50 invitations/min. Global read/write rate limits with automatic cleanup. Health and webhook paths exempt.

04

Audited and traceable

Every significant action logged: user ID, action, resource type/ID, IP address (X-Forwarded-For aware), timestamp. Paginated queries with filtering by user, resource type, and resource ID.

La pile de sécurité

PBKDF2 (100k iter.)
AES-256-GCM
Argon2id
HTTP-Only Cookies
CSRF Double-Submit
RBAC (4 roles)
Audit Log
Rate Limiting

Chaque couche renforce la suivante -- compromettez-en une et les autres tiennent toujours

Dépendances cryptographiques

Pas de cryptographie maison. Uniquement des crates Rust éprouvées au combat.

ring 0.17
AES-GCM, PBKDF2, SHA-256, CSPRNG
argon2 0.5
Argon2id password hashing
subtle 2.6
Constant-time comparison
jsonwebtoken 9
JWT sign/verify (HS256)
totp-rs 5
RFC 6238 TOTP generation
rustls 0.23
TLS for remote connections

Vérifié dans le code source

Chaque constat mappé au crate où il est implémenté.

Argon2id password hashing with random salt per password (sh0-auth)
AES-256-GCM authenticated encryption for all secrets (sh0-auth)
PBKDF2-HMAC-SHA256 with 100,000 iterations for key derivation (sh0-auth)
Constant-time API key comparison (subtle crate) (sh0-auth)
Parameterized SQL queries throughout (zero SQL injection) (sh0-db)
Refresh token hashed with SHA-256, never stored in plaintext (sh0-db)
TOTP backup codes hashed with Argon2id (sh0-auth)
Docker socket communication via Unix socket only (sh0-docker)
Exec commands use array format, never shell interpolation (sh0-docker)
Foreign key constraints and WAL mode enforced on every connection (sh0-db)
Encrypted backups with master key before storage (sh0-backup)
SSH private keys encrypted at rest, loaded in-memory only (sh0-git)
Upload size capped at 500 MB, pagination clamped to 1-200 (sh0-api)
Input validation on database names, compose files, port strings (sh0-backup)

Sans sh0

  • x Store tokens in localStorage (XSS-vulnerable)
  • x Write custom encryption per service
  • x Manage SSH keys in plaintext on disk
  • x Hope nobody SQL-injects your queries
  • x Share root credentials across team
  • x No audit trail of who did what

Avec sh0

  • HTTP-only cookies, SameSite=Strict, CSRF protection
  • AES-256-GCM for everything, master key with PBKDF2
  • SSH keys encrypted at rest, loaded in-memory only
  • Parameterized queries + input validation everywhere
  • RBAC with 4 roles + per-project permissions
  • Full audit log with IP, user, action, resource tracing

Questions et réponses

Has sh0 been security audited? +
Yes. A comprehensive 3-part audit (Auth/Crypto, API Surface, Frontend) identified 34 issues. All 6 critical and 10 high-severity issues have been fixed. Every security feature described on this page has been verified against the actual source code.
How are secrets stored? +
All secrets (env vars, API tokens, SSH keys, backup credentials) are encrypted with AES-256-GCM using a master key derived via PBKDF2-HMAC-SHA256 with 100,000 iterations and a 16-byte salt. The master key file is generated once and encrypted at rest.
How does authentication work? +
JWT access tokens (15 min) in HTTP-only cookies with SameSite=Strict. Refresh tokens (30 days) SHA-256 hashed in the database. API key fallback with constant-time comparison. CSRF protection via double-submit cookie pattern. Bearer tokens supported for CLI.
What about two-factor authentication? +
TOTP (RFC 6238) with 6-digit codes, 30-second step, and +/-1 skew tolerance. 8 backup codes per user, each Argon2id-hashed. Rate-limited to 5 attempts per 5 minutes to prevent brute force.
Can one user access another user's containers? +
No. Every API endpoint that touches containers verifies project membership through the ProjectAccess extractor. Global owners/admins can access all projects, but developers and viewers must have explicit per-project membership.
What about container security? +
Docker Engine communication uses Unix socket only (no TCP exposure). All container commands use exec arrays, never shell interpolation. Compose files are structurally validated before deployment, including volume mounts, port strings, and dependency graphs.
Which cryptographic libraries do you use? +
ring 0.17 (hardware-accelerated AES-GCM, PBKDF2, SHA-256), argon2 0.5 (password hashing), subtle 2.6 (constant-time comparison), jsonwebtoken 9 (JWT), totp-rs 5 (TOTP), and rustls 0.23 (TLS). No custom cryptography.

Sécurité de niveau entreprise, intégrée

34 problèmes trouvés. 34 problèmes corrigés. AES-256-GCM, Argon2id, TOTP 2FA, RBAC, journaux d'audit, limitation de débit. Une sécurité que vous pouvez vérifier dans le code source.