T09 · Insecure Skill Coding Practices
- Location
scripts/huawei_cloud/cce.py:662- Finding
Kubernetes Client Credentials and Kubeconfig Are Returned in Dispatcher Output
- Content
View full analysis
Dict[str, Any]: access_key, secret_key, proj_id = get_credentials_with_region( region, ak, sk, project_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() # Returns the complete kubeconfig, including embedded client # certificate and private-key data. result["kubeconfig"] = resp_dict # ... result["kubeconfig_yaml"] = yaml.dump( resp_dict, default_flow_style=False, allow_unicode=True ) return result ``` The function is registered as an externally invokable dispatcher action: ```python def _get_cce_kubeconfig(params: Dict[str, str]) -> Dict[str, Any]: return cce.get_cce_kubeconfig( params["region"], params["cluster_id"], params.get("ak"), params.get("sk"), params.get("project_id"), _to_int(params.get("duration"), 30) ) # ... "huawei_get_cce_kubeconfig": ( ("region", "cluster_id"), _get_cce_kubeconfig ), ``` The ...[truncated 2700 chars]- Remediation
View remediation
