Logo van AWS Security MCP

AWS Security MCP

Community
groovyBugify

A Model Context Protocol server that connects AI assistants like Claude to AWS security services, allowing them to autonomously query, inspect, and analyze AWS infrastructure for security issues and misconfigurations.

UitgevergroovyBugify
Repositoryaws-security-mcp
TaalPython
Forks
16
Sterren
84
Beschikbare tools
0
Transporttypestdio, streamable-http
Categorieën
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    AWS Security MCP biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    84 sterren en 16 forks in de gekoppelde repository.

AWS Security MCP

License: MIT Python 3.11+

A Model Context Protocol (MCP) server that enables AI assistants to perform comprehensive AWS security analysis through natural language queries.

Overview

AWS Security MCP bridges AI assistants like Claude with AWS security services, enabling real-time infrastructure analysis through conversational queries. The system automatically discovers and analyzes resources across multiple AWS accounts, providing security insights without requiring deep AWS CLI knowledge.

Key Capabilities

  • Cross-Account Discovery: Automatic detection and access to AWS Organization accounts
  • Natural Language Interface: Query AWS resources using plain English
  • Security Analysis: Integrated findings from GuardDuty, SecurityHub, and Access Analyzer
  • Infrastructure Mapping: Network topology, threat modelling, security review and blast radius analysis
  • Log Analytics: Athena-powered analysis of CloudTrail, VPC Flow Logs, and security events

Prerequisites

  • Python: 3.11 or higher
  • Package Manager: uv
  • AWS Account: With appropriate IAM permissions
  • MCP Client: Claude Desktop, Cline, or compatible client

AWS Requirements

MCP Server's AWS credentials must have the following permissions:

Core MCP Permissions

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CrossAccountAccess",
      "Effect": "Allow",
      "Action": [
        "sts:AssumeRole"
      ],
      "Resource": "arn:aws:iam::*:role/aws-security-mcp-cross-account-access"
    },
    {
      "Sid": "OrganizationDiscovery",
      "Effect": "Allow",
      "Action": [
        "organizations:ListAccounts"
      ],
      "Resource": "*"
    }
  ]
}

Athena Integration Permissions

