Detection rules › Sigma

Kubernetes Admission Controller Modification

Status
test
Severity
medium
Log source
product kubernetes, service audit
Author
kelnage
Source
github.com/SigmaHQ/sigma

Detects when a modification (create, update or replace) action is taken that affects mutating or validating webhook configurations, as they can be used by an adversary to achieve persistence or exfiltrate access credentials.

Known false positives

  • Modifying the Kubernetes Admission Controller may need to be done by a system administrator.
  • Automated processes may need to take these actions and may need to be filtered.

MITRE ATT&CK coverage

TacticTechniques
Initial Access
Persistence
Privilege Escalation
Stealth
Credential Access

Telemetry coverage

Rules detecting the same action

These rules filter on the same operation.

Rule body

title: Kubernetes Admission Controller Modification
id: eed82177-38f5-4299-8a76-098d50d225ab
related:
    - id: 6ad91e31-53df-4826-bd27-0166171c8040
      type: similar
status: test
description: |
    Detects when a modification (create, update or replace) action is taken that affects mutating or validating webhook configurations, as they can be used by an adversary to achieve persistence or exfiltrate access credentials.
references:
    - https://kubernetes.io/docs/reference/config-api/apiserver-audit.v1/
    - https://security.padok.fr/en/blog/kubernetes-webhook-attackers
author: kelnage
date: 2024-07-11
tags:
    - attack.privilege-escalation
    - attack.initial-access
    - attack.persistence
    - attack.stealth
    - attack.t1078
    - attack.credential-access
    - attack.t1552
    - attack.t1552.007
logsource:
    product: kubernetes
    service: audit
detection:
    selection:
        objectRef.apiGroup: 'admissionregistration.k8s.io'
        objectRef.resource:
            - 'mutatingwebhookconfigurations'
            - 'validatingwebhookconfigurations'
        verb:
            - 'create'
            - 'delete'
            - 'patch'
            - 'replace'
            - 'update'
    condition: selection
falsepositives:
    - Modifying the Kubernetes Admission Controller may need to be done by a system administrator.
    - Automated processes may need to take these actions and may need to be filtered.
level: medium

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    objectRef.apiGroup: 'admissionregistration.k8s.io'
    objectRef.resource:
        - 'mutatingwebhookconfigurations'
        - 'validatingwebhookconfigurations'
    verb:
        - 'create'
        - 'delete'
        - 'patch'
        - 'replace'
        - 'update'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
objectRef.apiGroupeq
  • admissionregistration.k8s.io
field:"objectRef.apiGroup" kind:eq value:"admissionregistration.k8s.io"
objectRef.resourceeq
  • mutatingwebhookconfigurations
  • validatingwebhookconfigurations
field:"objectRef.resource" kind:eq
verbeq
  • create
  • delete
  • patch
  • replace
  • update
field:"verb" kind:eq