Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Detection Rules] Adding Documents for v8.12.22 Pre-Built Detection Rules #5837

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
[[prebuilt-rule-8-12-22-aws-ssm-sendcommand-with-run-shell-command-parameters]]
=== AWS SSM `SendCommand` with Run Shell Command Parameters

Identifies the use of the AWS Systems Manager (SSM) `SendCommand` API with the either `AWS-RunShellScript` or `AWS-RunPowerShellScript` parameters. The `SendCommand` API call allows users to execute commands on EC2 instances using the SSM service. Adversaries may use this technique to execute commands on EC2 instances without the need for SSH or RDP access. This behavior may indicate an adversary attempting to execute commands on an EC2 instance for malicious purposes. This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule that only flags when this behavior is observed for the first time on a host in the last 7 days.

*Rule type*: new_terms

*Rule indices*:

* logs-endpoint.events.*
* endgame-*
* auditbeat-*
* logs-auditd_manager.auditd-*

*Severity*: medium

*Risk score*: 47

*Runs every*: 5m

*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)

*Maximum alerts per execution*: 100

*References*:

* https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ssm-privesc
* https://securitycafe.ro/2023/01/17/aws-post-explitation-with-ssm-sendcommand/

*Tags*:

* Domain: Endpoint
* Domain: Cloud
* OS: Linux
* OS: macOS
* OS: Windows
* Use Case: Threat Detection
* Tactic: Execution
* Data Source: Elastic Defend
* Data Source: Elastic Endgame
* Data Source: Auditd Manager

*Version*: 1

*Rule authors*:

* Elastic

*Rule license*: Elastic License v2


==== Setup



*Setup*


This rule requires data coming in from Elastic Defend.


*Elastic Defend Integration Setup*

Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.


*Prerequisite Requirements:*

- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the https://www.elastic.co/guide/en/fleet/current/fleet-server.html[documentation].


*The following steps should be executed in order to add the Elastic Defend integration on a Linux System:*

- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html[Helper guide].
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html[helper guide].
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the https://www.elastic.co/guide/en/security/current/install-endpoint.html[helper guide].


==== Rule query


[source, js]
----------------------------------
event.category: "process" and event.type: "start" and process.name: "aws"
and (
host.os.type: ("windows" or "macos")
or (
host.os.type: "linux"
and event.action: ("exec" or "exec_event" or "executed" or "process_started")
)
)
and process.args: (
"send-command" and "--parameters" and commands=*
and ("AWS-RunShellScript" or "AWS-RunPowerShellScript")
)

----------------------------------

*Framework*: MITRE ATT&CK^TM^

* Tactic:
** Name: Execution
** ID: TA0002
** Reference URL: https://attack.mitre.org/tactics/TA0002/
* Technique:
** Name: Cloud Administration Command
** ID: T1651
** Reference URL: https://attack.mitre.org/techniques/T1651/
Loading