Ship an opt-in AppArmor profile in the official Debian package
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start by locating the Debian package files and the existing systemd unit, then check how package installation and upgrades handle files under /etc. Validate whether the proposed AppArmor profile and systemd drop-in preserve default behavior with and without AppArmor. Done means the opt-in profile is shipped in the official .deb and the suggested install, upgrade, and runtime checks pass for its stated userspace proxy scope.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Proposal
Would the project ship a named AppArmor profile under /etc/apparmor.d/ in the official .deb, alongside the existing systemd unit? This would let profile updates travel with package updates. A named profile without an executable attachment can be loaded without changing how existing services and CLI invocations run. Document the drop-in below as the explicit opt-in, and preserve the service's default behavior on upgrades and on hosts without AppArmor.
The packaged service starts /usr/bin/sing-box with configuration under /etc/sing-box and state under /var/lib/sing-box. These paths provide a useful starting point for a policy that reads configuration and permits writes to application state.
Example for a basic userspace proxy
Example contents for a package-managed /etc/apparmor.d/local-sing-box on a host with AppArmor 4.0 policy support.
abi <abi/4.0>,
include <tunables/global>
profile local-sing-box {
include <abstractions/base>
include <abstractions/nameservice>
include <abstractions/openssl>
/usr/bin/sing-box mr,
/etc/sing-box/ r,
/etc/sing-box/config.json r,
owner /var/lib/sing-box/ rw,
owner /var/lib/sing-box/** rwk,
@{PROC}/sys/net/core/somaxconn r,
owner @{PROC}/[0-9]*/{cgroup,mountinfo} r,
/sys/fs/cgroup/system.slice/sing-box.service/cpu.max r,
network inet stream,
network inet dgram,
network inet6 stream,
network inet6 dgram,
network netlink raw,
}
Bind the loaded profile via /etc/systemd/system/sing-box.service.d/20-apparmor.conf.
[Unit]
Wants=apparmor.service
After=apparmor.service
[Service]
AppArmorProfile=local-sing-box
This is adapted from our policy for a userspace deployment. It assumes one configuration file and service-owned state. TUN, transparent proxying, process-based routing, external certificates, extra configuration files and packaged ExecReload need separate validation before claiming support.
Test package installation and upgrades with and without the drop-in. Suggested runtime checks include parsing and loading the profile before restarting, checking the live process label, exercising TCP/UDP traffic and DNS, verifying any configured cache survives a restart, and checking the kernel audit log. If reload is supported by the example, test the packaged SIGHUP path as well.
- Lingua principale
- Go
- Stelle
- 40.4k
- Fork
- 5k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SagerNet/sing-box
-
`check` and startup are quadratic in outbound group size since 1.14.4 (duplicate tag check)Forse già presa @Tidehyc l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
database file removal errorsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
Tutte le issue di SagerNet/sing-box
Issue simili
-
good first issue tools
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Edwin-metcalf/MetCode#76 ·
I maintainer di solito rispondono entro 1 giorno
-
-diff's removed-name budget ignores the names the -ptr pass testedForse già presa @nova-loop l’ha presa oggi. Apertaarea: cli bug good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TMHSDigital/subenum#495 ·
I maintainer di solito rispondono entro 1 giorno
-
bug effort:s impact:med raised-by:worker risk:low to:worker
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
medici-finance/assay#8120 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
factory:subtask
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
reportedBy/community
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openchoreo/openchoreo#5751 ·
I maintainer di solito rispondono entro 1 giorno