Detection rules › Panther

Sensitive API Calls Via VPC Endpoint

Severity
medium
Log types
AWS.CloudTrail
Tags
AWS, VPC, CloudTrail, Network Boundary Bridging, Cloud Service Discovery, Account Manipulation, Impair Defenses
Reference
https://www.wiz.io/blog/aws-vpc-endpoint-cloudtrail
Source
github.com/panther-labs/panther-analysis

Detects sensitive or unusual API calls that might indicate lateral movement, reconnaissance, or other malicious activities through VPC Endpoints. Only available for CloudTrail, EC2, KMS, S3, and Secrets Manager services.

MITRE ATT&CK coverage

Rules detecting the same action

Other rules on this platform that filter on the same API call or operation.

Rule body yaml

AnalysisType: rule
Filename: aws_vpce_sensitive_api_calls.py
RuleID: "AWS.CloudTrail.VPCE.SensitiveAPICalls"
DisplayName: "Sensitive API Calls Via VPC Endpoint"
Enabled: true
LogTypes:
  - AWS.CloudTrail
Severity: Medium
Tags:
  - AWS
  - VPC
  - CloudTrail
  - Network Boundary Bridging
  - Cloud Service Discovery
  - Account Manipulation
  - Impair Defenses
Reports:
  MITRE ATT&CK:
    - TA0007:T1526 # Cloud Service Discovery
    - TA0003:T1098 # Account Manipulation
    - TA0005:T1562 # Impair Defenses
    - TA0005:T1599 # Network Boundary Bridging
Description: Detects sensitive or unusual API calls that might indicate lateral movement, reconnaissance, or other malicious activities through VPC Endpoints. Only available for CloudTrail, EC2, KMS, S3, and Secrets Manager services.
Runbook: |
  1. Identify the principal making the sensitive API call and the specific service affected
  2. Determine if this action is expected from this principal
  3. Check if the API call is one that typically requires additional scrutiny (e.g., logging configuration changes)
  4. Investigate whether the VPC Endpoint is configured to properly restrict access
  5. Review additional API calls from the same principal for suspicious patterns
  6. If unexpected activity is confirmed, consider temporarily restricting the principal's access
  7. Document findings and take appropriate remediation steps based on investigation
Reference: https://www.wiz.io/blog/aws-vpc-endpoint-cloudtrail
SummaryAttributes:
  - userIdentity.principalId
  - userIdentity.accountId
  - sourceIPAddress
  - eventSource
  - eventName
Tests:
  - Name: CloudTrail API Call Via VPC Endpoint
    ExpectedResult: true
    Log:
      {
        "eventVersion": "1.08",
        "eventCategory": "NetworkActivity",
        "eventType": "AwsVpceEvent",
        "eventTime": "2023-03-01T00:00:00Z",
        "awsRegion": "us-east-1",
        "eventSource": "cloudtrail.amazonaws.com",
        "eventName": "UpdateTrail",
        "sourceIPAddress": "10.0.0.1",
        "userIdentity": {
          "type": "IAMUser",
          "principalId": "AROAEXAMPLE:session-name",
          "accountId": "111111111111"
        },
        "requestParameters": {
          "name": "management-events",
          "isMultiRegionTrail": false
        },
        "responseElements": null,
        "vpcEndpointId": "vpce-1234abcd",
        "vpcEndpointAccountId": "111111111111",
        "recipientAccountId": "111111111111"
      }
  - Name: Regular S3 API Call (Not Sensitive)
    ExpectedResult: false
    Log:
      {
        "eventVersion": "1.08",
        "eventCategory": "NetworkActivity",
        "eventType": "AwsVpceEvent",
        "eventTime": "2023-03-01T00:00:00Z",
        "awsRegion": "us-east-1",
        "eventSource": "s3.amazonaws.com",
        "eventName": "GetObject",
        "sourceIPAddress": "10.0.0.1",
        "userIdentity": {
          "type": "IAMUser",
          "principalId": "AROAEXAMPLE:session-name",
          "accountId": "111111111111"
        },
        "requestParameters": {
          "bucketName": "example-bucket",
          "key": "example-file.txt"
        },
        "responseElements": null,
        "vpcEndpointId": "vpce-1234abcd",
        "vpcEndpointAccountId": "111111111111",
        "recipientAccountId": "111111111111"
      }
  - Name: API Call Without VPC Endpoint
    ExpectedResult: false
    Log:
      {
        "eventVersion": "1.08",
        "eventCategory": "Management",
        "eventType": "AwsApiCall",
        "eventTime": "2023-03-01T00:00:00Z",
        "awsRegion": "us-east-1",
        "eventSource": "s3.amazonaws.com",
        "eventName": "ListAllMyBuckets",
        "sourceIPAddress": "203.0.113.1",
        "userIdentity": {
          "type": "IAMUser",
          "principalId": "AROAEXAMPLE:session-name",
          "accountId": "111111111111"
        },
        "requestParameters": {},
        "responseElements": null
      } 

Detection logic

Condition

not (eventType ne "AwsVpceEvent" or eventCategory ne "NetworkActivity")
eventSource in ["ec2.amazonaws.com", "kms.amazonaws.com", "secretsmanager.amazonaws.com", "s3.amazonaws.com", "cloudtrail.amazonaws.com"]

This rule also runs imperative logic the parser cannot express as a filter; the conditions above are the structured part it could extract.

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
eventCategoryneNetworkActivity
eventTypeneAwsVpceEvent

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
eventSourcein
  • cloudtrail.amazonaws.com
  • ec2.amazonaws.com
  • kms.amazonaws.com
  • s3.amazonaws.com
  • secretsmanager.amazonaws.com

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

Field
eventName
eventSource
awsRegion
recipientAccountId
sourceIPAddress
userAgent
userIdentity
actor_user