Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion AWS/aws_cspm_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,10 @@ class AWSHandle:
"alpha.eksctl.io/nodegroup-type",
"aws:eks:cluster-name",
"eks:nodegroup-name",
# Karpenter-launched nodes carry these instead of the nodegroup tags above
"eks:eks-cluster-name",
"karpenter.sh/nodepool",
"karpenter.sh/provisioner-name",
]

def __init__(
Expand Down Expand Up @@ -855,7 +859,9 @@ def is_vm_kubenode(cls, vm):

@classmethod
def is_vm_running(cls, vm):
return vm["State"]["Name"] != "stopped"
# DescribeInstances keeps terminated instances visible for up to ~1 hour,
# so anything not actively pending/running must not count as running.
return vm["State"]["Name"] in ("pending", "running")

@property
def account_id(self):
Expand Down