Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces: miscellaneous updates for hardware-observe, kernel-module-control, unity7 and default #2768

Merged
merged 6 commits into from Feb 7, 2017

Conversation

jdstrand
Copy link

@jdstrand jdstrand commented Feb 2, 2017

  • interfaces/unity7: allow reading glib schemas files
  • interfaces: allow reading /etc/mailname by default (LP: #1630690)
  • interfaces/kernel-module-control: allow 'capability syslog'
  • interfaces/hardware-observe: allow read on /proc/bus/pci/**, etc (LP: #1660865)
    Support lspci:
    • allow reading /etc/modprobe.d/{,*}
    • allow capability sys_admin
    • allow read on @{PROC}/bus/pci/{,**} (lspci -A linux-proc)
    • allow iopl syscall (lspci -A intel-conf*)
    • allow read on @{PROC}/interrupts
      Support lshw:
    • allow read on @{PROC}/devices
    • allow read on @{PROC}/ide/{,**}
    • allow read on @{PROC}/scsi/{,**}
    • allow read on @{PROC}/device-tree/{,**}
    • allow read on /sys/kernel/debug/usb/devices
    • allow read on @{PROC}/sys/abi/{,*}

Jamie Strandboge added 5 commits February 2, 2017 13:27
… #1660865)

Support lspci:
- allow reading /etc/modprobe.d/{,*}
- allow capability sys_admin
- allow read on @{PROC}/bus/pci/{,**} (lspci -A linux-proc)
- allow iopl syscall (lspci -A intel-conf*)
- allow read on @{PROC}/interrupts

Support lshw:
- allow read on @{PROC}/devices
- allow read on @{PROC}/ide/{,**}
- allow read on @{PROC}/scsi/{,**}
- allow read on @{PROC}/device-tree/{,**}
- allow read on /sys/kernel/debug/usb/devices
- allow read on @{PROC}/sys/abi/{,*}
Per man 2 syslog, when /proc/sys/kernel/dmesg_restrict is set,
SYSLOG_ACTION_READ_ALL and SYSLOG_ACTION_SIZE_BUFFER require CAP_SYSLOG.
Since consumers of this interface have legitimate reasons to check the log when
this restriction is set, allow the capability.
/etc/mailname doesn't exist in core, but it may exist on classic distributions.
We already allow /etc/hostname, so this isn't giving away anything more.
@@ -29,9 +29,13 @@ const kernelModuleControlConnectedPlugAppArmor = `
capability sys_module,
@{PROC}/modules r,

# NOTE: needed by lscpu. In the future this may be moved to system-trace or
# system-observe.
# FIXME: moved to physical-memory-observe (remove this in series 18)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as an observation. When we do series 18 we will allow people to co-install 16 and 18 base snaps and apps can use either of those. It just struck me that we should probably teach the interface layer the base snap the rule is for. The kernel-module-control interface will have to keep supplying access to /dev/mem even when 18 is around if the interface is connected to a snap using base-ubuntu-16.

Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

… #1662306)

/proc/sys/kernel/random/boot_id is a uuid that the kernel randomly generates
on each boot. Since it is different for every boot, allowing read access is ok
because it can't be used as an id to track the device
@mvo5 mvo5 merged commit c192aae into snapcore:master Feb 7, 2017
@jdstrand jdstrand deleted the policy-updates-xviii branch February 7, 2017 19:33
bergotorino pushed a commit to jhodapp/snapd that referenced this pull request Feb 9, 2017
The merge of snapcore#2768 made this
rule obsolete therefore removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants