T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/cluster_connect.sh:12- Finding
Account-Wide Cluster Enumeration and Bulk Kubeconfig Acquisition
- Content
View full analysis
&1; then : else echo "[FAIL] Failed to fetch cluster list" echo "$response" | head -5 exit 1 fi CLUSTER_DATA=$(echo "$response" | python3 -c " import sys, json data = json.load(sys.stdin) clusters = data if isinstance(data, list) else data.get('clusters', []) running = [c for c in clusters if c.get('state') == 'running'] if not running: print('No running clusters found', file=sys.stderr) sys.exit(1) print(f'Found {len(running)} running cluster(s):') for c in running: cid = c.get('cluster_id', 'N/A') name = c.get('name', 'N/A') region = c.get('region_id', 'N/A') version = c.get('current_version', 'N/A') print(f' {cid} {name} {region} {version}') print('---CLUSTER_IDS---') for c in running: print(f\"{c['cluster_id']}|{c.get('name','N/A')}|{c.get('region_id','N/A')}\") " 2>&1) } ``` ```bash while IFS='|' read -r cluster_id cluster_name cluster_region; do local kubeconfig_file="${KUBE_DIR}/${KUBECONFIG_PREFIX}${c ...[truncated 2997 chars]- Remediation
View remediation
