First Time Python Accessed Sensitive Credential Files

Last updated 23 days ago on 2026-02-23
Created 23 days ago on 2026-02-23

About

Detects the first time a Python process accesses sensitive credential files on a given host. This behavior may indicate post-exploitation credential theft via a malicious Python script, compromised dependency, or malicious model file deserialization. Legitimate Python processes do not typically access credential files such as SSH keys, AWS credentials, browser cookies, Kerberos tickets, or keychain databases, so a first occurrence is a strong indicator of compromise.
Tags
Domain: EndpointOS: macOSUse Case: Threat DetectionTactic: Credential AccessData Source: Elastic DefendDomain: LLMLanguage: kuery
Severity
medium
Risk Score
47
MITRE ATT&CK™

Credential Access (TA0006)(external, opens in a new tab or window)

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

Definition

Rule Type
New Terms Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.file-*
Related Integrations

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

Query
text code block:
event.category:file and host.os.type:macos and event.action:open and process.name:python*

Install detection rules in Elastic Security

Detect First Time Python Accessed Sensitive Credential Files 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).