Back to skill

Security audit

Eks Workload Best Practice Assessment

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly performs a disclosed EKS workload assessment, but its documentation also steers users toward persistent cluster-admin access and cluster authentication changes that exceed the stated read-oriented assessment need.

Review this skill before installing. Use it only with an explicitly chosen cluster, region, and namespace/workload scope, and avoid following the README's cluster-admin access example as a default. Prefer a dedicated short-lived read-only or least-privilege assessment identity, and treat generated report files as sensitive security artifacts.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
README.md:51
Finding

Documentation Encourages Unnecessary Cluster-Wide Administrative Access

Content
View full analysis

Vulnerability Details

File Location: README.md, lines 51–88
Vulnerability Type: Excessive privilege provisioning and access-control expansion
Risk Level: High

Vulnerable Code

bash
aws eks update-cluster-config \
  --name <cluster-name> \
  --access-config authenticationMode=API_AND_CONFIG_MAP
bash
aws eks create-access-entry \
  --cluster-name <cluster-name> \
  --principal-arn arn:aws:iam::<account-id>:role/<ec2-role-name> \
  --type STANDARD

aws eks associate-access-policy \
  --cluster-name <cluster-name> \
  --principal-arn arn:aws:iam::<account-id>:role/<ec2-role-name> \
  --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy \
  --access-scope type=cluster

The same instructions are duplicated in README_CN.md, lines 48–84.

Technical Analysis

The skill describes a workload assessment based mainly on read-only kubectl, EKS, ECR, and CloudWatch queries. Its documented operations do not require cluster-wide administrative authority.

The prerequisite instructions nevertheless tell users to:

  1. Change the cluster authentication mode to API_AND_CONFIG_MAP.
  2. Create an EKS Access Entry for an EC2 instance role.
  3. associate AmazonEKSClusterAdminPolicy with that role at cluster scope.

Changing the authentication mode modifies the cluster's security configuration and enables an additional access-management mechanism. Assigning AmazonEKSClusterAdminPolicy at cluster scope gives the selected principal broad administrative control over the EKS cluster. This violates least privilege because the permissions materially exceed those needed to enumerate and assess workloads.

The documentation states that users should adjust the policy and that a more restrictive policy is preferable in production. However, the directly copyable example still provisions cluster administrator access, making the insecure option the default path.

Attack Path

  1. An operator follows the documented prerequ ...[truncated 1662 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove authentication-mode mutation and administrator provisioning from the assessment prerequisites. Present them only as exceptional troubleshooting procedures, clearly separated from the normal workflow.
  2. Require an existing dedicated assessment identity with read-only permissions.
  3. Provide a least-privilege EKS Access Entry example instead of AmazonEKSClusterAdminPolicy.
  4. Prefer namespace-scoped access when the assessment targets specific namespaces. Avoid --access-scope type=cluster unless the user explicitly requests a full-cluster assessment and cluster-level reads are essential.
  5. Define Kubernetes RBAC that grants only the required get, list, and, where necessary, watch verbs for the resource types enumerated by the assessment.
  6. Define a limited AWS IAM policy for required read operations, such as relevant eks:Describe*, eks:List*, ecr:Describe*, ecr:GetLifecyclePolicy, and necessary CloudWatch read actions.
  7. Do not grant write operations such as eks:UpdateClusterConfig, eks:CreateAccessEntry, or eks:AssociateAccessPolicy to the routine assessment identity.
  8. Require explicit user confirmation and a security-impact warning before any cluster authentication configuration is changed.
  9. Apply short-lived credentials, audit logging, and periodic review to any assessment Access Entry. Remove temporary entries immediately after use.
  10. Update the duplicate instructions in README_CN.md, lines 48–84, so that the insecure administrative example is not retained in translated documentation.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 109)May include surrounding context.

md
`references/check-dimensions.md` to ensure no critical dimension is missed.

Privileged Kubernetes Workload

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Code deploys a privileged Kubernetes workload (privileged container, hostPath mount, or host namespaces). This grants root on the node and is a node/cluster takeover vector.

Content

Scanner excerpt · references/check-dimensions.md (reported line 46)May include surrounding context.

