4312d8c958
* initial commit * addressing flake errors * added apm to _get_packagted_integrations logic * addressed flake errors * adjusted integration schema and updated rules to be a list * updated several rules and removed a unit test * updated rules with logs-* only index patterns * Update tests/test_all_rules.py Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com> * addressed flake errors * integration is none is windows, endpoint or apm * adding rules with accepted incoming changes from main * fixed tag and tactic alignment errors from unit testing * adjusted unit testing logic for integration tags; added more exclusion rules * adjusted test_integration logic to be rule resistent and skip if -8.3 * adjusted comments for unit test skip * fixed merge conflicts from main * changing test_integration_tag to remove logic for rule version comparisons * added integration tag to new rule * adjusted rules updated_date value * ignore guided onboarding rule in unit tests * added integration tag to new rule Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
80 lines
3.0 KiB
TOML
80 lines
3.0 KiB
TOML
[metadata]
|
|
creation_date = "2022/07/05"
|
|
integration = ["kubernetes"]
|
|
maturity = "production"
|
|
min_stack_comments = "New fields added to Kubernetes Integration"
|
|
min_stack_version = "8.4.0"
|
|
updated_date = "2022/12/14"
|
|
|
|
[rule]
|
|
author = ["Elastic"]
|
|
description = """
|
|
This rule detects when a user creates a pod/container running in privileged mode. A highly privileged container has
|
|
access to the node's resources and breaks the isolation between containers. If compromised, an attacker can use the
|
|
privileged container to gain access to the underlying host. Gaining access to the host may provide the adversary with
|
|
the opportunity to achieve follow-on objectives, such as establishing persistence, moving laterally within the
|
|
environment, or setting up a command and control channel on the host.
|
|
"""
|
|
false_positives = [
|
|
"""
|
|
By default a container is not allowed to access any devices on the host, but a "privileged" container is given
|
|
access to all devices on the host. This allows the container nearly all the same access as processes running on the
|
|
host. An administrator may want to run a privileged container to use operating system administrative capabilities
|
|
such as manipulating the network stack or accessing hardware devices from within the cluster. Add exceptions for
|
|
trusted container images using the query field "kubernetes.audit.requestObject.spec.container.image"
|
|
""",
|
|
]
|
|
index = ["logs-kubernetes.*"]
|
|
language = "kuery"
|
|
license = "Elastic License v2"
|
|
name = "Kubernetes Privileged Pod Created"
|
|
note = """## Setup
|
|
|
|
The Kubernetes Fleet integration with Audit Logs enabled or similarly structured data is required to be compatible with this rule."""
|
|
references = [
|
|
"https://media.defense.gov/2021/Aug/03/2002820425/-1/-1/1/CTR_KUBERNETES%20HARDENING%20GUIDANCE.PDF",
|
|
"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/",
|
|
]
|
|
risk_score = 47
|
|
rule_id = "c7908cac-337a-4f38-b50d-5eeb78bdb531"
|
|
severity = "medium"
|
|
tags = ["Elastic", "Kubernetes", "Continuous Monitoring", "Execution", "Privilege Escalation"]
|
|
timestamp_override = "event.ingested"
|
|
type = "query"
|
|
|
|
query = '''
|
|
event.dataset : "kubernetes.audit_logs"
|
|
and kubernetes.audit.annotations.authorization_k8s_io/decision:"allow"
|
|
and kubernetes.audit.objectRef.resource:pods
|
|
and kubernetes.audit.verb:create
|
|
and kubernetes.audit.requestObject.spec.containers.securityContext.privileged:true
|
|
and not kubernetes.audit.requestObject.spec.containers.image: ("docker.elastic.co/beats/elastic-agent:8.4.0")
|
|
'''
|
|
|
|
|
|
[[rule.threat]]
|
|
framework = "MITRE ATT&CK"
|
|
[[rule.threat.technique]]
|
|
id = "T1611"
|
|
name = "Escape to Host"
|
|
reference = "https://attack.mitre.org/techniques/T1611/"
|
|
|
|
|
|
[rule.threat.tactic]
|
|
id = "TA0004"
|
|
name = "Privilege Escalation"
|
|
reference = "https://attack.mitre.org/tactics/TA0004/"
|
|
[[rule.threat]]
|
|
framework = "MITRE ATT&CK"
|
|
[[rule.threat.technique]]
|
|
id = "T1610"
|
|
name = "Deploy Container"
|
|
reference = "https://attack.mitre.org/techniques/T1610/"
|
|
|
|
|
|
[rule.threat.tactic]
|
|
id = "TA0002"
|
|
name = "Execution"
|
|
reference = "https://attack.mitre.org/tactics/TA0002/"
|
|
|