You may have configured the kubeconfig.json file on a node in your cluster. kubectl can use the certificate and private key in this file to control the entire cluster. You are advised to delete unnecessary files from the /root/.kube directory on the node to prevent malicious use.
rm -rf /root/.kube
CCE is a universal container platform. Its default security group rules apply to common scenarios. Based on security requirements, you can harden the security group rules set for CCE clusters on the Security Groups page of Network Console.
CCE cluster nodes use the default settings of open source OSs. After a node is created, you need to perform security hardening according to your service requirements.
In CCE, you can perform hardening as follows:
If a single CCE cluster is shared by multiple users to deploy containers, containers cannot access the management address (169.254.169.254) of OpenStack, preventing containers from obtaining metadata of host machines.
For details about how to restore the metadata, see the "Notes" section in Obtaining Metadata.
This solution may affect the password change on the ECS console. Therefore, you must verify the solution before rectifying the fault.
On the Clusters page of the CCE console, view the network model and container CIDR of the cluster.
iptables -I OUTPUT -s {container_cidr} -d 169.254.169.254 -j REJECT
{container_cidr} indicates the container CIDR of the cluster, for example, 10.0.0.0/16.
To ensure configuration persistence, write the command to the /etc/rc.local script.
curl 169.254.169.254/openstack/latest/meta_data.json curl 169.254.169.254/openstack/latest/user_data
iptables -I FORWARD -s {container_cidr} -d 169.254.169.254 -j REJECT
{container_cidr} indicates the container CIDR of the cluster, for example, 10.0.0.0/16.
To ensure configuration persistence, write the command to the /etc/rc.local script.
curl 169.254.169.254/openstack/latest/meta_data.json curl 169.254.169.254/openstack/latest/user_data