AWS EKS Secret get or list with Suspicious User Agent


Description

Detects read access to Kubernetes Secrets (get/list) with a user agent matching a curated set of non-standard or attacker-leaning clients, for example minimal HTTP tooling, common scripting stacks, default library fingerprints, or distribution-tagged strings associated with offensive-security Linux images. Legitimate in-cluster automation usually presents stable, purpose-specific user agents (for example controller or client-go variants used by known components).

Query · kuery

data_stream.dataset:"aws.eks_audit" and
event.action:(get or list) and event.outcome:success and
aws.eks.audit.objectRef.resource:"secrets" and
user_agent.original:(
  curl* or python* or Python* or wget* or Go-http* or perl* or java* or node* or php* or
  *distrib#kali* or *kali-amd64* or *kali-arm64* or Bun* or axios* or undici*
) and
source.ip:*

Implementation guide

This rule reads EKS control-plane audit logs collected by the AWS integration into logs-aws.eks_audit-*, where the AWS EKS audit ingest pipelines normalize each audit record under aws.eks.audit.*.

Enable the audit control-plane log type on the EKS cluster, send its CloudWatch log group through the AWS integration, and confirm events carry data_stream.dataset: aws.eks_audit and cloud.provider: aws before enabling this rule.

Known false positives

  • Operators may use ad hoc HTTP clients, scripts, or penetration-test images during approved exercises or break-glass maintenance; validate tickets, source IP, and identity before treating as compromise.
  • Internal automation built with generic libraries can resemble suspicious user agents; baseline known jobs and tune by service account, namespace, or stable source IP allowlists.

Analyst notes

Investigating AWS EKS Secret get or list with Suspicious User Agent

The rule matches Kubernetes audit events for secret get/list where user_agent.original matches a small allowlist of suspicious patterns (scripting runtimes, bare HTTP clients, and known offensive-distro markers) and source.ip is populated. It is meant to highlight credential access where the client fingerprint does not look like routine kubectl or well-known controller traffic relative to your environment.

Possible investigation steps

  • Tie user.name (and aws.eks.audit.impersonatedUser.* if present) to a human, service account, or cloud identity and validate whether that principal should use this user-agent profile against the targeted namespaces and secret names.
  • Review aws.eks.audit.objectRef.namespace and aws.eks.audit.objectRef.name for high-value objects (service account tokens, cloud IAM bindings, registry pulls, TLS bundles).
  • Pivot on source.ip in VPC flow, VPN, or proxy logs to determine origin (employee laptop, compromised host, cloud instance) and correlate with other API bursts or exec activity.
  • Check aws.eks.audit.annotations.authorization_k8s_io/decision for successful reads versus failed probing.

False positive analysis

  • CI, GitOps, or one-off scripts can emit generic user agents with broad RBAC; exclude stable pipelines and service accounts after review.
  • Local API server loopback may still populate source.ip in some topologies; compare with expected control-plane paths.

Response and remediation

  • If unauthorized, rotate affected secrets and credentials, revoke tokens or kubeconfigs for the identity, tighten RBAC, and block or isolate the source host at the network edge to the API server where appropriate.
Raw source AWS EKS Secret get or list with Suspicious User Agent · Elastic TOML
Esc
Published by elastic/detection-rules ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[metadata]
creation_date = "2026/08/03"
integration = ["aws"]
maturity = "production"
min_stack_comments = "The AWS integration adds the aws.eks_audit data stream in package 8.9.0, which requires Kibana 9.6.0 or later."
min_stack_version = "9.6.0"
updated_date = "2026/10/20"

[rule]
author = ["Elastic"]
description = """
Detects read access to Kubernetes Secrets (get/list) with a user agent matching a curated set of non-standard or
attacker-leaning clients, for example minimal HTTP tooling, common scripting stacks, default library fingerprints, or
distribution-tagged strings associated with offensive-security Linux images. Legitimate in-cluster automation usually
presents stable, purpose-specific user agents (for example controller or client-go variants used by known components).
"""
false_positives = [
    """
    Operators may use ad hoc HTTP clients, scripts, or penetration-test images during approved exercises or break-glass
    maintenance; validate tickets, source IP, and identity before treating as compromise.
    """,
    """
    Internal automation built with generic libraries can resemble suspicious user agents; baseline known jobs and tune
    by service account, namespace, or stable source IP allowlists.
    """,
]
from = "now-6m"
index = ["logs-aws.eks_audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS EKS Secret get or list with Suspicious User Agent"
note = """## Triage and analysis

### Investigating AWS EKS Secret get or list with Suspicious User Agent
The rule matches Kubernetes audit events for **secret** `get`/`list` where **`user_agent.original`** matches a **small
allowlist of suspicious patterns** (scripting runtimes, bare HTTP clients, and known offensive-distro markers) and
**`source.ip` is populated**. It is meant to highlight **credential access** where the client fingerprint does not look
like routine kubectl or well-known controller traffic relative to your environment.

### Possible investigation steps

- Tie `user.name` (and `aws.eks.audit.impersonatedUser.*` if present) to a human, service account, or cloud identity
  and validate whether that principal should use this user-agent profile against the targeted namespaces and secret names.
- Review `aws.eks.audit.objectRef.namespace` and `aws.eks.audit.objectRef.name` for high-value objects (service
  account tokens, cloud IAM bindings, registry pulls, TLS bundles).
- Pivot on `source.ip` in VPC flow, VPN, or proxy logs to determine origin (employee laptop, compromised host, cloud
  instance) and correlate with other API bursts or exec activity.
- Check `aws.eks.audit.annotations.authorization_k8s_io/decision` for successful reads versus failed probing.

### False positive analysis

- CI, GitOps, or one-off scripts can emit generic user agents with broad RBAC; exclude stable pipelines and service
  accounts after review.
- Local API server loopback may still populate `source.ip` in some topologies; compare with expected control-plane paths.

### Response and remediation

- If unauthorized, rotate affected secrets and credentials, revoke tokens or kubeconfigs for the identity, tighten RBAC,
  and block or isolate the source host at the network edge to the API server where appropriate."""
references = ["https://kubernetes.io/docs/concepts/configuration/secret/"]
risk_score = 73
rule_id = "c4014f2d-3d1c-5c74-8d00-e5a942da0ec7"
setup = """This rule reads EKS control-plane audit logs collected by the AWS integration
into `logs-aws.eks_audit-*`, where the AWS EKS audit ingest
pipelines normalize each audit record under `aws.eks.audit.*`.

Enable the `audit` control-plane log type on the EKS cluster, send its
CloudWatch log group through the AWS integration, and confirm events carry
`data_stream.dataset: aws.eks_audit` and
`cloud.provider: aws` before enabling this rule.
"""
severity = "high"
tags = [
    "Domain: Cloud",
    "Domain: Containers",
    "Platform: AWS",
    "Platform: Kubernetes",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: Kubernetes API Server Audit Logs",
    "Service: AWS EKS",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Rule Type: Custom Query (KQL)",
    "Resources: Investigation Guide",
    "Profile: Beta",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:"aws.eks_audit" and
event.action:(get or list) and event.outcome:success and
aws.eks.audit.objectRef.resource:"secrets" and
user_agent.original:(
  curl* or python* or Python* or wget* or Go-http* or perl* or java* or node* or php* or
  *distrib#kali* or *kali-amd64* or *kali-arm64* or Bun* or axios* or undici*
) and
source.ip:*
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.007"
name = "Container API"
reference = "https://attack.mitre.org/techniques/T1552/007/"



[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.