-
Notifications
You must be signed in to change notification settings - Fork 692
[New Rule] AWS EKS Access Entry Created Then Deleted by Same Identity #6656
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
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bfba18f
[New Rule] AWS EKS Access Entry Created Then Deleted by Same Identity
bryans3c f54a7bc
Potential fix for pull request finding
bryans3c df762b0
Potential fix for pull request finding
bryans3c d084475
Apply suggestions from code review
bryans3c 2366c5b
Update persistence_eks_access_entry_granted_then_deleted.toml
bryans3c 14d8e10
Enhance EKS access entry documentation with false positive analysis
bryans3c 55e6bc6
Merge branch 'main' into new-rule/aws-eks-access-entry-created-deleted
bryans3c 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
112 changes: 112 additions & 0 deletions
112
rules/integrations/aws/persistence_eks_access_entry_granted_then_deleted.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,112 @@ | ||
| [metadata] | ||
| creation_date = "2026/08/14" | ||
| integration = ["aws"] | ||
| maturity = "production" | ||
| updated_date = "2026/08/14" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| Detects the creation of an Amazon EKS access entry followed by its deletion by the same | ||
| identity within a short time window. EKS access entries define Kubernetes RBAC-level | ||
| permissions for IAM principals in an EKS cluster. An adversary with EKS administrative | ||
| access may temporarily grant themselves cluster access, use those permissions to create | ||
| Kubernetes RBAC resources (ClusterRoleBindings, ServiceAccounts with privileged roles), | ||
| and then delete the access entry to hide the evidence of the initial grant while retaining | ||
| access through the Kubernetes-level backdoor. | ||
| """ | ||
| false_positives = [ | ||
| """ | ||
| Automated infrastructure tests that create and immediately tear down EKS access entries | ||
| as part of CI/CD validation may trigger this rule. Validate that the sequence corresponds | ||
| to a documented test pipeline. | ||
| """, | ||
| ] | ||
| from = "now-6m" | ||
| index = ["logs-aws.cloudtrail-*"] | ||
| interval = "5m" | ||
|
bryans3c marked this conversation as resolved.
Outdated
|
||
| language = "eql" | ||
| license = "Elastic License v2" | ||
| name = "AWS EKS Access Entry Created Then Deleted by Same Identity" | ||
| note = """## Triage and analysis | ||
|
|
||
| ### Investigating AWS EKS Access Entry Created Then Deleted by Same Identity | ||
|
|
||
| EKS access entries (introduced in EKS API mode) map IAM principals to Kubernetes access policies or allow associating Kubernetes groups to IAM principals. An adversary who obtains `eks:CreateAccessEntry` and `eks:DeleteAccessEntry` permissions can: | ||
|
|
||
| 1. Create an access entry for their own IAM principal with cluster-admin level access. | ||
| 2. Use that access to create persistent Kubernetes RBAC resources (ClusterRoleBindings, privileged ServiceAccounts, rogue DaemonSets). | ||
| 3. Delete the access entry, removing the CloudTrail evidence of the initial grant while retaining Kubernetes-level access. | ||
|
|
||
| This sequence is analogous to adding a backdoor user, using it, then deleting it to cover tracks. The deletion within a short window of creation is the key behavioral indicator. | ||
|
|
||
|
bryans3c marked this conversation as resolved.
|
||
| ### Possible investigation steps | ||
|
|
||
| - Identify the calling identity from `aws.cloudtrail.user_identity.arn` and the targeted cluster from `aws.cloudtrail.request_parameters`. | ||
| - Review Kubernetes audit logs for the affected cluster in the time window between the `CreateAccessEntry` and `DeleteAccessEntry` events. Look for `create` verbs on ClusterRoleBindings, RoleBindings, ServiceAccounts, or DaemonSets. | ||
| - Check the cluster's current RBAC configuration for persistent backdoor resources. | ||
| - Determine whether the identity had a legitimate reason to create an access entry for the targeted cluster. | ||
|
|
||
| ### Response and remediation | ||
|
|
||
| - Audit all Kubernetes RBAC resources for unauthorized ClusterRoleBindings or privileged ServiceAccounts created in the suspect window. | ||
| - Rotate credentials for the calling identity. | ||
| - Apply IAM policies restricting `eks:CreateAccessEntry` and `eks:DeleteAccessEntry` to designated EKS administrative roles. | ||
| """ | ||
| references = [ | ||
| "https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateAccessEntry.html", | ||
| "https://docs.aws.amazon.com/eks/latest/APIReference/API_DeleteAccessEntry.html", | ||
| "https://www.wiz.io/blog/new-attack-vectors-emerge-via-recent-eks-access-entries-and-pod-identity-features", | ||
| "https://securitylabs.datadoghq.com/articles/eks-cluster-access-management-deep-dive/", | ||
| ] | ||
| risk_score = 73 | ||
|
bryans3c marked this conversation as resolved.
Outdated
|
||
| rule_id = "2b60fb61-d0c7-405e-9f33-a66d8729628d" | ||
| setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. EKS management events are logged by default." | ||
| severity = "high" | ||
|
bryans3c marked this conversation as resolved.
Outdated
|
||
| tags = [ | ||
| "Domain: Cloud", | ||
|
bryans3c marked this conversation as resolved.
|
||
| "Platform: AWS", | ||
|
bryans3c marked this conversation as resolved.
|
||
| "Data Source: AWS CloudTrail", | ||
| "Service: AWS EKS", | ||
| "Rule Type: Event Correlation (EQL)", | ||
| "Tactic: Persistence", | ||
| "Resources: Investigation Guide", | ||
| ] | ||
|
Comment on lines
+73
to
+83
|
||
| timestamp_override = "event.ingested" | ||
| type = "eql" | ||
|
|
||
| query = ''' | ||
| sequence by user.name with maxspan=10m | ||
|
bryans3c marked this conversation as resolved.
Outdated
bryans3c marked this conversation as resolved.
Outdated
|
||
| [any where event.provider == "eks.amazonaws.com" and event.action == "CreateAccessEntry" and event.outcome == "success"] | ||
| [any where event.provider == "eks.amazonaws.com" and event.action == "DeleteAccessEntry" and event.outcome == "success"] | ||
|
bryans3c marked this conversation as resolved.
Outdated
|
||
| ''' | ||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
| [[rule.threat.technique]] | ||
| id = "T1136" | ||
| name = "Create Account" | ||
| reference = "https://attack.mitre.org/techniques/T1136/" | ||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1136.003" | ||
| name = "Cloud Account" | ||
| reference = "https://attack.mitre.org/techniques/T1136/003/" | ||
|
Copilot marked this conversation as resolved.
Outdated
|
||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0003" | ||
| name = "Persistence" | ||
| reference = "https://attack.mitre.org/tactics/TA0003/" | ||
|
|
||
| [rule.investigation_fields] | ||
| field_names = [ | ||
| "@timestamp", | ||
| "aws.cloudtrail.user_identity.arn", | ||
| "aws.cloudtrail.user_identity.type", | ||
| "user.name", | ||
| "event.action", | ||
| "event.outcome", | ||
| "aws.cloudtrail.request_parameters", | ||
| "source.ip", | ||
| "cloud.region", | ||
| "cloud.account.id", | ||
| ] | ||
Oops, something went wrong.
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.