Skip to main content

Automated GitHub scanner for exposed AWS IAM keys

Workflow preview

Workflow preview
100%
Automated GitHub scanner for exposed AWS IAM keys preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automated GitHub Scanner for Exposed AWS IAM Keys Overview This n8n workflow automatically scans GitHub for exposed AWS IAM access keys associated with your AWS account, helping security teams quic...

Best for

  • SecOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.splitinbatches, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.code, n8n-nodes-base.noop, n8n-nodes-base.slack, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Niranjan G.

Original n8n.io source

1.1 Workflow description

Title
Automated GitHub scanner for exposed AWS IAM keys
Workflow name
Automated GitHub scanner for exposed AWS IAM keys

Automated GitHub Scanner for Exposed AWS IAM Keys

Overview

This n8n workflow automatically scans GitHub for exposed AWS IAM access keys associated with your AWS account, helping security teams quickly identify and respond to potential security breaches. When compromised keys are found, the workflow generates detailed security reports and sends Slack notifications with actionable remediation steps.

🔑 Key Features

  • Automated AWS IAM Key Scanning: Regularly checks for exposed AWS access keys on GitHub
  • Real-time Security Alerts: Sends immediate Slack notifications when compromised keys are detected
  • Comprehensive Security Reports: Generates detailed reports with exposure information and risk assessment
  • Actionable Remediation Steps: Provides clear instructions for securing compromised credentials
  • Continuous Monitoring: Maintains ongoing surveillance of your AWS environment

📋 Workflow Steps

  1. List AWS Users: Retrieves all users from your AWS account
  2. Split Users for Processing: Processes each user individually
  3. Get User Access Keys: Retrieves access keys for each user
  4. Filter Active Keys Only: Focuses only on currently active access keys
  5. Search GitHub for Exposed Keys: Scans GitHub repositories for exposed access keys
  6. Aggregate Search Results: Consolidates and deduplicates search findings
  7. Check For Compromised Keys: Determines if any keys have been exposed
  8. Generate Security Report: Creates detailed security reports for compromised keys
  9. Extract AWS Usernames: Extracts usernames from AWS response for notification
  10. Format Slack Alert: Prepares comprehensive Slack notifications
  11. Send Slack Notification: Delivers alerts with actionable information
  12. Continue Scanning: Maintains continuous monitoring cycle

🛠️ Setup Requirements

Prerequisites

  • Active n8n instance
  • AWS account with IAM permissions
  • GitHub account/token for searching repositories
  • Slack workspace for notifications

Required Credentials

  1. AWS Credentials:

    • IAM user with permissions to list users and access keys
    • Access Key ID and Secret Access Key
  2. GitHub Credentials:

    • Personal Access Token with search permissions
  3. Slack Credentials:

    • Webhook URL for your notification channel

⚙️ Configuration

  1. AWS Configuration:

    • Configure the "List AWS Users" node with your AWS credentials
    • Ensure proper IAM permissions for listing users and access keys
  2. GitHub Configuration:

    • Set up the "Search GitHub for Exposed Keys" node with your GitHub token
    • Adjust search parameters if needed
  3. Slack Configuration:

    • Configure the Slack node with your webhook URL
    • Customize notification format if desired

🚀 Usage

Running the Workflow

  1. Manual Execution: Click "Execute Workflow" to run an immediate scan
  2. Scheduled Execution: Set up a schedule to run periodic scans (recommended daily or weekly)

Repository Compatibility

This workflow is compatible with both public and private GitHub repositories to which you have access. It will scan all repositories you have permission to view based on your GitHub credentials.

Handling Alerts

When a compromised key is detected:

  1. Review the Slack notification for details about the exposure
  2. Follow the recommended remediation steps:
    • Deactivate the compromised key immediately
    • Create a new key if needed
    • Investigate the exposure source
    • Update any services using the compromised key

⚠️ Disclaimer

This workflow template is provided for reference purposes only to demonstrate how to automate AWS IAM key exposure scanning. Please note:

  • The scanning process may produce false positives as it only matches potential AWS access key patterns
  • Always verify any reported exposures manually before taking action
  • Disabling or deleting access keys without proper verification could have significant negative impacts on your environment
  • Understand which systems and applications rely on identified access keys before deactivating them
  • This template should be customized to fit your specific environment and security policies

IMPORTANT: Use this workflow with caution and only after thoroughly understanding your AWS environment. The authors of this template are not responsible for any disruptions or damages resulting from its use.

🔒 Security Considerations

  • This workflow requires access to sensitive AWS credentials
  • Store all credentials securely within n8n
  • Review and rotate access keys regularly

📝 Customization Options

  • Adjust GitHub search parameters for more targeted scanning
  • Customize Slack notification format and content
  • Modify security report generation for your specific needs
  • Integrate with additional notification channels (email, MS Teams, etc.)

Optional: Enabling Interactive Slack Buttons

The Slack Block Kit notification format supports interactive buttons that can be implemented if you want to perform actions directly from Slack:

  1. Disable Key: This button can be configured to automatically disable the compromised AWS IAM access key
  2. View Details: This button can be set up to show additional information about the exposure
  3. Acknowledge: This button can be used to mark the alert as acknowledged

To make these buttons functional:

  1. Set up a Slack Socket Mode App:

    • Create a Slack app in the Slack API Console
    • Enable Socket Mode and Interactive Components
    • Subscribe to the block_actions event to capture button clicks
  2. Create an n8n Webhook Endpoint:

    • Add a new webhook node to receive Slack button click events
    • Create separate workflows for each button action
  3. Implement AWS Key Disabling:

    • For the "Disable Key" button, create a workflow that uses the n8n HTTP Request node to call the AWS IAM UpdateAccessKey API
    • Example HTTP request that can be implemented in n8n:
      Method: POST
      URL: https://iam.amazonaws.com/
      Query Parameters:
        Action: UpdateAccessKey
        AccessKeyId: AKIAIOSFODNN7EXAMPLE
        Status: Inactive
        UserName: {{$json.username}}
        Version: 2010-05-08
      
  4. Update the Slack Message Format:

    • Modify the Format Slack Alert node to include your webhook URL in the button action values
    • Add callback_id and action_id values to identify which button was clicked

This implementation allows for immediate response to security incidents directly from the Slack interface, reducing response time and improving security posture.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Split Users for Processing

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 3 - Get User Access Keys

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 4 - Filter Active Keys Only

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 5 - Search GitHub for Exposed Keys

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 6 - Aggregate Search Results

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Check For Compromised Keys

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Generate Security Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Continue Scanning

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 10 - Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 11 - Format Slack Alert

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Prepare Github Search

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Rate Limit Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 15 - List AWS Users1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 16 - Extract AWS Usernames

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Disable Access Keys

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 18 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated GitHub scanner for exposed AWS IAM keys
Complexity advanced
Nodes 18
Categories SecOps
Author Niranjan G
Published 18 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5021/5021.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated GitHub scanner for exposed AWS IAM keys do?

Automated GitHub Scanner for Exposed AWS IAM Keys Overview This n8n workflow automatically scans GitHub for exposed AWS IAM access keys associated with your AWS account, helping security teams quic...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your SecOps use case.