76e083ced0
* [Rule Tunings] AWS Route Table Created / AWS EC2 Route Table Modified or Deleted AWS Route Table Created - turned this into a new_terms rule to reduce noise and be more indicative of potential malicious behavior. Used `cloud.account.id`, `user.name` combination to account for both roles and users doing this behavior for the first time. - changed execution interval - changed the name to add EC2 - slight adjustments to IG and description - fixed tagging error - added investigation fields AWS EC2 Route Table Modified or Deleted - replaced new terms field to `cloud.account.id`, `user.name` combination to account for both roles and users doing this behavior for the first time. - removed the exclusions from this rule. These exclusions, while meant to reduce noise caused by automation tools, actually just provide an easy bypass. A user can simply use CloudFormation to perform the exact same behaviors and avoid detection. I've shown this in the screenshot below, I ran a nearly identical script, one with and one without using CloudFormation. While `source.address` is `cloudformation.amazonaws.com` the behavior was still performed by an IAMUser and should still be evaluated. The fact that this is a new terms rule will reduce the risk of noise due to automation using these tools. - changed execution interval - slight adjustments to IG and description - added investigation fields * Update persistence_route_table_created.toml * Update rules/integrations/aws/persistence_ec2_route_table_modified_or_deleted.toml
124 lines
6.5 KiB
TOML
124 lines
6.5 KiB
TOML
[metadata]
|
|
creation_date = "2021/06/05"
|
|
integration = ["aws"]
|
|
maturity = "production"
|
|
updated_date = "2025/09/04"
|
|
|
|
[rule]
|
|
author = ["Elastic", "Austin Songer"]
|
|
description = """
|
|
Identifies when an EC2 Route Table has been created. Route tables can be used by attackers to disrupt network traffic, reroute communications, or maintain persistence in a compromised environment. This is a New Terms rule that detects the first instance of this behavior by a user or role.
|
|
"""
|
|
false_positives = [
|
|
"""
|
|
Route Tables may be created by a system or network administrators. Verify whether the user identity, user agent,
|
|
and/or hostname should be making changes in your environment. Route Table creation by unfamiliar users or hosts
|
|
should be investigated. If known behavior is causing false positives, it can be exempted from the rule. Automated
|
|
processes that use Terraform may lead to false positives.
|
|
""",
|
|
]
|
|
from = "now-6m"
|
|
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
|
|
language = "kuery"
|
|
license = "Elastic License v2"
|
|
name = "AWS EC2 Route Table Created"
|
|
note = """## Triage and analysis
|
|
|
|
> **Disclaimer**:
|
|
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
|
|
|
|
### Investigating AWS EC2 Route Table Created
|
|
|
|
AWS Route Tables are crucial components in managing network traffic within AWS environments, directing data between subnets and internet gateways. Adversaries may exploit route tables to reroute traffic for data exfiltration or to establish persistence by creating unauthorized routes. The detection rule monitors successful creation events of route tables, flagging potential misuse by correlating specific AWS CloudTrail logs, thus aiding in identifying unauthorized network configuration changes.
|
|
|
|
### Possible investigation steps
|
|
|
|
- Investigate the AWS account and IAM user or role to determine if the action aligns with expected behavior and permissions.
|
|
- Examine the newly created route table's configuration to identify any unauthorized or suspicious routes that could indicate potential misuse or data exfiltration attempts.
|
|
- Correlate the event with other network security monitoring data to identify any unusual traffic patterns or anomalies that coincide with the route table creation.
|
|
- Assess the environment for any recent changes or incidents that might explain the creation of the route table, such as new deployments or infrastructure modifications.
|
|
|
|
### False positive analysis
|
|
|
|
- Routine infrastructure updates or deployments may trigger route table creation events. To manage this, establish a baseline of expected behavior during scheduled maintenance windows and exclude these from alerts.
|
|
- Automated cloud management tools often create route tables as part of their operations. Identify these tools and create exceptions for their known activities to reduce noise.
|
|
- Development and testing environments frequently undergo changes, including the creation of route tables. Consider excluding these environments from alerts or applying a different set of monitoring rules.
|
|
- Legitimate changes by authorized personnel can be mistaken for suspicious activity. Implement a process to verify and document authorized changes, allowing for quick exclusion of these events from alerts.
|
|
- Multi-account AWS setups might have centralized networking teams that create route tables across accounts. Coordinate with these teams to understand their activities and exclude them from triggering alerts.
|
|
|
|
### Response and remediation
|
|
|
|
- If unauthorized, remove permissions for related actions from the user or role. You can use the managed [AWSDenyAll](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSDenyAll.html) policy.
|
|
- Review the newly created route table and any associated routes to identify unauthorized entries. Remove any routes that are not part of the expected network configuration.
|
|
- Conduct a thorough audit of IAM roles and permissions to ensure that only authorized users have the ability to create or modify route tables. Revoke any excessive permissions identified.
|
|
- Implement network monitoring to detect unusual traffic patterns that may indicate data exfiltration or other malicious activities.
|
|
- Escalate the incident to the security operations team for further investigation and to determine if additional AWS resources have been compromised.
|
|
- Review AWS CloudTrail logs for any other suspicious activities around the time of the route table creation to identify potential indicators of compromise.
|
|
- Update security policies and procedures to include specific guidelines for monitoring and responding to unauthorized route table modifications, ensuring rapid detection and response in the future.
|
|
|
|
## Setup
|
|
|
|
The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
|
|
references = [
|
|
"https://docs.datadoghq.com/security_platform/default_rules/aws-ec2-route-table-modified/",
|
|
"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateRoute.html",
|
|
"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateRouteTable",
|
|
]
|
|
risk_score = 21
|
|
rule_id = "e12c0318-99b1-44f2-830c-3a38a43207ca"
|
|
severity = "low"
|
|
tags = [
|
|
"Domain: Cloud",
|
|
"Data Source: AWS",
|
|
"Data Source: Amazon Web Services",
|
|
"Data Source: AWS EC2",
|
|
"Use Case: Network Security Monitoring",
|
|
"Tactic: Persistence",
|
|
"Resources: Investigation Guide",
|
|
]
|
|
timestamp_override = "event.ingested"
|
|
type = "new_terms"
|
|
|
|
query = '''
|
|
event.dataset: "aws.cloudtrail"
|
|
and event.provider: "ec2.amazonaws.com"
|
|
and event.action:(
|
|
"CreateRoute" or
|
|
"CreateRouteTable"
|
|
)
|
|
and event.outcome: "success"
|
|
'''
|
|
|
|
[rule.investigation_fields]
|
|
field_names = [
|
|
"@timestamp",
|
|
"user.name",
|
|
"user_agent.original",
|
|
"source.ip",
|
|
"aws.cloudtrail.user_identity.arn",
|
|
"aws.cloudtrail.user_identity.type",
|
|
"aws.cloudtrail.user_identity.access_key_id",
|
|
"event.action",
|
|
"event.outcome",
|
|
"cloud.account.id",
|
|
"cloud.region",
|
|
"aws.cloudtrail.request_parameters",
|
|
"aws.cloudtrail.response_elements"
|
|
]
|
|
|
|
[[rule.threat]]
|
|
framework = "MITRE ATT&CK"
|
|
|
|
[rule.threat.tactic]
|
|
id = "TA0003"
|
|
name = "Persistence"
|
|
reference = "https://attack.mitre.org/tactics/TA0003/"
|
|
|
|
[rule.new_terms]
|
|
field = "new_terms_fields"
|
|
value = ["cloud.account.id", "user.name"]
|
|
[[rule.new_terms.history_window_start]]
|
|
field = "history_window_start"
|
|
value = "now-10d"
|
|
|