What This Workflow Does
This automation solves the critical security challenge of tracking and rotating AWS IAM access keys before they become security risks. Many organizations struggle with stale credentials that accumulate over time, creating potential vulnerabilities if compromised. The workflow automatically monitors all IAM access keys across your AWS accounts, identifies those exceeding 365 days old, and sends targeted Slack alerts to responsible teams.
By bringing these alerts directly into Slack where DevOps and security teams collaborate, the workflow transforms a manual security process into an automated, visible, and actionable system. It eliminates the need for spreadsheets or periodic manual audits while ensuring compliance with security best practices and regulatory requirements.
How It Works
1. AWS IAM User Scan
The workflow starts by querying AWS IAM to list all users in your account. It uses AWS API credentials with appropriate permissions to retrieve the complete user list along with their access key metadata.
2. Access Key Age Calculation
For each IAM user, the workflow checks if they have active access keys. For any active keys, it calculates the exact age in days by comparing the creation date with the current date.
3. 365-Day Filter
The workflow filters to only include access keys that have exceeded 365 days since creation. This threshold can be easily adjusted in the workflow configuration to match your security policy.
4. Slack Alert Formatting
For each expired key, the workflow formats a detailed Slack message including the IAM username, key creation date, AWS account context, and recommended action. The message uses Slack's block formatting for better readability.
5. Targeted Notification
The final step sends the formatted alert to a designated Slack channel where your security or cloud team can take action. The message includes @mentions for key stakeholders and optional urgency indicators.
Pro tip: Customize the Slack message to include direct links to your AWS console for quick rotation, and consider adding severity levels (warning/critical) based on how far past 365 days the key is.
Who This Is For
This workflow is essential for:
- DevOps engineers managing AWS infrastructure
- Cloud security teams responsible for IAM policies
- SRE teams maintaining production AWS environments
- Compliance officers needing audit trails for credential rotation
- Organizations subject to SOC2, ISO27001, or other security frameworks
What You'll Need
- An n8n instance (cloud or self-hosted)
- AWS IAM credentials with ListUsers and ListAccessKeys permissions
- Slack workspace with incoming webhook configured
- Optional: AWS credentials for multiple accounts if managing a multi-account setup
Quick Setup Guide
- Download the JSON template file
- Import into your n8n instance
- Configure your AWS credentials in the IAM node
- Add your Slack webhook URL
- Test with a sample IAM user
- Schedule to run daily or weekly
Key Benefits
Eliminates security blind spots by automatically tracking all IAM keys across your AWS accounts, not just the ones you remember to check.
Saves 10+ hours monthly compared to manual audits and spreadsheet tracking of credential rotation schedules.
Reduces breach risk by ensuring credentials are rotated before they become security liabilities, following AWS best practices.
Improves compliance with documented processes for credential management required by most security frameworks.
Creates accountability by bringing alerts directly to team Slack channels with clear ownership and action items.