Overview
AWX implements multiple layers of security including credential encryption, role-based access control, authentication providers, and secure communication. Understanding these features is essential for maintaining a secure automation platform.Credential Encryption
AWX encrypts all sensitive credential data before storing it in the database.Encryption Method
AWX uses AES-256 in CBC mode with the following characteristics:- 256-bit encryption key
- PKCS7 padding
- HMAC using SHA-256 for authentication
- Unique initialization vector (IV) per encrypted value
- Passwords and passphrases
- SSH private keys
- API tokens and secret keys
- Cloud service credentials
- Custom credential type secret fields
- External service authentication tokens
Secret Key Management
TheSECRET_KEY is the master encryption key for all sensitive data.
Location:
- Traditional:
/etc/tower/SECRET_KEY - Kubernetes: Secret named
awx-secret-key
Never commit the SECRET_KEY to version control or expose it in logs. Loss of the SECRET_KEY makes all encrypted credentials permanently unrecoverable.
Rotating the Secret Key
To rotate the SECRET_KEY:1
Generate new key
2
Decrypt with old key
Use
awx-manage to decrypt credentials with the current key:3
Update SECRET_KEY
Kubernetes:Traditional:
4
Re-encrypt credentials
All credentials must be updated with the new key. This requires re-entering sensitive values through the UI or API.
Extracting Encrypted Values
If you need to extract credentials for migration or debugging:External Secret Management
AWX can retrieve secrets from external secret management systems instead of storing them encrypted in the database.Supported Systems
- HashiCorp Vault KV — Key/Value secret engine
- HashiCorp Vault SSH — SSH certificate signing
- Microsoft Azure Key Vault
- CyberArk Conjur
- Thycotic Secret Server
HashiCorp Vault Integration
- Setup
- Link to credential
Create a HashiCorp Vault credential:
External secrets are fetched on-demand when jobs run. They are never stored in the AWX database, providing enhanced security for sensitive credentials.
Custom Credential Plugins
You can write custom credential plugins to integrate with additional secret management systems:Authentication Methods
AWX supports multiple authentication backends for user login.Local Authentication
Default username/password authentication using the AWX database. Enable local authentication:LDAP Authentication
Configure LDAP for centralized user management:SAML Authentication
Configure SAML 2.0 for single sign-on:OAuth 2.0 / OpenID Connect
Supported providers:- GitHub
- Google OAuth2
- Azure AD
- Generic OIDC
Role-Based Access Control (RBAC)
AWX uses django-ansible-base for role-based access control. RBAC determines what users can view, create, edit, or delete.Role Types
System Roles
- System Administrator — Full control over AWX
- System Auditor — Read-only access to all objects
Object Roles
- Admin — Full control over an object and its children
- Execute — Can launch jobs or workflows
- Update — Can modify object configuration
- Use — Can use but not modify (credentials, inventories)
- Read — Read-only access to an object
Assigning Roles
Via API:RBAC Hierarchy
Permissions inherit down the object hierarchy:Checking User Permissions
HTTPS and TLS Configuration
Kubernetes with Ingress
Configure TLS using Kubernetes Ingress:awx-ingress.yaml
Traditional Deployment with Nginx
Configure Nginx as a reverse proxy with TLS:Certificate Management
Using cert-manager (Kubernetes):Network Security
Firewall Configuration
Required ports:
Kubernetes network policies:
Database Connection Security
Configure PostgreSQL to require SSL:Security Best Practices
Principle of least privilege
Principle of least privilege
- Grant users only the minimum permissions needed
- Use team-based permissions instead of individual user permissions
- Regularly audit user roles and remove unnecessary access
- Avoid granting System Administrator role unless absolutely necessary
Credential management
Credential management
- Use external secret management (Vault, Azure Key Vault) for sensitive credentials
- Rotate credentials regularly (every 90 days minimum)
- Never hardcode credentials in playbooks or job templates
- Use separate credentials for each environment (dev, staging, production)
- Enable credential input on launch only when necessary
Authentication security
Authentication security
- Enforce multi-factor authentication (MFA) through your identity provider
- Use SSO (SAML/OAuth) instead of local passwords when possible
- Set strong password policies for local accounts
- Implement session timeouts:
SESSION_COOKIE_AGE = 3600(1 hour) - Disable unused authentication backends
Network security
Network security
- Always use HTTPS/TLS for web interface access
- Restrict AWX access to internal networks or VPN
- Use firewall rules to limit database access to AWX hosts only
- Enable network policies in Kubernetes
- Use private container registries for execution environments
Audit and monitoring
Audit and monitoring
- Enable activity stream logging for all object changes
- Export logs to a centralized logging system (Splunk, ELK, etc.)
- Monitor failed authentication attempts
- Alert on privilege escalation (user becomes admin)
- Review audit logs regularly for suspicious activity
System hardening
System hardening
- Keep AWX updated to the latest stable version
- Apply security patches promptly
- Minimize installed packages in execution environments
- Run AWX containers as non-root users
- Enable SELinux or AppArmor where applicable
- Regular vulnerability scanning of container images
Security Auditing
Activity Stream
All object changes are logged in the activity stream:Export Audit Logs
Compliance Reporting
Generate compliance reports:Incident Response
In case of a security incident:1
Contain the incident
- Immediately revoke compromised credentials
- Disable affected user accounts
- Block suspicious IP addresses at firewall level
2
Assess the impact
- Review activity stream for unauthorized actions
- Check job history for suspicious playbook runs
- Identify what systems were accessed
- Determine if credentials were exfiltrated
3
Eradicate the threat
- Rotate all potentially compromised credentials
- Update the SECRET_KEY if database access was compromised
- Apply security patches if a vulnerability was exploited
- Reset passwords for affected accounts
4
Recover and restore
- Re-enable systems after verification
- Monitor closely for recurring issues
- Document the incident timeline
- Update security procedures
5
Post-incident review
- Conduct root cause analysis
- Update incident response procedures
- Implement additional security controls
- Train team on lessons learned
See Also
- Backup and Restore — Protecting your AWX data
- Configuration — Authentication and settings configuration
- AWX Credential Plugins — Custom secret management