杂文(9):Ubuntu16.04下的AppArmor中,aa-complain 或 aa-enforce 提示profile for #{profile_name} not found 的问题

最后更新于2021年3月4日15:10:42
今天遇到一个问题:在ubuntu上安装snap.XXXX.run格式的程序后,修改enforce mode到complain mode不成功。

[Resolved] Can’t put Apparmor profiles in enforce mode
根据这里面HuangLao的回答:AppArmor profiles should live in /etc/apparmor.d/.

Amazon-ssm-agent AppArmor profile not allowing “enforce” mode
还有这个里面jdstrand的回答:
As for ‘aa-enforce’, snapd manages its own policy in /var/lib/snapd/apparmor/profiles (with its cache in /var/cache/apparmor) and system policy tools like ‘aa-enforce’ aren’t meant to operate on them (and thus do not support this location). Even if aa-enforce could update the file, snapd ensures that the profiles in /var/lib/snapd/apparmor/profiles contain what it expects, and snapd would revert the change at some point.
snap安装程序后把自己的配置文件放在 /var/lib/snapd/apparmor/profiles 下面,但是apparmor_utils这种系统策略工具只能检测到apparmor.d下的文件。

最后解决方式:把snap目录下相关安装文件放到/etc/apparmor.d/中,执行aa-complain修改后再覆盖回去。其实本质上是修改了snap.XXXXX.run配置文件的内容。
参考:解决ubuntu环境下报apparmor=“DENIED“ operation=“exec“之类的错误

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值