For advanced log analysis capabilities, additional permissions are required:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AthenaQueryExecution",
      "Effect": "Allow",
      "Action": [
        "athena:BatchGetQueryExecution",
        "athena:GetQueryExecution",
        "athena:GetQueryResults",
        "athena:GetWorkGroup",
        "athena:GetTableMetadata",
        "athena:ListQueryExecutions",
        "athena:StartQueryExecution",
        "athena:GetQueryResultsStream",
        "athena:GetDataCatalog",
        "athena:ListDataCatalogs",
        "athena:ListDatabases",
        "athena:ListTableMetadata"
      ],
      "Resource": "*"
    },
    {
      "Sid": "GlueCatalogAccess",
      "Effect": "Allow",
      "Action": [
        "glue:GetDatabase",
        "glue:GetDatabases",
        "glue:GetTable",
        "glue:GetTables",
        "glue:GetPartition",
        "glue:GetPartitions",
        "glue:BatchGetPartition"
      ],
      "Resource": "*"
    },
    {
      "Sid": "S3LogDataAccess",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::your-cloudtrail-bucket/*",
        "arn:aws:s3:::your-cloudtrail-bucket",
        "arn:aws:s3:::your-vpc-flow-logs-bucket/*",
        "arn:aws:s3:::your-vpc-flow-logs-bucket",
        "arn:aws:s3:::your-security-logs-bucket/*",
        "arn:aws:s3:::your-security-logs-bucket"
      ]
    },
    {
      "Sid": "AthenaResultsAccess",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket",
        "s3:PutObject"
      ],
      "Resource": [
        "arn:aws:s3:::your-athena-results-bucket/*",
        "arn:aws:s3:::your-athena-results-bucket"
      ]
    }
  ]
}

Required AWS Managed Policies

SecurityAudit Policy (Required)

Attach the AWS managed SecurityAudit policy to your MCP Server's IAM user or IAM role:

Policy ARN: arn:aws:iam::aws:policy/SecurityAudit

This policy provides comprehensive read-only access to AWS security services and is essential for AWS Security MCP functionality. It includes permissions for:

  • IAM: Users, roles, policies, access analysis
  • EC2: Security groups, instances, VPC configurations
  • S3: Bucket policies, ACLs, public access settings
  • GuardDuty: Findings, detectors, threat intelligence
  • SecurityHub: Security standards, compliance findings
  • Access Analyzer: IAM access analysis and findings
  • Lambda: Function configurations and permissions
  • CloudFront: Distribution security settings
  • Route53: DNS configurations and health checks
  • WAF: Web ACL rules and configurations
  • All other security-related AWS services

Optional Managed Policies

  • AthenaFullAccess: arn:aws:iam::aws:policy/AmazonAthenaFullAccess (for simplified Athena log analysis)

Important Notes

  • It's best to use this MCP Server with Claude Desktop Pro/Max Plan or any other platform that allows you to deal with token size greater than 100,000
  • Replace bucket names in the S3 permissions with your actual CloudTrail, VPC Flow Logs, and Athena results bucket names
  • The SecurityAudit policy is mandatory for basic AWS Security MCP functionality
  • Athena integration permissions are optional and only required for advanced log analysis features
  • All permissions follow the principle of least privilege with read-only access where possible

Quick Start ~ local setup

  1. Update config.yml
aws:
  region: "us-east-1"
  profile: {profileName}
  .
  .
  .
  1. Configure your AWS Credentials via ~ local setup
  • aws sso
    bash
    $ aws configure sso
    SSO Session Name - email@example.com
    URL - https://yourDomain.awsapps.com/start/#
    Region - us-east-1
  • env variabls
    bash
    export AWS_ACCESS_KEY_ID=
    export export AWS_SECRET_ACCESS_KEY=
    export export AWS_SESSION_TOKEN=
  1. Run the following commands

    bash
    git clone https://github.com/groovyBugify/aws-security-mcp.git
    uv venv
    source .venv/bin/activate
    uv pip install -r requirements.txt
  2. Configure MCP Client

    bash
    # Install mcp-proxy
    uv tool install mcp-proxy
    
    # Check location of mcp-proxy
    which mcp-proxy
    
    # Add to Claude Desktop config
    {
      "mcpServers": {
        "aws-security": {
          "command": "/path/to/mcp-proxy",
          "args": ["http://localhost:8000/sse"]
        }
      }
    }

Quick Start ~ as AWS ECS Service

  1. Login to AWS ECR
bash
$ aws ecr get-login-password --region {region} | docker login --username AWS --password-stdin {accountID}.dkr.ecr.{region}.amazonaws.com
  1. Create ECR Repo
bash
$ aws ecr create-repository --repository-name aws-security-mcp --region {region}
  1. Build Docker Image
bash
$ cd aws-security-mcp/
$ docker buildx build --platform linux/amd64 -t aws-security-mcp .
$ docker tag aws-security-mcp:latest {accountID}.dkr.ecr.{region}.amazonaws.com/aws-security-mcp:latest
$ docker push {accountID}.dkr.ecr.{region}.amazonaws.com/aws-security-mcp:latest
  1. Deploying as AWS ECS Service

    • Create a Task Definition with "2048" CPU and "4096" Memory, this is optional, you can choose any values
    • Configure the Task definition to do port mapping for port 8000
    • Create ECS Task Role with the following permissions
      • SecurityAudit IAM Policy
      • Athena Access (Policy mentioned above)
      • STS Assume Role permissions to assume cross account roles
    • Create ECS Task Execution Role with basic permissions
    • Once the Task Definition is completed.
    • Create an AWS ECS Service using the Task definition
      • You can configure Load Balancer as well
      • Make Sure to turn off the Stickness Session on Load Balancers
    • Register the ALB's taget group and listeners for port 80/443 -> ECS Service(8000)
    • Register the ALB for Route53 domain.
  2. Configure MCP Client

    bash
    # Install mcp-proxy
    uv tool install mcp-proxy
    
    # Check location of mcp-proxy
    which mcp-proxy
    
    # Add to Claude Desktop config
    {
      "mcpServers": {
        "aws-security": {
          "command": "/path/to/mcp-proxy",
          "args": ["http://{alb}/sse"]
        }
      }
    }

Configuration

YAML Configuration

Edit config.yaml in the project root according to your needs:

yaml
aws:
  region: "us-east-1"
  profile: null

server:
  log_level: "info"
  startup_quiet: false
  tool_quiet: false

cross_account:
  role_name: "aws-security-mcp-cross-account-access"
  auto_setup_on_startup: true
  max_concurrent_assumptions: 5

Environment Variable Override

Environment variables take precedence over YAML configuration:

bash
export MCP_LOG_LEVEL=debug
export MCP_STARTUP_QUIET=false
export AWS_DEFAULT_REGION=eu-west-1

Usage Examples

Basic Infrastructure Queries

Query: "Can you share a list of running ec2 instances?"

Query: "Share all the secrets stored on env variables of Lambda functions, and share a list of functions for remediating this issue."

Query: "Check my 'prod-ecs-cluster' and share more details about the 'user-login' service, is it deployed?"

Security Analysis

Query: "Show all GuardDuty findings from the last 7 days, and priortise based on the risk of exposure."

Query: "Analyze IAM roles with administrative privileges"

Query: "Generate blast radius analysis for IP 172.16.1.10"

Query: "Fetch more details about the ip - 172.22.141.11, and share a network map for this resource.

Cross-Account Operations

Query: "List all connected AWS accounts"
Query: "Refresh my AWS session"
Query: "Find resources tagged Team:Security across all accounts"
Query: "Show compliance status across organization"

Architecture

Cross-Account Access

AWS Security MCP implements a hub-and-spoke model for multi-account access:

  1. Discovery: Uses organizations:ListAccounts to identify target accounts
  2. Role Assumption: Assumes aws-security-mcp-cross-account-access role in each account
  3. Session Management: Maintains temporary credentials with automatic refresh
  4. Fallback: Uses default credential chain for non-organization accounts

Required IAM Role Setup

Create this role in each target AWS account:

Role Name: aws-security-mcp-cross-account-access

Trust Policy:

json
{
"Version": "2012-10-17",
"Statement": [
 {
   "Effect": "Allow",
   "Principal": {
     "AWS": "arn:aws:iam::YOUR-MASTER-ACCOUNT-ID:root"
   },
   "Action": "sts:AssumeRole"
    }
]
}

Permissions: Attach AWS managed policy arn:aws:iam::aws:policy/SecurityAudit

Athena Integration

Overview

AWS Security MCP integrates with Amazon Athena to provide advanced log analysis capabilities. This feature requires pre-existing Athena tables containing your security-relevant logs.

Supported Log Types

While the MCP server can analyze any log source through Athena, the following sources are recommended to provide comprehensive security metadata to your MCP client. For optimal security coverage, we recommend implementing at least CloudTrail and VPC Flow Logs:

Recommended Log Sources:

  • AWS CloudTrail: API call auditing and user activity tracking
  • VPC Flow Logs: Network traffic pattern analysis
  • CloudFront Logs: CDN request and response analysis
  • ALB Access Logs: Application load balancer traffic insights
  • WAF Logs: Web application firewall events and blocks(Cloudflare/AWS WAF/Akamai)
  • AWS Shield Logs: DDoS protection and mitigation events

Flexibility for Custom Log Sources

The MCP server supports querying any log type stored in S3, giving you complete flexibility to analyze custom or additional log sources. To enable analysis of any log source, ensure:

  1. S3 Storage: Your logs are stored in an S3 bucket
  2. Athena Table: A properly configured Athena table exists for the log format
  3. IAM Permissions: The MCP server has s3:GetObject and s3:ListBucket permissions for the target bucket

This architecture allows you to extend security analysis beyond standard AWS logs to include application logs, custom security events, or third-party security tool outputs.

Query Capabilities

Once tables are configured, you can perform advanced queries:

Query: "Show all failed login attempts from external IPs in the last 24 hours"

Query: "Can you share what did 'saransh.rana@company.com' did in past 24 hours on my aws account? and share a timeline report?"

Query: "Can you check for all the 'Access Denied/Error/Forbidden' on my PCI(123456789012) aws account and share the username and userIP of the principal, and do a reverse IP checkup if this IP is coming from my own AWS Org or external party."

Query: "Correlate GuardDuty findings with CloudTrail and VPC Flow logs events"

Setup Prerequisites

  1. S3 Buckets: CloudTrail and VPC Flow Logs must be stored in S3
  2. Athena Workgroup: Configure appropriate workgroup with result location
  3. Partitioning: Enable partition projection for performance
  4. IAM Permissions: Grant Athena query permissions to the MCP execution role

Supported AWS Services

Currently Available

ServiceCapabilities
IAMUsers, roles, policies, access keys, permission analysis
EC2Instances, security groups, VPCs, subnets, network interfaces
S3Buckets, permissions, public access analysis
GuardDutyFindings, detectors, threat intelligence
SecurityHubFindings, compliance standards, security scores
LambdaFunctions, permissions, configurations, triggers
CloudFrontDistributions, origins, behaviors, security policies
ELB/ALB/NLBLoad balancers, target groups, listeners, health checks
Route53Hosted zones, DNS records, health checks
WAFWeb ACLs, rules, rate limiting
ShieldDDoS protection status and metrics
Access AnalyzerIAM access analysis and findings
ECS/ECRContainer services, repositories, image scanning
OrganizationsAccount structure, SCPs, organizational units
AthenaLog analysis, security event correlation

Planned Additions

  • Oauth Authentication
  • AWS Config compliance analysis
  • AWS Security Hub CSPM integration
  • External CSPM integration

Advanced Configuration

Production Deployment

For production environments, use the following configuration:

yaml
server:
  host: "0.0.0.0"
  log_level: "error"
  startup_quiet: true
  tool_quiet: true
  minimal_logging: true

cross_account:
  max_concurrent_assumptions: 10
  session_duration_seconds: 7200

Docker Deployment

dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
EXPOSE 8000
CMD ["python", "aws_security_mcp/main.py", "sse"]
bash
docker build -t aws-security-mcp .
docker run -p 8000:8000 \
  -e AWS_ACCESS_KEY_ID=your_key \
  -e AWS_SECRET_ACCESS_KEY=your_secret \
  aws-security-mcp

Load Balancer Configuration

  • Health Check: GET /health
  • SSE Endpoint: /sse
  • Timeout: 60 seconds minimum
  • Sticky Sessions: Not required

Troubleshooting

Common Issues

Tool Discovery Fails

bash
# Check AWS credentials
aws sts get-caller-identity

# Verify cross-account role exists
aws iam get-role --role-name aws-security-mcp-cross-account-access

Cross-Account Access Denied

bash
# Test role assumption manually
aws sts assume-role \
  --role-arn arn:aws:iam::TARGET-ACCOUNT:role/aws-security-mcp-cross-account-access \
  --role-session-name test-session

Performance Issues

yaml
# Reduce concurrent operations
cross_account:
  max_concurrent_assumptions: 3
  
# Enable minimal logging
server:
  minimal_logging: true

Debug Mode

Enable verbose logging for troubleshooting:

bash
export MCP_LOG_LEVEL=debug
export MCP_STARTUP_QUIET=false
python3 aws_security_mcp/main.py sse

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Installatie

TypingMind
Vereisten:

Node.js 18+

{
  "mcpServers": {
    "groovybugify-aws-security-mcp": {
      "command": "",
      "args": []
    }
  }
}

Gebruik AWS Security MCP MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra AWS Security MCP is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Je kunt MCP lokaal op je apparaat uitvoeren of verbinding maken met de URL van een externe MCP-server.

Optie 1: Gebruik de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg AWS Security MCP toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van AWS Security MCP.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "groovybugify-aws-security-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "aws-security-mcp"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van AWS Security MCP in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van AWS Security MCP in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je AWS Security MCP gebruiken om me hiermee te helpen?
AWS Security MCP
Zeker. Ik heb het gelezen.
Dit vond ik met AWS Security MCP.

Optie 2: Voeg een MCP-server-URL toe

Gebruik dit als AWS Security MCP al extern wordt gehost of als je team één gedeelde connector wil die meerdere gebruikers kunnen gebruiken.

1

Open MCP-connectoren

Ga in TypingMind naar Plug-ins, open MCP-connectoren en kies URL toevoegen.

  1. Open TypingMind in je browser.
  2. Ga naar Plug-ins.
  3. Open MCP-connectoren.
  4. Klik op URL toevoegen.
TypingMind-formulier om een eigen MCP-server-URL toe te voegen
2

Plak de server-URL

Voer je server-URL in het veld Server-URL in. Voeg een verbindingsnaam, beschrijving, icoon, aangepaste HTTP-headers of OAuth-clientinstellingen toe als de server die vereist.

  1. Plak je server-URL in het veld Server-URL.
  2. Voer een verbindingsnaam in voor AWS Security MCP.
  3. Voeg een beschrijving en een icoon toe om de verbinding makkelijker te herkennen.
  4. Voeg aangepaste HTTP-headers of OAuth-clientgegevens toe als de server authenticatie vereist.
3

Maak de verbinding

Klik op Verbinding maken, ga terug naar de lijst met plug-ins en controleer of de nieuwe MCP-verbinding actief is.

  1. Klik op Verbinding maken.
  2. Ga terug naar de lijst met MCP-connectoren.
  3. Controleer of de verbinding met AWS Security MCP als actief wordt weergegeven.
  4. Vernieuw de lijst met plug-ins als de verbinding niet meteen verschijnt.
4

Wissel van model zonder opnieuw verbinding te maken

Start een chat met je favoriete model, schakel de tools van AWS Security MCP in via Plug-ins en wissel van model wanneer dat nodig is. De MCP-verbinding blijft beschikbaar in de TypingMind-werkruimte.

  1. Start een nieuwe chat in TypingMind.
  2. Selecteer het AI-model dat je wilt gebruiken.
  3. Schakel de tools van AWS Security MCP in via Plug-ins.
  4. Vraag het model om de tool te gebruiken wanneer dat nodig is.
  5. Schakel over naar een ander AI-model en gebruik dezelfde MCP-verbinding opnieuw.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je AWS Security MCP gebruiken om me hiermee te helpen?
AWS Security MCP
Zeker. Ik heb het gelezen.
Dit vond ik met AWS Security MCP.

Veelgestelde vragen

Waarvoor wordt de MCP-server AWS Security MCP gebruikt?

AWS Security MCP is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik AWS Security MCP MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je AWS Security MCP gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom AWS Security MCP MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als AWS Security MCP verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik AWS Security MCP MCP met TypingMind?

Je kunt AWS Security MCP met TypingMind verbinden via de lokale MCP-connector of door de URL van een externe MCP-server toe te voegen. Gebruik de lokale connector als de server toegang nodig heeft tot bestanden, apps of privébronnen op je apparaat. Gebruik een server-URL als de MCP-server extern wordt gehost.

Welke tools biedt AWS Security MCP MCP in TypingMind?

AWS Security MCP biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om AWS Security MCP MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als AWS Security MCP authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