AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 757888
Accepted
seanlano
seanlano
Asked: 2016-04-16 17:59:40 +0800 CST2016-04-16 17:59:40 +0800 CST 2016-04-16 17:59:40 +0800 CST

AppArmor:异常拒绝“name=<string>”消息

  • 772

我有一个自定义 AppArmor 配置文件来限制 Syncthing。(我意识到这可能不是一个特定的 Ubuntu 问题,但我只使用 Ubuntu,所以我没有看到这是否会影响其他 Linux 发行版)。

这是个人资料:

#include <tunables/global>

/usr/bin/syncthing {
  #include <abstractions/base>

  # Obviously needs Internet access to work.
  network raw,
  network inet,
  network inet6,

 # Access to execute binary
  /usr/bin/syncthing cx,

  # Wants read access to SOMAXCONN
  /proc/sys/net/core/somaxconn r,

  # Needs to be able to read these to work properly
  /run/resolvconf/resolv.conf r,
  /etc/hosts r,
  /etc/host.conf r,
  /etc/nsswitch.conf r,
  /etc/ssl/certs/** r,
  /etc/mime.types r,
  /etc/gai.conf r,

  # Allow access to synced folders.
  owner @{HOME}/Documents/ rw,
  owner @{HOME}/Documents/** rwk,
  owner @{HOME}/Pictures/ rw,
  owner @{HOME}/Pictures/** rwk,
  owner @{HOME}/Public/ rw,
  owner @{HOME}/Public/** rwk,
  owner @{HOME}/Music/ rw,
  owner @{HOME}/Music/** rwk,
  owner @{HOME}/Downloads/ rw,
  owner @{HOME}/Downloads/** rwk,
  owner @{HOME}/.keys/ rw,
  owner @{HOME}/.keys/** rwk,

  # Allow access to config files
  owner @{HOME}/.config/syncthing/ rw,
  owner @{HOME}/.config/syncthing/** rwk,

  # Silence warnings on things we don't want access to
  deny / r,
  deny /* r,
  deny @{HOME} r,

}

这是我最近收到的系统日志消息:

Apr 16 11:07:05 supercomputer kernel: [ 1240.879568] audit: type=1400 audit(1460768825.434:31): apparmor="DENIED" operation="open" profile="/usr/bin/syncthing" name=2F686F6D652F7365616E2F566964656F732F43616D65726120566964656F732F pid=2277 comm="syncthing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Apr 16 11:16:28 supercomputer kernel: [ 1803.632950] audit: type=1400 audit(1460769388.508:32): apparmor="DENIED" operation="open" profile="/usr/bin/syncthing" name=2F686F6D652F7365616E2F566964656F732F43616D65726120566964656F732F pid=2266 comm="syncthing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Apr 16 11:26:13 supercomputer kernel: [ 2388.037482] audit: type=1400 audit(1460769973.246:33): apparmor="DENIED" operation="open" profile="/usr/bin/syncthing" name=2F686F6D652F7365616E2F566964656F732F43616D65726120566964656F732F pid=1021 comm="syncthing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Apr 16 11:36:56 supercomputer kernel: [ 3031.177125] audit: type=1400 audit(1460770616.751:34): apparmor="DENIED" operation="open" profile="/usr/bin/syncthing" name=2F686F6D652F7365616E2F566964656F732F43616D65726120566964656F732F pid=2273 comm="syncthing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

自从我自己制作了配置文件后,我对 AppArmor 及其产生的日志已经比较熟悉了——但我以前从未见过这条name=2F686F6D652F7365616E2F566964656F732F43616D65726120566964656F732F消息。它看起来不像是 AppArmor 通常报告的文件路径。

这个错误信息是什么意思?我如何在个人资料中允许或拒绝它?

permissions
  • 1 1 个回答
  • 370 Views

1 个回答

  • Voted
  1. Best Answer
    bchurchill
    2016-05-04T23:32:51+08:002016-05-04T23:32:51+08:00

    “name=”后面的十六进制字符串只是您要查找的文件路径的十六进制编码字符串。如果您将十六进制字符串复制到“十六进制”框(或许多等效站点)中的http://www.asciitohex.com/中,然后单击转换以获取原始字符串。为了保护您的隐私,我不会在此处发布确切的字符串——以防万一。

    如果您不想使用第三方网站,可以运行 python shell 并执行以下操作:

    x="2F.... (your string here)"
    ''.join(chr(int(x[i:i+2], 16)) for i in range(0, len(x), 2))
    

    我也在 Debian 上遇到过这个问题。我不知道为什么会这样。

    • 2

相关问题

  • 访问启用的虚拟主机时出现 403 禁止错误

  • WINE 用户配置

  • 无法更新雷鸟

  • Ubuntu 在什么许可证下?可以合法修改和分发吗?

  • 文件权限如何工作?文件权限用户和组

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve