AWS EKS Secrets List Across Cluster or Sensitive Namespaces


Description

Detects list operations on Kubernetes Secrets from a non-loopback client when the request URI targets cluster-wide secrets or list operations under kube-system or default. Useful for spotting broad secret enumeration from remote clients.

Query · kuery

data_stream.dataset:"aws.eks_audit" and event.action:list and
aws.eks.audit.objectRef.resource:secrets and
aws.eks.audit.requestURI :(/api/v1/secrets or /api/v1/secrets?limit* or /api/v1/namespaces/kube-system/secrets or /api/v1/namespaces/kube-system/secrets?limit* or /api/v1/namespaces/default/secrets or /api/v1/namespaces/default/secrets?limit*) and
source.ip:(* and not ("::1" or "127.0.0.1")) and
not user.name: (system\:kube-controller-manager or eks\:cloud-controller-manager or eks\:kms-storage-migrator or
  "system:serviceaccount:argocd:argocd-application-controller" or
  "system:serviceaccount:elastic:kube-state-metrics" or
  "system:serviceaccount:cert-manager:cert-manager-cainjector" or
  "system:serviceaccount:elastic-system:elastic-agent" or
  "system:serviceaccount:longhorn-system:longhorn-service-account") and
not aws.eks.audit.user.groups:("system:serviceaccounts:ibm-csi" or "system:serviceaccounts:argocd" or "system:serviceaccounts:elastic")

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 Secrets List Across Cluster or Sensitive Namespaces

Audit events for list on the secrets resource against /api/v1/secrets, paginated cluster lists, or namespace-scoped lists under kube-system or default, from a source IP that is not localhost.

Possible investigation steps

  • Confirm the actor (user.name, groups) and whether the client is expected (CI, admin bastion, controller).
  • Review aws.eks.audit.requestURI, user_agent.original, and follow-on API activity from the same source.
  • Assess exposure: cluster-wide secret listing can surface many credentials.

False positive analysis

  • Legitimate controllers or operators listing secrets in kube-system / default from cluster nodes may match; tune by source IP, user agent, or service account as needed.

Response and remediation

  • If the listing is unauthorized, revoke the credentials used, rotate the secrets that were exposed, and tighten RBAC so that only the required service accounts can list secrets in those namespaces.
  • Review follow-on activity from the same identity and source IP for secret reads, pod exec, or RBAC changes.
Raw source AWS EKS Secrets List Across Cluster or Sensitive Namespaces · 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 list operations on Kubernetes Secrets from a non-loopback client when the request URI targets cluster-wide
secrets or list operations under kube-system or default. Useful for spotting broad secret enumeration from remote
clients.
"""
from = "now-6m"
index = ["logs-aws.eks_audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS EKS Secrets List Across Cluster or Sensitive Namespaces"
note = """## Triage and analysis

### Investigating AWS EKS Secrets List Across Cluster or Sensitive Namespaces
Audit events for `list` on the `secrets` resource against `/api/v1/secrets`, paginated cluster lists, or namespace-scoped
lists under `kube-system` or `default`, from a source IP that is not localhost.

### Possible investigation steps

- Confirm the actor (`user.name`, groups) and whether the client is expected (CI, admin bastion, controller).
- Review `aws.eks.audit.requestURI`, `user_agent.original`, and follow-on API activity from the same source.
- Assess exposure: cluster-wide secret listing can surface many credentials.

### False positive analysis

- Legitimate controllers or operators listing secrets in `kube-system` / `default` from cluster nodes may match; tune by
  source IP, user agent, or service account as needed.

### Response and remediation

- If the listing is unauthorized, revoke the credentials used, rotate the secrets that were exposed, and tighten RBAC so
  that only the required service accounts can list secrets in those namespaces.
- Review follow-on activity from the same identity and source IP for secret reads, pod exec, or RBAC changes."""
risk_score = 73
rule_id = "a4734e68-ae02-53da-892d-5403beceb95f"
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",
    "Tactic: Discovery",
    "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:list and
aws.eks.audit.objectRef.resource:secrets and
aws.eks.audit.requestURI :(/api/v1/secrets or /api/v1/secrets?limit* or /api/v1/namespaces/kube-system/secrets or /api/v1/namespaces/kube-system/secrets?limit* or /api/v1/namespaces/default/secrets or /api/v1/namespaces/default/secrets?limit*) and
source.ip:(* and not ("::1" or "127.0.0.1")) and
not user.name: (system\:kube-controller-manager or eks\:cloud-controller-manager or eks\:kms-storage-migrator or
  "system:serviceaccount:argocd:argocd-application-controller" or
  "system:serviceaccount:elastic:kube-state-metrics" or
  "system:serviceaccount:cert-manager:cert-manager-cainjector" or
  "system:serviceaccount:elastic-system:elastic-agent" or
  "system:serviceaccount:longhorn-system:longhorn-service-account") and
not aws.eks.audit.user.groups:("system:serviceaccounts:ibm-csi" or "system:serviceaccounts:argocd" or "system:serviceaccounts:elastic")
'''


[[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/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"


[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"

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.