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

2023-02-01
CKS 模拟真题 Killer.sh | Preview Question 1
Use context: kubectl config use-context infra-prod You have admin access to cluster2. There is also context gianna@infra-prod which authenticates as user gianna with the same cluster. There are existing cluster-level RBAC resources in place to, among other things, ensure that user gianna can never read Secret contents cluster-wide. Confirm this is correct or restrict the existing RBAC resources to ensure this. I addition, create more RBAC resources to allow user gianna to create Pods and Depl...

2023-01-29
CKS 题库 4、RBAC - RoleBinding
Context绑定到 Pod 的 ServiceAccount 的 Role 授予过度宽松的权限。完成以下项目以减少权限集。 Task一个名为 web-pod 的现有 Pod 已在 namespace db 中运行。 编辑绑定到 Pod 的 ServiceAccount service-account-web 的现有 Role,仅允许只对 services 类型的资源执行 get 操作。 在 namespace db 中创建一个名为 role-2 ,并仅允许只对 namespaces 类型的资源执行 delete 操作的新 Role。 创建一个名为 role-2-binding 的新 RoleBinding,将新创建的 Role 绑定到 Pod 的 ServiceAccount。 注意:请勿删除现有的 RoleBinding。 参考https://kubernetes.io/zh/docs/reference/access-authn-authz/rbac/#role-and-clusterole https://kubernetes.io/zh-cn/docs/ref...

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 来测试配置是否有效。 参考https://kubernetes.io/zh/docs/reference/access-authn-authz/admission-controllers/#如何启用一个准入控制器 https://ku...

2023-02-01
CKS 模拟真题 Killer.sh | Question 20 | Update Kubernetes 升级k8s集群
Task weight: 8% Use context: kubectl config use-context workload-stage The cluster is running Kubernetes 1.25.5 , update it to 1.26.0 . Use apt package manager and kubeadm for this. Use ssh cluster3-controlplane1 and ssh cluster3-node1 to connect to the instances. 译文任务权重:8%。 使用环境: kubectl config use-context workload-stage 该集群正在运行Kubernetes 1.25.5 ,请将其更新为 1.26.0 。 为此使用 apt 软件包管理器和 kubeadm 。 使用 ssh cluster3-controlplane1 和 ssh cluster3-node1 来连接到实例。 解答检查版本 kubectl get node 首先 需要更新控制平面节...

2023-01-29
CKS 题库 3、默认网络策略
Context一个默认拒绝(default-deny)的NetworkPolicy可避免在未定义任何其他NetworkPolicy的namespace中意外公开Pod。 Task为所有类型为 Ingress+Egress 的流量在 namespace testing 中创建一个名为 denypolicy 的新默认拒绝 NetworkPolicy 。 此新的 NetworkPolicy 必须拒绝 namespace testing 中的所有的 Ingress + Egress 流量。 将新创建的默认拒绝 NetworkPolicy 应用在 namespace testing 中运行的所有 Pod 。 你可以在 /cks/net/p1.yaml 找到一个模板清单文件。 参考https://kubernetes.io/zh-cn/docs/concepts/services-networking/network-policies/#默认拒绝所有入口和所有出站流量 解答切换集群 kubectl config use-context KSCS00101 编辑模板文件 /...
评论
公告
站点进行了迁移, 如需帮助, 请发邮件到 [email protected]


