-
Notifications
You must be signed in to change notification settings - Fork 570
[New Rule] Kubernetes execution_user_exec_to_pod #1979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
imays11
merged 19 commits into
main
from
1978-new-rule-kubernetes-exec-into-podcontainer
Jun 9, 2022
Merged
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
25ba979
Create execution_user_exec_to_pod.toml
imays11 7e283e6
Update execution_user_exec_to_pod.toml
imays11 2d13fad
Update rules/integrations/kubernetes/execution_user_exec_to_pod.toml
w0rk3r b44f6a8
Update non-ecs-schema.json
w0rk3r a375e6b
Update execution_user_exec_to_pod.toml
w0rk3r 8b6a6f8
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
terrancedejesus f88dcfe
Update rules/integrations/kubernetes/execution_user_exec_to_pod.toml
imays11 65c1c2c
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
terrancedejesus 7c5d067
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
terrancedejesus 8f83c26
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
terrancedejesus cb8f7b4
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
DefSecSentinel ab0c75a
Update execution_user_exec_to_pod.toml
imays11 677eedc
Update execution_user_exec_to_pod.toml
imays11 dab6040
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
DefSecSentinel 0688997
Update execution_user_exec_to_pod.toml
imays11 767d859
toml-linted file and add to false positive
imays11 8d65b00
Create notepad.sct
imays11 c7a2c2e
Merge branch 'main' into 1978-new-rule-kubernetes-exec-into-podcontainer
DefSecSentinel 59a94f6
added min_stack_version based on integration
imays11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
rules/integrations/kubernetes/execution_user_exec_to_pod.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[metadata] | ||
creation_date = "2022/05/17" | ||
maturity = "production" | ||
updated_date = "2022/05/17" | ||
integration = "kubernetes" | ||
|
||
[rule] | ||
author = ["Elastic"] | ||
description = """ | ||
This rule detects a user attempt to establish a shell session into a pod using the 'exec' command. Using the 'exec' command in a pod allows a user to establish a temporary shell session and execute any process/commands in the pod. An adversary may call bash to gain a persistent interactive shell which will allow access to any data the pod has permissions to, including secrets. | ||
imays11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
false_positives = [ | ||
""" | ||
An administrator may need to exec into a pod for a legitimate reason. | ||
imays11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""", | ||
] | ||
index = ["filebeat-*", "logs-kubernetes.*"] | ||
language = "kuery" | ||
license = "Elastic License v2" | ||
name = "User Exec into Pod" | ||
note = """## Config | ||
|
||
The Kubernetes Fleet integration with Audit Logs enabled, Filebeat module, or similarly structured data is required to be compatible with this rule.""" | ||
references = ["https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/", | ||
"https://kubernetes.io/docs/tasks/debug/debug-application/get-shell-running-container/"] | ||
risk_score = 47 | ||
rule_id = "14de811c-d60f-11ec-9fd7-f661ea17fbce" | ||
severity = "medium" | ||
tags = ["Elastic", "Kubernetes", "Continuous Monitoring", "Execution"] | ||
timestamp_override = "event.ingested" | ||
type = "query" | ||
|
||
query = ''' | ||
event.dataset : "kubernetes.audit_logs" and kubernetes.audit.objectRef.resource : "pods" and kubernetes.audit.objectRef.subresource :"exec" | ||
''' | ||
imays11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
[[rule.threat]] | ||
framework = "MITRE ATT&CK" | ||
[[rule.threat.technique]] | ||
id = "T1609" | ||
name = "Container Administration Command" | ||
reference = "https://attack.mitre.org/techniques/T1609/" | ||
|
||
|
||
[rule.threat.tactic] | ||
id = "TA0002" | ||
name = "Execution" | ||
reference = "https://attack.mitre.org/tactics/TA0002/" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.