md
| SEC-01-hi | **Pod Security Admission enforced** | Namespaces should have PSA labels (`pod-security.kubernetes.io/enforce`) set to at least `baseline`, ideally `restricted`. | High | [K8s >= 1.25] |
| SEC-02-hi | **PodSecurityPolicy configured** | Clusters must have PSP configured to prevent privileged containers. | High | [DEPRECATED in 1.25, removed in 1.25+] |
| SEC-03-hi | **runAsNonRoot enforced** | All containers should set `securityContext.runAsNonRoot: true`. Running as root inside containers is a privilege escalation risk. | High | |
| SEC-04-hi | **No privileged containers** | No container should set `securityContext.privileged: true` unless absolutely necessary (and documented). | High | |
| SEC-05-hi | **allowPrivilegeEscalation disabled** | Set `securityContext.allowPrivilegeEscalation: false` for all containers. | High | |
| SEC-06-md | **Drop ALL capabilities** | Set `securityContext.capabilities.drop: ["ALL"]` and only add back specific capabilities needed. | Medium | |
| SEC-07-md | **Read-only root filesystem** | Set `securityContext.readOnlyRootFilesystem: true` where possible. Use `emptyDir` for writable paths. | Medium | |

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README says this skill is for workload-level assessment, but it instructs users to change cluster authentication mode and grant an EC2 role cluster-admin access. Those are privileged infrastructure changes outside the stated scope, and they could unnecessarily expand access or alter the cluster security model if followed blindly. In a security assessment skill, embedding admin-enablement steps materially increases the chance of privilege escalation and misuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

触发短语包含“检查 K8s 最佳实践”“评估 Pod 安全配置”等较宽泛表达,容易与普通咨询或低风险问答场景重叠,导致技能在用户并未明确授权进行集群评估时被触发。由于该技能需要 kubectl 和 AWS 访问权限,误触发可能引发对集群、工作负载和配置数据的非预期读取,扩大操作与数据暴露面。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest trigger list includes "assess container workloads", which is broad and could match general advisory or troubleshooting requests rather than a specific invocation for this assessment skill. The description does not provide exclusion conditions or negative examples to narrow when this trigger should and should not activate.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest and scope boundary describe this skill as focused on workload-level checks and explicitly distinguish it from infrastructure-layer assessment. However, the workflow says infrastructure assessment is included by default via another skill and then merged into the final report, which expands behavior beyond the stated workload-only scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to write a report directly to local disk without first notifying the user or obtaining confirmation. This is dangerous because it creates a side effect outside the conversation boundary, can unexpectedly persist potentially sensitive cluster findings to local storage, and may violate user expectations or data-handling policies in environments where filesystem writes require explicit consent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The 'Important Guidelines' section states an absolute boundary: this skill handles only what requires kubectl/in-cluster access. That directly conflicts with the earlier workflow step directing invocation of the separate infrastructure-layer assessment by default and inclusion of those results in the report.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown baseline prescribes Amazon CloudWatch Container Insights as a required monitoring control, using mandatory language ('should be enabled') without indicating that this is optional, environment-specific, or limited to AWS/EKS contexts. Similar AWS-specific mandates recur throughout the file, which can violate language/locale-style policy expectations by forcing a specific platform choice without opt-in or clear justification in the file itself.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Dimension 6 is entirely EKS-specific and uses mandatory language ('should', 'must') for AWS platform features such as EKS addons, GuardDuty, IRSA, and EKS support windows, but the file title and introduction do not clearly state that the baseline only applies to AWS EKS clusters. For users outside that platform, this is a natural-language policy issue because it imposes a specific platform constraint without explicit opt-in or justification at the top level.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file instructs collection of broad cluster-wide workload, RBAC, networking, storage, and event data, including use of --all-namespaces and cluster-scoped resources, without an explicit warning that the output may contain sensitive operational metadata. In a real environment, this can expose internal topology, service names, IAM/RBAC relationships, image details, and security posture information to users who may not expect the breadth of data gathered.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documentation references FIS fault-injection requirements in a skill whose purpose is best-practice assessment, not chaos testing or experiment execution. That broadens the perceived authority and operational scope of the skill, potentially normalizing unnecessary privileged configuration changes under the guise of assessment. While not directly exploit code, it can mislead operators into enabling capabilities unrelated to the task.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README says to trigger the skill with phrases like "Check K8s best practices for my cluster" and "Evaluate pod security configuration," which are fairly general requests that could match broader conversations rather than a narrowly scoped skill invocation. The section also uses "phrases like," implying an open-ended trigger set without explicit boundaries or negative examples.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

该文件完整采用中文撰写,且未说明这是可选本地化文档、未提示语言选择方式,也未声明仅面向特定中文用户场景。按规则,若技能自然语言内容强制特定语言而无用户选择或明确合理说明,可构成语言/区域策略问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

该 markdown 说明列出了对 EKS 集群、ECR、kubectl 和 AWS CLI 的访问前置要求,表明技能会连接并检查用户云环境中的资源与配置。文档未在使用说明附近明确提醒用户该过程会读取集群/工作负载元数据与相关配置,缺少对数据访问行为的用户告知。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.