T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/huawei_cloud/cce.py:662- Finding
Complete Kubernetes kubeconfig and private key returned through standard output
- Content
View full analysis
Dict[str, Any]: """Get kubeconfig for a CCE cluster""" access_key, secret_key, proj_id = get_credentials_with_region( region, ak, sk, project_id ) if not access_key or not secret_key: return { "success": False, "error": "Credentials not provided. Set HUAWEI_AK and HUAWEI_SK environment variables or pass as parameters." } try: from huaweicloudsdkcce.v3 import ( CreateKubernetesClusterCertRequest, ClusterCertDuration, ) client = create_cce_client(region, access_key, secret_key, proj_id) cert_duration = ClusterCertDuration(duration=duration) request = CreateKubernetesClusterCertRequest(cluster_id=cluster_id) request.body = cert_duration response = client.create_kubernetes_cluster_cert(request) result = { "success": True, "region": region, "cluster_id": cluster_id, "action": "get_cce_kubeconfig", "duration_days": duration, } if hasattr(response, 'to_dict'): resp_dict = response.to_dict() # The complete kubeconfig includes embedded authentication material. result["kubeconfig"] = resp_dict if 'clusters' in resp_dict: result["cluster_endpoints"] = [] for cluster in resp_dict['clusters']: endpoint_info = { "name": cluster.get('name'), "server": cluster. ...[truncated 2552 chars]- Remediation
View remediation
