CKS killer.sh模拟环境设置
发表于|更新于|kubernetesCKS
|总字数:98|阅读时长:1分钟|浏览量:
预先设置环境变量, 提高效率
alias k=kubectl # kubectl 命令可以使用k代替 |
vim 设置
echo "ts=2 sw=2 et ai" >> ~/.vimrc |
设置空格, tab,为2, tab为2空格, 换行自动对齐
文章作者: Hao
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hao DevSecOps!
相关推荐

2023-01-30
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...

2023-01-31
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...

2023-01-31
CKS 模拟真题 Killer.sh | Question 9 | AppArmor Profile
Task weight: 3% Use context: kubectl config use-context workload-prod Some containers need to run more secure and restricted. There is an existing AppArmor profile located at /opt/course/9/profile for this. Install the AppArmor profile on Node cluster1-node1 . Connect using ssh cluster1-node1 . Add label security=apparmor to the Node Create a Deployment named apparmor in Namespace default with: One replica of image nginx:1.19.2 NodeSelector for security=apparmor Single container named c1...

2023-01-30
CKS 题库 11、AppArmor
ContextAPPArmor 已在 cluster 的工作节点node02上被启用。一个 APPArmor 配置文件已存在,但尚未被实施。 Task在 cluster 的工作节点node02上,实施位于 /etc/apparmor.d/nginx_apparmor 的现有APPArmor 配置文件。 编辑位于 /cks/KSSH00401/nginx-deploy.yaml 的现有清单文件以应用 AppArmor 配置文件。 最后,应用清单文件并创建其中指定的 Pod 。 请注意,考试时,考题里已表明APPArmor在工作节点上,所以你需要ssh到开头写的工作节点上。 在模拟环境,你需要ssh到node02这个工作节点。 参考https://kubernetes.io/zh/docs/tutorials/security/apparmor/#example 解答切换集群 kubectl config use-context KSSH00401 连接到 node02 并切换到 root ssh node02sudo -i 切换到 apparmor 目录,...

2023-01-30
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...

2023-02-01
CKS 模拟真题 Killer.sh | Question 13 | Restrict access to Metadata Server
Task weight: 7% Use context: kubectl config use-context infra-prod There is a metadata service available at http://192.168.100.21:32000 on which Nodes can reach sensitive data, like cloud credentials for initialisation. By default, all Pods in the cluster also have access to this endpoint. The DevSecOps team has asked you to restrict access to this metadata server. In Namespace metadata-access : Create a NetworkPolicy named metadata-deny which prevents egress to 192.168.100.21 for all Pods...
评论
公告
站点进行了迁移, 如需帮助, 请发邮件到 admin@hao.kim


