怎么做招聘网站的调研,网站定制公司排行榜,南京网站建设一条龙,个人建什么网站最赚钱吗最近准备花一周的时间准备CKS考试#xff0c;在准备考试中发现有一个题目关于AppArmor Pod操作权限的问题。 专栏其他文章: [CKS] Create/Read/Mount a Secret in K8S-CSDN博客[CKS] Audit Log Policy-CSDN博客 -[CKS] 利用falco进行容器日志捕捉和安全监控-CSDN博客[CKS] …最近准备花一周的时间准备CKS考试在准备考试中发现有一个题目关于AppArmor Pod操作权限的问题。 专栏其他文章: [CKS] Create/Read/Mount a Secret in K8S-CSDN博客[CKS] Audit Log Policy-CSDN博客 -[CKS] 利用falco进行容器日志捕捉和安全监控-CSDN博客[CKS] K8S NetworkPolicy Set Up-CSDN博客[CKS] K8S AppArmor Set Up-CSDN博客[CKS] 利用Trivy对image进行扫描-CSDN博客[CKS] kube-batch修复不安全项-CSDN博客[CKS] K8S ServiceAccount Set Up-CSDN博客[CKS] K8S Admission Set Up-CSDN博客[CKS] K8S Dockerfile和yaml文件安全检测-CSDN博客CKS真题CKA真题 What‘s the AppArmor
AppArmor是一种Linux安全模块用于限制和控制进程的访问权限。它基于访问控制列表ACLs、文件系统路径和文件的安全上下文等信息允许系统管理员定义每个进程可以访问的资源和执行的操作。AppArmor的目标是增加系统的安全性并减少被攻击者利用的风险。它可以防止恶意代码的行为限制不必要的系统调用以及保护系统和关键数据免受未经授权的访问。
Question 1
On the worker node, there is an AppArmor profile file located at /home/cloud_user/k8s-deny-write.
Enforce the profile so that it can be applied to containers. 意思是将/home/cloud_user/k8s-deny-write这个apparmor配置文件配置在k8s中
Practice
https://kubernetes.io/docs/tutorials/security/apparmor/ 在这个document中有一个详细的怎么使用apparmor通过这个教程我们知道如何应用这个配置
sudo apparmor_parser k8s-deny-writeQuestion 2
On the CLI server, there is a Pod manifest at /home/cloud_user/chewbacca.yml.
Edit the manifest so that the AppArmor profile will be applied to the Pod’s container.Create the Pod. 意思是编辑配置文件使他能够完成/home/cloud_user/chewbacca.yml这个pod的创建
Practice
在Question 1中提供的文档中https://kubernetes.io/docs/tutorials/security/apparmor/ 我们知道如何在pod中加在这个配置我们修改/home/cloud_user/chewbacca.yml文件如下
验证
使用kubectl logs chewbacca -n kashyyyk查看日志出现如下则表示成功
sh: cant create password.txt: Permission denied