{"action":"created","comment":{"url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments/63760196","id":63760196,"diff_hunk":"@@ -0,0 +1,444 @@\n+// -*- Mode: Go; indent-tabs-mode: t -*-\n+\n+/*\n+ * Copyright (C) 2016 Canonical Ltd\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License version 3 as\n+ * published by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ *\n+ */\n+\n+package builtin\n+\n+import (\n+\t\"bytes\"\n+\n+\t\"github.com/ubuntu-core/snappy/interfaces\"\n+\t\"github.com/ubuntu-core/snappy/release\"\n+)\n+\n+var networkManagerPermanentSlotAppArmor = []byte(`\n+# Description: Allow operating as the NetworkManager service. Reserved because this\n+#  gives privileged access to the system.\n+# Usage: reserved\n+\n+capability net_admin,\n+capability net_bind_service,\n+capability net_raw,\n+\n+network netlink,\n+network netlink raw,\n+network netlink dgram,\n+network bridge,\n+network inet,\n+network inet6,\n+network packet,\n+\n+@{PROC}/@{pid}/net/ r,\n+@{PROC}/@{pid}/net/** r,\n+\n+# used by sysctl, et al\n+@{PROC}/sys/ r,\n+@{PROC}/sys/net/ r,\n+@{PROC}/sys/net/core/ r,\n+@{PROC}/sys/net/core/** rw,\n+@{PROC}/sys/net/ipv{4,6}/ r,\n+@{PROC}/sys/net/ipv{4,6}/** rw,\n+@{PROC}/sys/net/netfilter/ r,\n+@{PROC}/sys/net/netfilter/** rw,\n+@{PROC}/sys/net/nf_conntrack_max rw,\n+\n+# Needed for systemd's dhcp implementation\n+@{PROC}/sys/kernel/random/boot_id r,\n+\n+/sys/devices/**/**/net/**/phys_port_id r,\n+/sys/devices/**/**/net/**/dev_id r,\n+/sys/devices/virtual/net/**/phys_port_id r,\n+/sys/devices/virtual/net/**/dev_id r,\n+\n+/dev/rfkill rw,\n+\n+# Needed by the ifupdown plugin to check which interfaces can\n+# be managed an which not.\n+/etc/network/interfaces r,\n+# Needed for systemd's dhcp implementation\n+/etc/machine-id r,\n+\n+#include <abstractions/nameservice>\n+\n+# DBus accesses\n+#include <abstractions/dbus-strict>\n+\n+dbus (send)\n+   bus=system\n+   path=/org/freedesktop/DBus\n+   interface=org.freedesktop.DBus\n+   member={Request,Release}Name\n+   peer=(name=org.freedesktop.DBus),\n+\n+dbus (receive, send)\n+   bus=system\n+   path=/org/freedesktop/DBus\n+   interface=org.freedesktop.DBus\n+   member=GetConnectionUnixProcessID\n+   peer=(label=unconfined),\n+\n+dbus (receive, send)\n+   bus=system\n+   path=/org/freedesktop/DBus\n+   interface=org.freedesktop.DBus\n+   member=GetConnectionUnixUser\n+   peer=(label=unconfined),\n+\n+# Allow binding the service to the requested connection name\n+dbus (bind)\n+    bus=system\n+    name=\"org.freedesktop.NetworkManager\",\n+\n+# Allow traffic to/from our path and interface with any method\n+dbus (receive, send)\n+    bus=system\n+    path=/org/freedesktop/NetworkManager{,/**}\n+    interface=org.freedesktop.NetworkManager*,\n+\n+# Allow traffic to/from org.freedesktop.DBus for NetworkManager service\n+dbus (receive, send)\n+    bus=system\n+    path=/org/freedesktop/NetworkManager{,/**}\n+    interface=org.freedesktop.DBus.*,","path":"interfaces/builtin/network_manager.go","position":117,"original_position":117,"commit_id":"59806c072b016b9d95c433324aa822f46d173ad7","original_commit_id":"59806c072b016b9d95c433324aa822f46d173ad7","user":{"login":"jdstrand","id":1663079,"avatar_url":"https://avatars.githubusercontent.com/u/1663079?v=3","gravatar_id":"","url":"https://api.github.com/users/jdstrand","html_url":"https://github.com/jdstrand","followers_url":"https://api.github.com/users/jdstrand/followers","following_url":"https://api.github.com/users/jdstrand/following{/other_user}","gists_url":"https://api.github.com/users/jdstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/jdstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdstrand/subscriptions","organizations_url":"https://api.github.com/users/jdstrand/orgs","repos_url":"https://api.github.com/users/jdstrand/repos","events_url":"https://api.github.com/users/jdstrand/events{/privacy}","received_events_url":"https://api.github.com/users/jdstrand/received_events","type":"User","site_admin":false},"body":"I think I'd like to see these broken out into separate send and receive rules so we can leverage peer=(), but let's not block on this alone. Can you provide your methodology for testing the DBus API so I may use it to refine these rules?","created_at":"2016-05-18T18:49:55Z","updated_at":"2016-05-18T18:49:55Z","html_url":"https://github.com/ubuntu-core/snappy/pull/1036#discussion_r63760196","pull_request_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036","_links":{"self":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments/63760196"},"html":{"href":"https://github.com/ubuntu-core/snappy/pull/1036#discussion_r63760196"},"pull_request":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036"}}},"pull_request":{"url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036","id":66855051,"html_url":"https://github.com/ubuntu-core/snappy/pull/1036","diff_url":"https://github.com/ubuntu-core/snappy/pull/1036.diff","patch_url":"https://github.com/ubuntu-core/snappy/pull/1036.patch","issue_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/1036","number":1036,"state":"open","locked":false,"title":"interfaces: first version of the networkmanager interface","user":{"login":"morphis","id":433752,"avatar_url":"https://avatars.githubusercontent.com/u/433752?v=3","gravatar_id":"","url":"https://api.github.com/users/morphis","html_url":"https://github.com/morphis","followers_url":"https://api.github.com/users/morphis/followers","following_url":"https://api.github.com/users/morphis/following{/other_user}","gists_url":"https://api.github.com/users/morphis/gists{/gist_id}","starred_url":"https://api.github.com/users/morphis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morphis/subscriptions","organizations_url":"https://api.github.com/users/morphis/orgs","repos_url":"https://api.github.com/users/morphis/repos","events_url":"https://api.github.com/users/morphis/events{/privacy}","received_events_url":"https://api.github.com/users/morphis/received_events","type":"User","site_admin":false},"body":"Dropping this for a first review round. There are still some things to figure out with the policy for other functionality parts but this gives us a working network-manager snap where connecting a plug and a slot with the networkmanager interface works.","created_at":"2016-04-18T13:42:02Z","updated_at":"2016-05-18T18:49:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22472f49f4b15fb25746fe9e0bc3a96ed973c4c9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036/commits","review_comments_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036/comments","review_comment_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/1036/comments","statuses_url":"https://api.github.com/repos/ubuntu-core/snappy/statuses/59806c072b016b9d95c433324aa822f46d173ad7","head":{"label":"morphis:networkmanager-interface","ref":"networkmanager-interface","sha":"59806c072b016b9d95c433324aa822f46d173ad7","user":{"login":"morphis","id":433752,"avatar_url":"https://avatars.githubusercontent.com/u/433752?v=3","gravatar_id":"","url":"https://api.github.com/users/morphis","html_url":"https://github.com/morphis","followers_url":"https://api.github.com/users/morphis/followers","following_url":"https://api.github.com/users/morphis/following{/other_user}","gists_url":"https://api.github.com/users/morphis/gists{/gist_id}","starred_url":"https://api.github.com/users/morphis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morphis/subscriptions","organizations_url":"https://api.github.com/users/morphis/orgs","repos_url":"https://api.github.com/users/morphis/repos","events_url":"https://api.github.com/users/morphis/events{/privacy}","received_events_url":"https://api.github.com/users/morphis/received_events","type":"User","site_admin":false},"repo":{"id":56325721,"name":"snappy","full_name":"morphis/snappy","owner":{"login":"morphis","id":433752,"avatar_url":"https://avatars.githubusercontent.com/u/433752?v=3","gravatar_id":"","url":"https://api.github.com/users/morphis","html_url":"https://github.com/morphis","followers_url":"https://api.github.com/users/morphis/followers","following_url":"https://api.github.com/users/morphis/following{/other_user}","gists_url":"https://api.github.com/users/morphis/gists{/gist_id}","starred_url":"https://api.github.com/users/morphis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morphis/subscriptions","organizations_url":"https://api.github.com/users/morphis/orgs","repos_url":"https://api.github.com/users/morphis/repos","events_url":"https://api.github.com/users/morphis/events{/privacy}","received_events_url":"https://api.github.com/users/morphis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/morphis/snappy","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/morphis/snappy","forks_url":"https://api.github.com/repos/morphis/snappy/forks","keys_url":"https://api.github.com/repos/morphis/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/morphis/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/morphis/snappy/teams","hooks_url":"https://api.github.com/repos/morphis/snappy/hooks","issue_events_url":"https://api.github.com/repos/morphis/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/morphis/snappy/events","assignees_url":"https://api.github.com/repos/morphis/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/morphis/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/morphis/snappy/tags","blobs_url":"https://api.github.com/repos/morphis/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/morphis/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/morphis/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/morphis/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/morphis/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/morphis/snappy/languages","stargazers_url":"https://api.github.com/repos/morphis/snappy/stargazers","contributors_url":"https://api.github.com/repos/morphis/snappy/contributors","subscribers_url":"https://api.github.com/repos/morphis/snappy/subscribers","subscription_url":"https://api.github.com/repos/morphis/snappy/subscription","commits_url":"https://api.github.com/repos/morphis/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/morphis/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/morphis/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/morphis/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/morphis/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/morphis/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/morphis/snappy/merges","archive_url":"https://api.github.com/repos/morphis/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/morphis/snappy/downloads","issues_url":"https://api.github.com/repos/morphis/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/morphis/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/morphis/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/morphis/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/morphis/snappy/labels{/name}","releases_url":"https://api.github.com/repos/morphis/snappy/releases{/id}","deployments_url":"https://api.github.com/repos/morphis/snappy/deployments","created_at":"2016-04-15T14:21:22Z","updated_at":"2016-04-15T14:21:24Z","pushed_at":"2016-05-18T05:52:01Z","git_url":"git://github.com/morphis/snappy.git","ssh_url":"git@github.com:morphis/snappy.git","clone_url":"https://github.com/morphis/snappy.git","svn_url":"https://github.com/morphis/snappy","homepage":null,"size":29610,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ubuntu-core:master","ref":"master","sha":"1400bc098c675ab5ec6a885be6b1f67273e1bf3a","user":{"login":"ubuntu-core","id":15022473,"avatar_url":"https://avatars.githubusercontent.com/u/15022473?v=3","gravatar_id":"","url":"https://api.github.com/users/ubuntu-core","html_url":"https://github.com/ubuntu-core","followers_url":"https://api.github.com/users/ubuntu-core/followers","following_url":"https://api.github.com/users/ubuntu-core/following{/other_user}","gists_url":"https://api.github.com/users/ubuntu-core/gists{/gist_id}","starred_url":"https://api.github.com/users/ubuntu-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubuntu-core/subscriptions","organizations_url":"https://api.github.com/users/ubuntu-core/orgs","repos_url":"https://api.github.com/users/ubuntu-core/repos","events_url":"https://api.github.com/users/ubuntu-core/events{/privacy}","received_events_url":"https://api.github.com/users/ubuntu-core/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snappy","full_name":"ubuntu-core/snappy","owner":{"login":"ubuntu-core","id":15022473,"avatar_url":"https://avatars.githubusercontent.com/u/15022473?v=3","gravatar_id":"","url":"https://api.github.com/users/ubuntu-core","html_url":"https://github.com/ubuntu-core","followers_url":"https://api.github.com/users/ubuntu-core/followers","following_url":"https://api.github.com/users/ubuntu-core/following{/other_user}","gists_url":"https://api.github.com/users/ubuntu-core/gists{/gist_id}","starred_url":"https://api.github.com/users/ubuntu-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubuntu-core/subscriptions","organizations_url":"https://api.github.com/users/ubuntu-core/orgs","repos_url":"https://api.github.com/users/ubuntu-core/repos","events_url":"https://api.github.com/users/ubuntu-core/events{/privacy}","received_events_url":"https://api.github.com/users/ubuntu-core/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubuntu-core/snappy","description":"Snappy is the software at the heart of Ubuntu Core.","fork":false,"url":"https://api.github.com/repos/ubuntu-core/snappy","forks_url":"https://api.github.com/repos/ubuntu-core/snappy/forks","keys_url":"https://api.github.com/repos/ubuntu-core/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubuntu-core/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubuntu-core/snappy/teams","hooks_url":"https://api.github.com/repos/ubuntu-core/snappy/hooks","issue_events_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/ubuntu-core/snappy/events","assignees_url":"https://api.github.com/repos/ubuntu-core/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/ubuntu-core/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/ubuntu-core/snappy/tags","blobs_url":"https://api.github.com/repos/ubuntu-core/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubuntu-core/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubuntu-core/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubuntu-core/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubuntu-core/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/ubuntu-core/snappy/languages","stargazers_url":"https://api.github.com/repos/ubuntu-core/snappy/stargazers","contributors_url":"https://api.github.com/repos/ubuntu-core/snappy/contributors","subscribers_url":"https://api.github.com/repos/ubuntu-core/snappy/subscribers","subscription_url":"https://api.github.com/repos/ubuntu-core/snappy/subscription","commits_url":"https://api.github.com/repos/ubuntu-core/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubuntu-core/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubuntu-core/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubuntu-core/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/ubuntu-core/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubuntu-core/snappy/merges","archive_url":"https://api.github.com/repos/ubuntu-core/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubuntu-core/snappy/downloads","issues_url":"https://api.github.com/repos/ubuntu-core/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/ubuntu-core/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/ubuntu-core/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubuntu-core/snappy/labels{/name}","releases_url":"https://api.github.com/repos/ubuntu-core/snappy/releases{/id}","deployments_url":"https://api.github.com/repos/ubuntu-core/snappy/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2016-05-18T07:28:59Z","pushed_at":"2016-05-18T18:31:46Z","git_url":"git://github.com/ubuntu-core/snappy.git","ssh_url":"git@github.com:ubuntu-core/snappy.git","clone_url":"https://github.com/ubuntu-core/snappy.git","svn_url":"https://github.com/ubuntu-core/snappy","homepage":null,"size":30823,"stargazers_count":194,"watchers_count":194,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":33,"forks":42,"open_issues":33,"watchers":194,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036"},"html":{"href":"https://github.com/ubuntu-core/snappy/pull/1036"},"issue":{"href":"https://api.github.com/repos/ubuntu-core/snappy/issues/1036"},"comments":{"href":"https://api.github.com/repos/ubuntu-core/snappy/issues/1036/comments"},"review_comments":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036/comments"},"review_comment":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/1036/commits"},"statuses":{"href":"https://api.github.com/repos/ubuntu-core/snappy/statuses/59806c072b016b9d95c433324aa822f46d173ad7"}}}}