AWS EKS Rapid Secret GET Activity Against Multiple Objects


Description

This rule detects an unusual volume of Kubernetes API get requests against multiple distinct Secret objects from the same client fingerprint (user, source IP, and user agent) within a defined lookback window. This can indicate credential access or in-cluster reconnaissance, where a user or token is used to enumerate and retrieve sensitive data such as service account tokens, registry credentials, TLS material, or application configuration. Failed get requests are also included, as they may reveal RBAC boundaries, confirm the existence of targeted secrets, or reflect automated probing activity.

Query · esql

from logs-aws.eks_audit-* metadata _id, _index, _version
| where data_stream.dataset == "aws.eks_audit"
    and event.action == "get"
    and aws.eks.audit.objectRef.resource == "secrets"
    and source.ip is not null and user.name is not null
    and not to_string(source.ip) in ("127.0.0.1", "::1")
    and not user.name in ("system:kube-controller-manager", "system:kube-scheduler")
    and not aws.eks.audit.objectRef.name like "sh.helm.release.*"
    and not aws.eks.audit.user.username in (
      "system:serviceaccount:flux-system:kustomize-controller",
      "system:serviceaccount:flux-system:helm-controller",
      "system:serviceaccount:flux-system:source-controller",
      "system:serviceaccount:security:trivy-operator"
    )
| stats
    Esql.unique_credentials = count_distinct(aws.eks.audit.objectRef.name),
    Esql.secrets_names = values(aws.eks.audit.objectRef.name),
    Esql.namespaces = values(aws.eks.audit.objectRef.namespace),
    Esql.event_outcome_values = values(event.outcome),
    Esql.outcome = values(`aws.eks.audit.annotations.authorization_k8s_io/decision`)
  by user.name, aws.eks.audit.user.username, source.ip, user_agent.original
| where Esql.unique_credentials >= 3
| KEEP user.name, aws.eks.audit.user.username, source.ip, user_agent.original, Esql.*

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.

Analyst notes

Investigating AWS EKS Rapid Secret GET Activity Against Multiple Objects

This rule surfaces clusters of get operations on the secrets API where the same identity and client path (user.name, source.ip, user_agent.original) touch several different secret names within the rule lookback window. Allowed and denied outcomes are included: successful reads may indicate harvesting; repeated forbidden or unauthorized responses can still signal reconnaissance, RBAC probing, or scripted spray against secret names that exist in the cluster.

Possible investigation steps

  • Inspect Esql.outcome for a mix of allow vs deny and whether failures cluster on sensitive namespaces.
  • Map the identity to RBAC and namespace scope; review Esql.secrets_names and Esql.namespaces for high-value targets (tokens, registry credentials, TLS bundles, application secrets).
  • Pivot on the same source.ip and user for follow-on API activity (exec, pod create, role changes, broad list on secrets).
  • Validate against expected automation (CI, GitOps, backup, in-cluster controllers) before treating as malicious.

False positive analysis

  • Startup, Helm, or controllers may legitimately touch many secrets in one window; tune by user, namespace, or IP allowlists when baselined.

Response and remediation

  • If the activity is unauthorized, revoke the token or credentials used, rotate every secret that was read, and reduce the identity's RBAC to least privilege.
  • Review the same identity and source IP for pod exec, token creation, or RBAC changes in the surrounding time window.
Raw source AWS EKS Rapid Secret GET Activity Against Multiple Objects · 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 = """
This rule detects an unusual volume of Kubernetes API get requests against multiple distinct Secret objects from the
same client fingerprint (user, source IP, and user agent) within a defined lookback window. This can indicate credential
access or in-cluster reconnaissance, where a user or token is used to enumerate and retrieve sensitive data such as
service account tokens, registry credentials, TLS material, or application configuration. Failed get requests are also
included, as they may reveal RBAC boundaries, confirm the existence of targeted secrets, or reflect automated probing
activity.
"""
from = "now-6m"
language = "esql"
license = "Elastic License v2"
name = "AWS EKS Rapid Secret GET Activity Against Multiple Objects"
note = """## Triage and analysis

### Investigating AWS EKS Rapid Secret GET Activity Against Multiple Objects
This rule surfaces clusters of `get` operations on the `secrets` API where the same identity and client path
(`user.name`, `source.ip`, `user_agent.original`) touch several different secret names within the rule lookback window.
**Allowed and denied** outcomes are included: successful reads may indicate harvesting; repeated **forbidden** or
**unauthorized** responses can still signal reconnaissance, RBAC probing, or scripted spray against secret names that
exist in the cluster.

### Possible investigation steps

- Inspect `Esql.outcome` for a mix of allow vs deny and whether failures cluster on sensitive namespaces.
- Map the identity to RBAC and namespace scope; review `Esql.secrets_names` and `Esql.namespaces` for high-value
  targets (tokens, registry credentials, TLS bundles, application secrets).
- Pivot on the same `source.ip` and user for follow-on API activity (exec, pod create, role changes, broad `list` on
  secrets).
- Validate against expected automation (CI, GitOps, backup, in-cluster controllers) before treating as malicious.

### False positive analysis

- Startup, Helm, or controllers may legitimately touch many secrets in one window; tune by user, namespace, or IP
  allowlists when baselined.

### Response and remediation

- If the activity is unauthorized, revoke the token or credentials used, rotate every secret that was read, and reduce
  the identity's RBAC to least privilege.
- Review the same identity and source IP for pod exec, token creation, or RBAC changes in the surrounding time window."""
references = ["https://www.sysdig.com/blog/scarleteel-2-0"]
risk_score = 73
rule_id = "c626a35b-a4ac-51b3-9b06-090ca10b2ad6"
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: ES|QL",
    "Resources: Investigation Guide",
    "Profile: Beta",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-aws.eks_audit-* metadata _id, _index, _version
| where data_stream.dataset == "aws.eks_audit"
    and event.action == "get"
    and aws.eks.audit.objectRef.resource == "secrets"
    and source.ip is not null and user.name is not null
    and not to_string(source.ip) in ("127.0.0.1", "::1")
    and not user.name in ("system:kube-controller-manager", "system:kube-scheduler")
    and not aws.eks.audit.objectRef.name like "sh.helm.release.*"
    and not aws.eks.audit.user.username in (
      "system:serviceaccount:flux-system:kustomize-controller",
      "system:serviceaccount:flux-system:helm-controller",
      "system:serviceaccount:flux-system:source-controller",
      "system:serviceaccount:security:trivy-operator"
    )
| stats
    Esql.unique_credentials = count_distinct(aws.eks.audit.objectRef.name),
    Esql.secrets_names = values(aws.eks.audit.objectRef.name),
    Esql.namespaces = values(aws.eks.audit.objectRef.namespace),
    Esql.event_outcome_values = values(event.outcome),
    Esql.outcome = values(`aws.eks.audit.annotations.authorization_k8s_io/decision`)
  by user.name, aws.eks.audit.user.username, source.ip, user_agent.original
| where Esql.unique_credentials >= 3
| KEEP user.name, aws.eks.audit.user.username, source.ip, user_agent.original, Esql.*
'''


[[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.