Username & Password secrets store authentication credentials as a username/password pair. Use them for database connections, API authentication, SMTP servers, or any service requiring basic credentials.Documentation Index
Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
Use this file to discover all available pages before exploring further.
Use Cases
- Database Authentication: Store credentials for PostgreSQL, MySQL, MongoDB, etc.
- API Authentication: Basic auth credentials for REST APIs
- SMTP/Email Services: Credentials for email sending services
- Legacy Systems: Connect to systems using username/password authentication
- FTP/SFTP Access: Credentials for file transfer services
Configuration Options
| Field | Description | Required |
|---|---|---|
username | The username or account identifier | Yes |
password | The password or secret credential | Yes |
encoding | How values are encoded: plain or base64 | No (default: plain) |
Use
encoding: base64 when your credentials contain special characters that might cause parsing issues, or when you’re storing pre-encoded credentials from another system.Create a Username & Password Secret
- Console UI
- CLI
- Terraform
- Pulumi
Navigate to Secrets
In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
Configure credentials
Click Data in the left pane. Enter the Username and Password. If your credentials are base64 encoded, enable Base64 Decode at Runtime to decode them when accessed.
Injecting into Workloads
As Environment Variables
Reference the username and password separately:As Volume Files
When mounted as a volume, the secret creates two files:/etc/credentials/usernamecontaining the username/etc/credentials/passwordcontaining the password
Common Patterns
PostgreSQL Connection
MongoDB Connection
SMTP Credentials
Basic Auth for APIs
Best Practices
Use strong, unique passwords
Use strong, unique passwords
Generate random passwords with sufficient length and complexity. Avoid reusing passwords across different services.
Rotate credentials regularly
Rotate credentials regularly
Establish a rotation schedule for credentials. Update both the secret in Control Plane and the corresponding service.
Prefer dedicated accounts
Prefer dedicated accounts
Create dedicated service accounts rather than using personal credentials. This enables better auditing and easier credential rotation.
Consider alternative auth methods
Consider alternative auth methods
Where possible, prefer more secure authentication methods like IAM roles, service accounts, or certificate-based auth over username/password.
Next Steps
Opaque Secrets
Store API keys and other single-value secrets
Using Secrets in Workloads
Learn how to grant access and inject secrets