CAP_NET_ADMIN not being provided with the recommended plugs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I am trying to use golang to make an application/snap that will create a TUN interface (vpn-like stuff). On execution the golang application pacakged as a snap returns "Operation not permitted" which appears to be because the CAP_NET_ADMIN capability is not getting applied.
I used the debug tools provided:
* sudo snap install snappy-debug
* sudo snap connect snappy-
* sudo /snap/bin/
AppArmor reported:
= AppArmor =
Time: Apr 8 12:42:29
Log: apparmor="ALLOWED" operation="capable" info="optional: no audit" error=-1 profile=
Capability: net_admin
Suggestions:
* adjust program to not require 'CAP_NET_ADMIN' (see 'man 7 capabilities')
* add one of 'bluetooth-control, firewall-control, netlink-audit, netlink-connector, network-control' to 'plugs'
* do nothing if using systemd utility (eg, timedatectl): https:/
* do nothing (https:/
I started out by adding only network-control but that doesn't seem to be applying the CAP_NET_ADMIN capability so I then went on to include all the plugs in my snap to see if any of them would allow the application to create the tun.
I ran the snap with --stracce but I'm not sure if it's helpful:
[pid 24136] openat(AT_FDCWD, "/dev/net/tun", O_RDWR|O_CLOEXEC) = 3
[pid 24136] epoll_ctl(4, EPOLL_CTL_ADD, 3, {EPOLLIN|
[pid 24136] fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
[pid 24136] fcntl(3, F_SETFL, O_RDWR|
[pid 24136] fcntl(3, F_GETFL) = 0x8802 (flags O_RDWR|
[pid 24136] fcntl(3, F_SETFL, O_RDWR|O_LARGEFILE) = 0
[pid 24136] ioctl(3, TUNSETIFF, 0xc0000ffb64) = -1 EPERM (Operation not permitted)
Apologies if this was misguided but I posted here first https:/
The snap functions correctly when run as sudo but I'd like to not have to run it as sudo.
Changed in snappy: | |
status: | Incomplete → Won't Fix |
status: | Won't Fix → Invalid |
Hello
Did you declare any connect any of the connected plugs to your application snap?