【CKS最新模拟真题】手动静态安全分析Dockerfile和yaml文件


参考地址

配置最佳实践 https://kubernetes.io/zh-cn/docs/concepts/configuration/overview/

一、TASK

Solve this question on: ssh cks8930

The Release Engineering Team has shared some YAML manifests and Dockerfiles with you to review. The files are located under /opt/course/22/files.

As a container security expert, you are asked to perform a manual static analysis and find out possible security issues with respect to unwanted credential exposure. Running processes as root is of no concern in this task.

Write the filenames which have issues into /opt/course/22/security-issues on cks8930.

中译
在以下位置解决此问题:ssh cks8930
发布工程团队已与您共享了一些 YAML 清单和 Dockerfile 供您查看。这些文件位于。/opt/course/22/files 下

1、作为容器安全专家,您需要执行手动静态分析,并找出与不需要的凭证泄露有关的可能安全问题。在此任务中,以 root 身份运行进程无关紧要。
将有问题的文件名写入cks8930节点的 /opt/course/22/security-issues上

二、问题解决过程

1.问题一解题

过程如下(示例):

#按要求连接对应的集群
candidate@terminal:~$ ssh cks8930

#切换到root用户下,防止普通用户操作写入文件没权限
candidate@cks8930:~$  sudo -i

#检查位置 /opt/course/22/files并列出文件
root@cks8930:~# ls -la /opt/course/22/files
-rw-r--r-- 1 candidate candidate 384 Sep  8 14:05 Dockerfile-go
-rw-r--r-- 1 candidate candidate 441 Sep  8 14:05 Dockerfile-mysql
-rw-r--r-- 1 candidate candidate 390 Sep  8 14:05 Dockerfile-py
-rw-r--r-- 1 candidate candidate 341 Sep  8 14:05 deployment-nginx.yaml
-rw-r--r-- 1 candidate candidate 723 Sep  8 14:05 deployment-redis.yaml
-rw-r--r-- 1 candidate candidate 529 Sep  8 14:05 pod-nginx.yaml
-rw-r--r-- 1 candidate candidate 228 Sep  8 14:05 pv-manual.yaml
-rw-r--r-- 1 candidate candidate 188 Sep  8 14:05 pvc-manual.yaml
-rw-r--r-- 1 candidate candidate 211 Sep  8 14:05 sc-local.yaml
-rw-r--r-- 1 candidate candidate 902 Sep  8 14:05 statefulset-nginx.yaml

#不符合安全的文件
root@cks8930:~#@cks8930:~# cat /opt/course/22/security-issues
Dockerfile-mysql                 ----->secret-token会在镜像分层中存在
deployment-redis.yaml            ----->pod运行后会打印出账密信息
statefulset-nginx.yaml           ----->密码暴露在yaml文件中
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值