Detection rules › Sigma

Ingress Port 22 Opened

Status
test
Severity
medium
Log source
product aws, service cloudtrail
Author
Zach Mathis (@yamatosecurity)
Source
github.com/Yamato-Security/suzaku-rules

Ingress port 22 was opened in a security group for an EC2 instance. This is a common tactic used by attackers to establish access into the environment via SSH for a variety of reasons (exfil, etc...).

MITRE ATT&CK coverage

TacticTechniques
PersistenceNo specific technique
ExfiltrationNo specific technique

Event coverage

Rules detecting the same action

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

Rule body yaml

title: Ingress Port 22 Opened 
id: 372d79d1-73c5-48db-aa98-18b1a03fc9fc
status: test
description: |
    Ingress port 22 was opened in a security group for an EC2 instance.
    This is a common tactic used by attackers to establish access into the environment via SSH for a variety of reasons (exfil, etc...).
references:
    - https://stratus-red-team.cloud/attack-techniques/AWS/aws.exfiltration.ec2-security-group-open-port-22-ingress/
author: Zach Mathis (@yamatosecurity)
date: 2025-04-24
modified: 2025-04-24
tags:
    - attack.exfiltration
    - attack.persistence
logsource:
    product: aws
    service: cloudtrail
detection:
    selection:
        eventSource: 'ec2.amazonaws.com'
        eventName: 'AuthorizeSecurityGroupIngress'
    selection_port_ranges:
        - requestParameters.fromPort: '22'
        - requestParameters.toPort: '22'
    condition: selection and selection_port_ranges
falsepositives:
level: medium

Stages and Predicates

Stage 0: condition

selection and selection_port_ranges

Stage 1: selection

selection:
    eventSource: 'ec2.amazonaws.com'
    eventName: 'AuthorizeSecurityGroupIngress'

Stage 2: selection_port_ranges

selection_port_ranges:
    - requestParameters.fromPort: '22'
    - requestParameters.toPort: '22'

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
eventNameeq
  • AuthorizeSecurityGroupIngress
eventSourceeq
  • ec2.amazonaws.com
requestParameters.fromPorteq
  • 22
requestParameters.toPorteq
  • 22