-
Notifications
You must be signed in to change notification settings - Fork 587
[New Rule] Potential Impersonation Attempt via Kubectl #4833
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
base: main
Are you sure you want to change the base?
Conversation
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
⛔️ Test failed Results
|
⛔️ Test failed Results
|
process.parent.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/root/*", "/home/*") or | ||
process.parent.name like (".*", "*.sh") | ||
) | ||
) and process.args like~ ("--kubeconfig*", "--token*", "--as*", "--as-group*", "--as-uid*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add certificates (--client-certificate
) and keys here then if we are including token? the as
commands are more authZ and kubeconfig and token are authN, so I think it may still be valid for this as they would include an X509 cert for mTLS.
Summary
This rule detects potential impersonation attempts via the "kubectl" command in Linux environments. It identifies process events where "kubectl" is executed with arguments that suggest an attempt to impersonate another user or group, such as using "--kubeconfig", "--token", "--as", or "--as-group". This could indicate an adversary trying to gain unauthorized access or escalate privileges within a Kubernetes cluster. If this rule is triggered, in conjunction with rules related to secret access or kubeconfig file discovery, it may indicate a potential impersonation attempt.
Telemetry
This has a decent volume of hits over the last 30d, related to 4 specific agent ids in telemetry, however, these are easily excluded for these accounts when this activity is allowed to occur. By adding additional exclusions, real activity will not be captured. In my own testing stack, only hits related to testing.