Skip to content

Security

This section covers the security architecture and features of the SLOzy platform.

Contents

  • Security Overview — Architecture, JWT auth, RBAC, rate limiting, security headers, CORS, Prometheus TLS
  • Authentication — JWT access and refresh tokens, password reset flow, OAuth2, audit logging
  • Authorization — RBAC roles, permissions, API keys, resource-level access control

Security Features at a Glance

FeatureImplementationLocation
AuthenticationJWT (HS256) with access + refresh tokensinternal/auth/service.go
AuthorizationRole-Based Access Control (RBAC)internal/rbac/service.go
Rate LimitingToken bucket algorithminternal/middleware/security.go
Security HeadersCSP, HSTS, X-Frame-Options, etc.internal/middleware/security.go
CORSConfigurable allowed originsinternal/middleware/security.go
Password Hashingbcryptinternal/auth/service.go
Audit LoggingDatabase-persisted audit trailmigrations/000006_slo_audit_log
API KeysHashed key storage with scopesmigrations/000015_rbac_system
OAuth2GitHub, Google provider supportmigrations/000013_oauth2_persistence

Quick Security Checklist

  • [ ] Change the default JWT_SECRET to a strong, random value (min 32 characters)
  • [ ] Enable HTTPS with valid TLS certificates
  • [ ] Configure CORS origins to your domain only
  • [ ] Set appropriate rate limits for your traffic profile
  • [ ] Enable Prometheus TLS (InsecureSkipVerify: false)
  • [ ] Review RBAC role assignments regularly
  • [ ] Rotate API keys periodically
  • [ ] Enable audit logging for compliance tracking