CKS 模拟真题 Killer.sh | Question 6 | Verify Platform Binaries
Task weight: 2% (can be solved in any kubectl context) There are four Kubernetes server binaries located at /opt/course/6/binaries . You’re provided with the following verified sha512 values for these: kube-apiserver f417c0555bc0167355589dd1afe23be9bf909bf98312b1025f12015d1b58a1c62c9908c0067a7764fa35efdac7016a9efa8711a44425dd6692906a7c283f032c kube-controller-manager 60100cc725e91fe1a949e1b2d0474237844b5862556e25c2c655a33boa8225855ec5ee22fa4927e6c46a60d43a7c4403a27268f96fbb726307d1608b44f38a...
CKS 模拟真题 Killer.sh | Question 5 | CIS Benchmark
Task weight: 3% Use context: kubectl config use-context infra-prod You’re ask to evaluate specific settings of cluster2 against the CIS Benchmark recommendations. Use the tool kube-bench which is already installed on the nodes. Connect using ssh cluster2-controlplane1 and ssh cluster2-node1 . On the master node ensure (correct if necessary) that the CIS recommendations are set for: The --profiling argument of the kube-controller-manager The ownership of directory /var/lib/etcd On the worke...
CKS 模拟真题 Killer.sh | Question 4 | Pod Security Standard
Task weight: 8% Use context: kubectl config use-context workload-prod There is Deployment container-host-hacker in Namespace team-red which mounts /run/containerd as a hostPath volume on the Node where it’s running. This means that the Pod can access various data about other containers running on the same Node. To prevent this configure Namespace team-red to enforce the baseline Pod Security Standard. Once completed, delete the Pod of the Deployment mentioned above. Check the Replic...
CKS 模拟真题 Killer.sh | Question 3 | Apiserver Security
Task weight: 3% Use context: kubectl config use-context workload-prod You received a list from the DevSecOps team which performed a security investigation of the k8s cluster1 ( workload-prod ). The list states the following about the apiserver setup: Accessible through a NodePort Service Change the apiserver setup so that: Only accessible through a ClusterIP Service 译文任务重量:3%。 使用环境: kubectl config use-context workload-prod 你收到一份来自DevSecOps团队的清单,该团队对k8s cluster1( workload-prod )进行了安全调查。该清...
CKS 模拟真题 Killer.sh | Question 2 | Runtime Security with Falco
Task weight: 4% Use context: kubectl config use-context workload-prod Falco is installed with default configuration on node cluster1-node1 . Connect using ssh cluster1-node1 . Use it to: Find a Pod running image nginx which creates unwanted package management processes inside its container. Find a Pod running image httpd which modifies /etc/passwd . Save the Falco logs for case 1 under /opt/course/2/falco.log in format: time-with-nanosconds,container-id,container-name,user-name No other i...
CKS 模拟真题 Killer.sh | Question 1 | Contexts
Task weight: 1% You have access to multiple clusters from your main terminal through kubectl contexts. Write all context names into /opt/course/1/contexts , one per line. From the kubeconfig extract the certificate of user restricted@infra-prod and write it decoded to /opt/course/1/cert . 译文任务权重:1 你可以通过终端使用 kubectl 访问多个集群。把所有的上下文名称每行一个写进 /opt/course/1/contexts 从 kubeconfig 中提取用户 restricted@infra-prod 的证书,并将其解码后写入 /opt/course/1/cert 。 解答把所有集群名字写入文件 k config get-contextsk config get-context...
CKS killer.sh模拟环境设置
预先设置环境变量, 提高效率 alias k=kubectl # kubectl 命令可以使用k代替export do="--dry-run=client -o yaml" # 导出yaml文件 可以用$do , 如 k create deploy nginx --image=nginx $doexport now="--force --grace-period 0" # 强制 如: k delete pod x $now vim 设置 echo "ts=2 sw=2 et ai" >> ~/.vimrcsource ~/.vimrc 设置空格, tab,为2, tab为2空格, 换行自动对齐
CKS 题库 16、ImagePolicyWebhook容器镜像扫描
Contextcluster 上设置了容器镜像扫描器,但尚未完全集成到 cluster 的配置中。 完成后,容器镜像扫描器应扫描并拒绝易受攻击的镜像的使用。 Task注意:你必须在 cluster 的 master 节点上完成整个考题,所有服务和文件都已被准备好并放置在该节点上。 给定一个目录 /etc/kubernetes/epconfig 中不完整的配置, 以及具有 HTTPS 端点 https://image-bouncer-webhook.default.svc:1323/image_policy 的功能性容器镜像扫描器: 启用必要的插件来创建镜像策略 校验控制配置并将其更改为隐式拒绝(implicit deny) 编辑配置以正确指向提供的 HTTPS 端点 最后,通过尝试部署易受攻击的资源 /cks/img/web1.yaml 来测试配置是否有效。 参考https://kubernetes.io/zh/docs/reference/access-authn-authz/admission-controllers/#如何启用一个准入控制器 https://ku...
CKS 题库 15、TLS安全配置
Task通过TLS加强kube-apiserver安全配置,要求 kube-apiserver除了 TLS 1.3 及以上的版本可以使用,其他版本都不允许使用。 密码套件(Cipher suite)为 TLS_AES_128_GCM_SHA256 通过TLS加强ETCD安全配置,要求 密码套件(Cipher suite)为 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 参考https://kubernetes.io/zh-cn/docs/reference/command-line-tools-reference/kube-apiserver/ 解答切换集群 kubectl config user-context KSRS00501 远程到 master 并切换到 root ssh master01sudo -i 修改 kube-apiserver, 养成 修改之前备份文件的好习惯 mkdir bakyamlcp /etc/kubernetes/manifests/kube-apiserver.yaml bakyam...
CKS 题库 14、启用API server认证
Context由 kubeadm 创建的 cluster 的 Kubernetes API 服务器,出于测试目的, 临时配置允许未经身份验证和未经授权的访问,授予匿名用户 cluster-admin 的访问权限. Task重新配置 cluster 的 Kubernetes APl 服务器,以确保只允许经过身份验证和授权的 REST 请求。 使用授权模式 Node , RBAC 和准入控制器 NodeRestriction 。 删除用户 system:anonymous 的 ClusterRoleBinding 来进行清理。 注意:所有 kubectl 配置环境/文件也被配置使用未经身份验证和未经授权的访问。 你不必更改它,但请注意,一旦完成 cluster 的安全加固, kubectl 的配置将无法工作。 您可以使用位于 cluster 的 master 节点上,cluster 原本的 kubectl 配置文件 /etc/kubernetes/admin.conf ,以确保经过身份验证的授权的请求仍然被允许。 模拟环境里,初始化这道题的脚本为b.sh 参考h...


