Credentials Management

The Day We Rotated 200+ Credentials Without Breaking Anything

Our security team mandated credential rotation every 90 days. We had 200+ credentials spread across AAP: SSH keys for 150 servers, 20 cloud accounts, 15 Git repositories, 10 database passwords, and various API tokens.

The first rotation attempt was a disaster. We manually updated credentials in AAP, but missed updating vault files, broke half our playbooks, and spent 2 days firefighting.

Then I learned about AAP's credentials management and external vault integration. We integrated with HashiCorp Vault, configured automatic credential sync, implemented dynamic credential injection, and built automated rotation workflows.

Next rotation: Zero downtime, zero manual updates, complete success.

What You'll Learn

  • Custom credential types for any authentication

  • HashiCorp Vault and CyberArk integration

  • Dynamic credential injection patterns

  • Credential rotation strategies

  • Cloud credential management

  • Security best practices

  • Compliance and auditing

Custom Credential Types

Creating Custom Types

Example: API Token Credential

Real-world use: Custom types for internal APIs, vendor-specific authentication, proprietary systems.

Example: Database Credential

HashiCorp Vault Integration

Configuration

Using Vault-Backed Credentials

Create Credential with Vault Lookup:

Playbook Usage:

Vault Dynamic Secrets

Pattern: Generate credentials on-demand

Real-world implementation:

CyberArk Integration

Configuration

Features:

  • Check-in/check-out workflows

  • Password rotation by CyberArk

  • Privileged access management

  • Compliance reporting

Cloud Credential Management

AWS Credentials

Static Keys:

AssumeRole Pattern:

Azure Credentials

GCP Credentials

Credential Rotation Strategies

Pattern 1: Scheduled Rotation

Pattern 2: Vault-Based Auto-Rotation

Pattern 3: External Trigger Rotation

Real-world rotation schedule:

Credential Security Best Practices

Principle of Least Privilege

Credential Segregation

Audit and Monitoring

Compliance and Reporting

Credential Inventory

Access Audit

Compliance Reporting

Key Takeaways

βœ… Custom credential types for any authentication need βœ… External vaults (HashiCorp/CyberArk) for dynamic secrets βœ… Credential rotation should be automated βœ… Least privilege principle for all credentials βœ… Segregation between environments βœ… Audit trail for compliance and security

What's Next

The next article covers Automation Mesh and Execution Environments - scaling AAP across regions, containerized execution, and building custom execution environments.


Next Article: Automation Mesh and Execution Environments β†’


Part of the Ansible Automation Platform 101 Series

Last updated