Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oracle template: convert to common.conf style
Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
- Loading branch information
Showing
5 changed files
with
73 additions
and
35 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
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,45 @@ | ||
# Console settings | ||
lxc.devttydir = lxc | ||
lxc.tty = 4 | ||
lxc.pts = 1024 | ||
|
||
# Mount entries | ||
lxc.mount.auto = proc:mixed sys:ro | ||
|
||
# Ensure hostname is changed on clone | ||
lxc.hook.clone = @LXCHOOKDIR@/clonehostname | ||
|
||
# Capabilities | ||
# Uncomment these if you don't run anything that needs the capability, and | ||
# would like the container to run with less privilege. | ||
# | ||
# Dropping sys_admin disables container root from doing a lot of things | ||
# that could be bad like re-mounting lxc fstab entries rw for example, | ||
# but also disables some useful things like being able to nfs mount, and | ||
# things that are already namespaced with ns_capable() kernel checks, like | ||
# hostname(1). | ||
# lxc.cap.drop = sys_admin | ||
# lxc.cap.drop = net_raw # breaks dhcp/ping | ||
# lxc.cap.drop = setgid # breaks login (initgroups/setgroups) | ||
# lxc.cap.drop = dac_read_search # breaks login (pam unix_chkpwd) | ||
# lxc.cap.drop = setuid # breaks sshd,nfs statd | ||
# lxc.cap.drop = audit_control # breaks sshd (set_loginuid failed) | ||
# lxc.cap.drop = audit_write | ||
# | ||
lxc.cap.drop = mac_admin mac_override setfcap setpcap | ||
lxc.cap.drop = sys_module sys_nice sys_pacct | ||
lxc.cap.drop = sys_rawio sys_time | ||
|
||
# Control Group devices: all denied except those whitelisted | ||
lxc.cgroup.devices.deny = a | ||
# Allow any mknod (but not reading/writing the node) | ||
lxc.cgroup.devices.allow = c *:* m | ||
lxc.cgroup.devices.allow = b *:* m | ||
lxc.cgroup.devices.allow = c 1:3 rwm # /dev/null | ||
lxc.cgroup.devices.allow = c 1:5 rwm # /dev/zero | ||
lxc.cgroup.devices.allow = c 1:7 rwm # /dev/full | ||
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty | ||
lxc.cgroup.devices.allow = c 1:8 rwm # /dev/random | ||
lxc.cgroup.devices.allow = c 1:9 rwm # /dev/urandom | ||
lxc.cgroup.devices.allow = c 136:* rwm # /dev/tty[1-4] ptys and lxc console | ||
lxc.cgroup.devices.allow = c 5:2 rwm # /dev/ptmx pty master |
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,17 @@ | ||
# CAP_SYS_ADMIN in init-user-ns is required for cgroup.devices | ||
lxc.cgroup.devices.deny = | ||
lxc.cgroup.devices.allow = | ||
|
||
# We can't move bind-mounts, so don't use /dev/lxc/ | ||
lxc.devttydir = | ||
|
||
# Extra bind-mounts for userns | ||
lxc.mount.entry = /dev/null dev/null none bind,create=file 0 0 | ||
lxc.mount.entry = /dev/zero dev/zero none bind,create=file 0 0 | ||
lxc.mount.entry = /dev/full dev/full none bind,create=file 0 0 | ||
lxc.mount.entry = /dev/tty dev/tty none bind,create=file 0 0 | ||
lxc.mount.entry = /dev/urandom dev/urandom none bind,create=file 0 0 | ||
|
||
# Extra fstab entries as mountall can't mount those by itself | ||
lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0 | ||
lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0 |
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
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