-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from fatalbanana/apparmor
Add an example AppArmor profile
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Example AppArmor profile for Rspamd Docker container | ||
|
||
This is an example AppArmor profile for restricting the Rspamd Docker container. It might not be feature-complete: you should be prepared to deal with possible fallout by reviewing logs & making necessary changes. The profile is aimed merely at running Rspamd and doesn't support use-cases such as logging in to the container. | ||
|
||
### Usage | ||
|
||
``` | ||
sudo cp rspamd-docker.profile /etc/apparmor.d/ | ||
sudo systemctl reload apparmor | ||
docker run -v rspamd_dbdir:/var/lib/rspamd --security-opt apparmor=rspamd-docker -ti rspamd/rspamd | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <tunables/global> | ||
|
||
profile rspamd-docker { | ||
#include <abstractions/base> | ||
#include <abstractions/nameservice> | ||
#include <abstractions/openssl> | ||
#include <abstractions/ssl_certs> | ||
|
||
owner /dev/shm/* rw, | ||
/etc/magic r, | ||
/etc/magic.mime r, | ||
/etc/rspamd/** r, | ||
/sys/kernel/mm/transparent_hugepage/enabled r, | ||
/usr/bin/rspamd mr, | ||
/usr/share/rspamd/** r, | ||
/var/lib/rspamd/ r, | ||
/var/lib/rspamd/** rwk, | ||
} |