Security
This guide covers security considerations and best practices for deploying Cyclonetix in production environments.
Session Management
Configure session settings:
security:
cookie_secret: "use-a-random-string-here" # Used to sign cookies
session_timeout_minutes: 120 # Session duration
secure_cookies: true # Require HTTPS
same_site: "lax" # Cookie SameSite policy
For the cookie secret, generate a secure random string:
openssl rand -base64 32
Network Security
TLS/HTTPS
Always use HTTPS in production. You can:
- Use a reverse proxy like Nginx with Let’s Encrypt
- Use a Kubernetes Ingress with TLS
- Use a cloud load balancer with TLS termination
Public Paths
Specify which paths are accessible without authentication:
security:
public_paths:
- "/static/*" # Static assets
- "/login" # Login page
- "/auth/*" # OAuth callback
- "/health" # Health check endpoint
IP Restrictions
Limit access by IP address:
security:
allowed_ips:
- "192.168.1.0/24" # Internal network
- "203.0.113.42" # Specific IP
Data Security
Encryption at Rest
Cyclonetix itself doesn’t encrypt data at rest, but you can:
- Use encrypted filesystems for task/DAG storage
- Enable encryption in Redis or PostgreSQL
- Use cloud provider encryption options
Sensitive Data Handling
For sensitive parameters:
# Task definition with sensitive parameter
parameters:
api_key:
value: "${SECRET_API_KEY}"
sensitive: true # Will be masked in logs and UI
Secret Management
For production, consider using a secret management solution:
security:
secrets_backend: "vault"
vault:
url: "https://vault.example.com:8200"
token: "${VAULT_TOKEN}"
path: "secret/cyclonetix"
Task Execution Security
Restricting Task Commands
Limit what commands can be executed:
security:
task_execution:
allowed_commands:
- "/usr/bin/python"
- "/usr/local/bin/custom-script.sh"
allowed_patterns:
- "^/opt/cyclonetix/scripts/.*\\.py$"
Task Isolation
For better isolation, use:
- Separate user accounts for the agent
- Container-based execution
- Resource limits
agent:
execution:
user: "cyclonetix-agent"
cgroup_limits: true
memory_limit_mb: 1024
cpu_limit_percent: 50
Audit Logging
Enable comprehensive audit logging:
security:
audit_logging:
enabled: true
events:
- "login"
- "logout"
- "schedule"
- "cancel"
- "admin_action"
log_file: "/var/log/cyclonetix-audit.log"
Securing Redis
For Redis backend security:
Enable Redis authentication:
backend_url: "redis://:password@redis-host:6379"
Use Redis TLS:
backend_url: "rediss://:password@redis-host:6379"
Configure Redis ACLs for least privilege
Kubernetes Security
When deploying on Kubernetes:
- Use namespaces for isolation
- Configure appropriate SecurityContext
- Use network policies to restrict traffic
- Apply Pod Security Standards
Example Kubernetes manifest with security settings:
apiVersion: apps/v1
kind: Deployment
metadata:
name: cyclonetix-agent
spec:
# ...
template:
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: cyclonetix-agent
image: cyclonetix:latest
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
readOnlyRootFilesystem: true
# ...
Security Checklist
Before going to production, verify:
Security Best Practices
- Principle of Least Privilege: Give users and components only the permissions they need
- Defense in Depth: Apply multiple layers of security
- Keep Updated: Regularly update Cyclonetix and all dependencies
- Security Monitoring: Monitor for unusual activity
- Regular Audits: Periodically review permissions and security settings
Next Steps
- Configure Deployment Scaling for your environment
- Explore Configuration Options in detail
- Review the Troubleshooting Guide for common issues