SSH Authorized Key File Activity Detected via Defend for Containers

Last updated 23 days ago on 2026-01-15
Created 3 years ago on 2023-05-12

About

This rule detects the creation or modification of an authorized_keys file inside a container. The Secure Shell (SSH) authorized_keys file specifies which users are allowed to log into a server using public key authentication. Adversaries may modify it to maintain persistence on a victim host by adding their own public key(s). Unexpected and unauthorized SSH usage inside a container can be an indicator of compromise and should be investigated.
Tags
Data Source: Elastic Defend for ContainersDomain: ContainerOS: LinuxUse Case: Threat DetectionTactic: PersistenceTactic: Lateral MovementLanguage: eql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Persistence (TA0003)(external, opens in a new tab or window)

Lateral Movement (TA0008)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-cloud_defend.file*
Related Integrations

cloud_defend(external, opens in a new tab or window)

Query
text code block:
file where host.os.type == "linux" and event.type in ("change", "creation") and file.name in ("authorized_keys", "authorized_keys2") and process.interactive == true and container.id like "*"

Install detection rules in Elastic Security

Detect SSH Authorized Key File Activity Detected via Defend for Containers in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).