contrib/apparmor: profile name goes into peer rules as a pattern
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading the default AppArmor template and the Go apparmor.WithDefaultProfile option mentioned in the issue; trace how the caller-supplied profile name reaches peer= rules. Check how AppArmor handles pattern characters and whether the name should be validated or escaped. Done means a profile name cannot broaden peer access, with a regression test covering a glob character.
由索引模型根据 Issue 内容生成。
描述
Description
The default AppArmor template puts the profile name into its peer= rules as is. AppArmor reads that value as a pattern, so a name with a glob character allows signal and ptrace to more peers than the profile itself.
CRI is not affected, it always passes the constant cri-containerd.apparmor.d. The name is caller-supplied in two places: ctr run --apparmor-default-profile <name> and any Go caller of apparmor.WithDefaultProfile.
Steps to reproduce the issue
I did not run this through ctr. The profiles below are hand-written and copy the signal rule from the template.
-
Load three profiles:
profile stktest-exact flags=(attach_disconnected) { file, capability, signal (send,receive) peer=stktest-exact, } profile stktest* flags=(attach_disconnected) { file, capability, signal (send,receive) peer=stktest*, } profile stktest-other flags=(attach_disconnected) { file, capability, signal, } -
Start a process under the third one:
aa-exec -p stktest-other -- sleep 15 -
Signal it from each of the other two:
aa-exec -p <profile> -- kill -0 <pid>
Describe the results you received and expected
| sender profile | signal to stktest-other |
|---|---|
stktest-exact |
denied |
stktest* |
allowed |
I expected both to be denied: a profile generated from the template should only reach peers that carry its own name.
What version of containerd are you using?
No containerd binary was involved. I read the template on main at 9f3f084b43b2.
Any other relevant information
Ubuntu 26.04, kernel 7.0.0-44-generic, AppArmor parser 5.0.2.
Impact is low: the default names are fixed, and an operator has to pick such a name on purpose. Still, loadData could reject names with pattern characters, or escape them. I can send a PR for either.
Show configuration if it is related to CRI plugin.
Not related to CRI.
- 主要语言
- Go
- 星标
- 21.6k
- 派生
- 4.2k
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 86
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
containerd/containerd 的其他 Issue
-
CRI attach: wiring stdin before stdout drops initial output可能已有人在做 @YiD11 于 36 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
containerd/containerd#14476 · 2 条评论 ·
维护者通常 1 天内回复
-
should it be `size-offset` in line 301 (`core/content/helpers.go`, `seekReader()`)可能已有人在做 @AdamMagued 于 34 天前认领。 未关闭kind/bug status/more-info-needed
难度 2/5 1-3 小时 新手友好度 67/100
containerd/containerd#14278 · 1 条评论 ·
维护者通常 1 天内回复
-
CRI: PullImage hangs forever when image_pull_progress_timeout = "0s" (default transfer service path)可能已有人在做 @refleeexzz 于 79 天前认领。 未关闭kind/bug
难度 2/5 1-3 小时 新手友好度 74/100
containerd/containerd#14158 · 8 条评论 ·
维护者通常 1 天内回复
-
docs: 'allows to split' grammar in containerd-config.toml man page可能已有人在做 @mrchatam 于 81 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 95/100
containerd/containerd#14154 ·
维护者通常 1 天内回复
-
`RemoveVolatileOption` cannot recognize mount type "fuse.nydus-overlayfs" from nydus-snapshotter可能重新可做 @ekalinin 于 109 天前认领,目前没有进行中的 PR。 未关闭area/snapshotters kind/feature
难度 2/5 1-3 小时 新手友好度 65/100
containerd/containerd#13573 · 1 条评论 ·
维护者通常 1 天内回复
查看 containerd/containerd 的全部 Issue
相似的 Issue
-
P3 tech debt
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
kind/feature needs-triage priority/unprioritized
难度 2/5 1-3 小时 新手友好度 75/100
NVIDIA/k8s-test-infra#1504 ·
维护者通常 1 天内回复
-
Area/Infrastructure Aspect/Infra Resources Type/Bug
难度 2/5 1-3 小时 新手友好度 78/100
wso2/agent-manager#2717 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
open-policy-agent/opa#9685 · 1 条评论 ·
维护者通常 1 天内回复