Authentication in Reaper is powered by Dropwizard Authentication with JWT (JSON Web Token) support. This provides a modern, stateless authentication system suitable for both web UI and REST API access.
Reaper implements a dual authentication strategy:
Authentication is enabled by default but requires explicit user configuration. No default users are provided for security reasons - you must configure at least one user or authentication will fail to start.
Authentication is configured in the accessControl
section of your YAML configuration:
accessControl:
enabled: true # Enable/disable authentication
sessionTimeout: PT10M # Session/token timeout (ISO 8601 duration)
jwt:
secret: "your-jwt-secret-key" # JWT signing secret (minimum 256 bits for HS256)
users:
- username: "admin" # REQUIRED: Must not be empty
password: "secure-password" # REQUIRED: Must not be empty
roles: ["operator"] # REQUIRED: Must have at least one role
- username: "monitoring"
password: "another-secure-password"
roles: ["user"]
⚠️ Security Notice: You must configure at least one user with a non-empty password, or Reaper will fail to start. Never use default or weak passwords in production.
enabled
true
sessionTimeout
PT10M
(10 minutes)jwt.secret
users
username
: String - User login name (required, cannot be empty)password
: String - User password (required, cannot be empty, stored in plain text)roles
: Array of strings - User roles (required, must contain at least one role: ["user", "operator"]
)Reaper validates all user configurations on startup and will fail to start if:
This ensures that weak or incomplete authentication configurations are caught early.
Reaper supports conditional configuration of additional users through environment variables and Docker configuration scripts. This approach allows you to:
REAPER_AUTH_USER
and REAPER_AUTH_PASSWORD
(required)REAPER_READ_USER
and REAPER_READ_USER_PASSWORD
environment variablesThe read-only user is configured dynamically at container startup:
REAPER_READ_USER
and REAPER_READ_USER_PASSWORD
are set to non-empty values, a read-only user with the ["user"]
role is automatically added to the configurationReaper implements role-based access control with two main roles:
user
Roleoperator
RoleFor production deployments, especially with Docker, use environment variables instead of hardcoded values:
accessControl:
enabled: ${REAPER_AUTH_ENABLED:-true}
sessionTimeout: ${REAPER_SESSION_TIMEOUT:-PT10M}
jwt:
secret: "${JWT_SECRET:-MySecretKeyForJWTWhichMustBeLongEnoughForHS256Algorithm}"
users:
- username: "${REAPER_AUTH_USER}"
password: "${REAPER_AUTH_PASSWORD}"
roles: ["operator"]
# Additional read-only user is configured automatically if REAPER_READ_USER
# and REAPER_READ_USER_PASSWORD environment variables are set
When running Reaper in Docker, set these environment variables:
# Authentication control
REAPER_AUTH_ENABLED=true
# JWT Configuration
JWT_SECRET="your-production-jwt-secret-key-here"
# Admin user credentials - REQUIRED when authentication is enabled
REAPER_AUTH_USER="admin"
REAPER_AUTH_PASSWORD="your-secure-admin-password-here"
# Read-only user credentials - OPTIONAL (only configured if both are set)
REAPER_READ_USER="monitoring"
REAPER_READ_USER_PASSWORD="your-secure-monitoring-password-here"
# Session timeout
REAPER_SESSION_TIMEOUT="PT30M"
⚠️ Important: You must set
REAPER_AUTH_USER
andREAPER_AUTH_PASSWORD
, or Reaper will fail to start. The read-only user (REAPER_READ_USER
andREAPER_READ_USER_PASSWORD
) is optional - it will only be configured if both environment variables are set to non-empty values.
version: '3.8'
services:
cassandra-reaper:
image: cassandra-reaper:latest
ports:
- "8080:8080"
- "8081:8081"
environment:
# Authentication
REAPER_AUTH_ENABLED: "true"
JWT_SECRET: "MyProductionJWTSecretKeyThatIsLongEnoughForHS256"
# User credentials - CHANGE THESE!
REAPER_AUTH_USER: "admin"
REAPER_AUTH_PASSWORD: "change-this-secure-password"
# Optional read-only user (remove these lines to disable)
REAPER_READ_USER: "monitoring"
REAPER_READ_USER_PASSWORD: "change-this-monitoring-password"
# Session configuration
REAPER_SESSION_TIMEOUT: "PT30M"
# Storage configuration
REAPER_STORAGE_TYPE: "cassandra"
REAPER_CASS_CONTACT_POINTS: "[\"cassandra:9042\"]"
depends_on:
- cassandra