Exposed VPC Endpoint
ID: vpc-endpoint-exposed
Severity: medium
Author: princechaddha
Tags: cloud,devops,aws,amazon,vpc,aws-cloud-config
Description
Section titled “Description”Identify and secure fully accessible Amazon VPC endpoints to prevent unauthorized access to AWS services.
YAML Source
Section titled “YAML Source”id: vpc-endpoint-exposedinfo: name: Exposed VPC Endpoint author: princechaddha severity: medium description: | Identify and secure fully accessible Amazon VPC endpoints to prevent unauthorized access to AWS services. impact: | Allows unrestricted access to AWS services via the exposed VPC endpoint, potentially leading to data leakage or unauthorized operations. remediation: | Update the VPC endpoint's policy to restrict access only to authorized entities and ensure all requests are signed. reference: - https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html metadata: max-request: 2 tags: cloud,devops,aws,amazon,vpc,aws-cloud-configvariables: region: "us-east-1"
flow: | code(1) for(let VpcIds of iterate(template.VpcId)){ set("vpc", VpcIds) code(2) }
self-contained: truecode: - engine: - sh - bash source: | aws ec2 describe-vpc-endpoints --region $region --output table --query 'VpcEndpoints[*].VpcEndpointId' --output json
extractors: - type: json name: VpcId internal: true json: - '.[]'
- engine: - sh - bash source: | aws ec2 describe-vpc-endpoints --region $region --vpc-endpoint-ids $vpc --query 'VpcEndpoints[*].PolicyDocument' --output json
matchers-condition: and matchers: - type: word words: - '"AWS": "*"' - '"Principal": "*"'
- type: word words: - "Condition" negative: true
extractors: - type: dsl dsl: - '"VPC endpoints for " + vpc + "are exposed."'# digest: 4a0a0047304502206b7f7ad65cafa7d576fe2fca2e7b7ea38dee4b9bdb02d18bfc4965cbe280ee5e022100f3b46231f12106be78517b440b8a0e42706cdbc9c0486736fe4578f364ec05a9:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "cloud/aws/vpc/vpc-endpoint-exposed.yaml"