Skip to content

Commit 8bf42bc

Browse files
committed
feat!: Rename codejail apparmor profile to add openedx prefix
AppArmor profiles are global within the OS, so we should use a name that is better guaranteed to not conflict. Choosing an openedx prefix also gives operators a hint when they're trying to manage installed profiles in the OS and establishes precedent for future profiles.
1 parent 3b24510 commit 8bf42bc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

codejail.profile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abi <abi/3.0>,
3434
# the outer one is going to help. But there may be some small value in
3535
# defense-in-depth, as it's possible that a bug in the codejail_sandbox (inner)
3636
# profile isn't present in the outer one.
37-
profile codejail_service flags=(mediate_deleted) {
37+
profile openedx_codejail_service flags=(mediate_deleted) {
3838

3939
# Allow access to a variety of commonly needed, generally safe things
4040
# (such as reading /dev/random, free memory, etc.)
@@ -60,7 +60,7 @@ profile codejail_service flags=(mediate_deleted) {
6060

6161
# Allow sending a kill signal to the codejail_sandbox subprofile when the execution
6262
# runs beyond time limits.
63-
signal (send) set=(kill) peer=codejail_service//codejail_sandbox,
63+
signal (send) set=(kill) peer=openedx_codejail_service//codejail_sandbox,
6464

6565
# The core of the confinement: When the sandbox Python is executed, switch to
6666
# the (extremely constrained) codejail_sandbox profile.
@@ -108,6 +108,6 @@ profile codejail_service flags=(mediate_deleted) {
108108

109109
# Allow receiving a kill signal from the webapp when the execution
110110
# runs beyond time limits.
111-
signal (receive) set=(kill) peer=codejail_service,
111+
signal (receive) set=(kill) peer=openedx_codejail_service,
112112
}
113113
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ services:
732732
ports:
733733
- "18030:8080"
734734
security_opt:
735-
- apparmor=codejail_service
735+
- apparmor=openedx_codejail_service
736736

737737
xqueue:
738738
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.xqueue"

docs/codejail.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Changes to the AppArmor profile must be coordinated with changes to the Dockerfi
3333

3434
Any time you update the profile file, you'll need to update the profile in your OS as well: ``sudo apparmor_parser --replace -W ./codejail.profile``
3535

36-
The profile file contains the directive ``profile codejail_service``. That defines the name of the profile when it is installed into the OS, and must agree with the relevant ``security_opt`` line in ``docker-compose.yml``. This name should not be changed, as it creates a confusing situation and would require every developer who uses codejail-service to do a number of manual steps. (Profiles can't be renamed *within* the OS; they must first be removed **under the old name**, and then a new profile must be installed under the new name.)
36+
The profile file contains the directive ``profile openedx_codejail_service``. That defines the name of the profile when it is installed into the OS, and must agree with the relevant ``security_opt`` line in ``docker-compose.yml``. This name should not be changed, as it creates a confusing situation and would require every developer who uses codejail-service to do a number of manual steps. (Profiles can't be renamed *within* the OS; they must first be removed **under the old name**, and then a new profile must be installed under the new name.)
3737

3838
Debugging
3939
*********

0 commit comments

Comments
 (0)