{"action":"created","comment":{"url":"https://api.github.com/repos/systemd/systemd/pulls/comments/138120792","pull_request_review_id":61874301,"id":138120792,"diff_hunk":"@@ -319,17 +319,14 @@\n         <term><varname>DefaultBlockIOAccounting=</varname></term>\n         <term><varname>DefaultMemoryAccounting=</varname></term>\n         <term><varname>DefaultTasksAccounting=</varname></term>\n+        <term><varname>DefaultIPAccouting</varname></term>","path":"man/systemd-system.conf.xml","position":4,"original_position":4,"commit_id":"f508179de394dda7dce848cde3d7bdefcc84b79d","original_commit_id":"f508179de394dda7dce848cde3d7bdefcc84b79d","user":{"login":"alban","id":27575,"avatar_url":"https://avatars2.githubusercontent.com/u/27575?v=4","gravatar_id":"","url":"https://api.github.com/users/alban","html_url":"https://github.com/alban","followers_url":"https://api.github.com/users/alban/followers","following_url":"https://api.github.com/users/alban/following{/other_user}","gists_url":"https://api.github.com/users/alban/gists{/gist_id}","starred_url":"https://api.github.com/users/alban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alban/subscriptions","organizations_url":"https://api.github.com/users/alban/orgs","repos_url":"https://api.github.com/users/alban/repos","events_url":"https://api.github.com/users/alban/events{/privacy}","received_events_url":"https://api.github.com/users/alban/received_events","type":"User","site_admin":false},"body":"typo: IPAccou**n**ting\r\n(same typo elsewhere)","created_at":"2017-09-11T16:25:06Z","updated_at":"2017-09-11T16:38:27Z","html_url":"https://github.com/systemd/systemd/pull/6764#discussion_r138120792","pull_request_url":"https://api.github.com/repos/systemd/systemd/pulls/6764","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments/138120792"},"html":{"href":"https://github.com/systemd/systemd/pull/6764#discussion_r138120792"},"pull_request":{"href":"https://api.github.com/repos/systemd/systemd/pulls/6764"}}},"pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/6764","id":139872631,"html_url":"https://github.com/systemd/systemd/pull/6764","diff_url":"https://github.com/systemd/systemd/pull/6764.diff","patch_url":"https://github.com/systemd/systemd/pull/6764.patch","issue_url":"https://api.github.com/repos/systemd/systemd/issues/6764","number":6764,"state":"open","locked":false,"title":"add simple eBPF-based per-unit IP access lists and accounting","user":{"login":"poettering","id":2130732,"avatar_url":"https://avatars1.githubusercontent.com/u/2130732?v=4","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"body":"This adds simple eBPF-based based per-unit IP access lists and accounting. It makes use of the ebpf/cgroup feature of the unified cgroup hierarchy in new kernels.\r\n\r\nThis is mostly a heavily extended version of @zonque's original userspace work, updated to the kernel APIs ultimately merged into the Linux kernel.\r\n\r\nHere's the gist how you use it. Let's start an in interactive shell as transient unit, with IP accounting enabled:\r\n\r\n```\r\n# systemd-run -p IPAccounting=1 -t /bin/sh\r\nRunning as unit: run-u1665.service\r\nPress ^] three times within 1s to disconnect TTY.\r\nsh-4.4#\r\n```\r\n\r\nNow, let's have a look at the unit we just started, from inside of it:\r\n```\r\nsh-4.4# systemctl status run-u1665.service\r\n● run-u1665.service - /bin/sh\r\n   Loaded: loaded (/run/systemd/transient/run-u1665.service; transient; vendor preset: disabled)\r\nTransient: yes\r\n   Active: active (running) since Thu 2017-09-07 20:11:58 CEST; 1min 33s ago\r\n Main PID: 15859 (sh)\r\n       IP: 0B in, 0B out\r\n    Tasks: 3 (limit: 4915)\r\n   CGroup: /system.slice/run-u1665.service\r\n           ├─15859 /bin/sh\r\n           ├─15878 systemctl status run-u1665.service\r\n           └─15879 less\r\n\r\nSep 07 20:11:58 sigma systemd[1]: Started /bin/sh.\r\nsh-4.4# \r\n```\r\n\r\nNote the new status lines `IP:`, showing that so far no traffic was generated. Let's change that, by generating some traffic from inside the unit:\r\n\r\n```\r\nsh-4.4# ping localhost\r\nPING localhost.localdomain (127.0.0.1) 56(84) bytes of data.\r\n64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.042 ms\r\n64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.062 ms\r\n^C\r\n--- localhost.localdomain ping statistics ---\r\n2 packets transmitted, 2 received, 0% packet loss, time 1012ms\r\nrtt min/avg/max/mdev = 0.042/0.052/0.062/0.010 ms\r\n\r\nsh-4.4# systemctl status run-u1665.service\r\n● run-u1665.service - /bin/sh\r\n   Loaded: loaded (/run/systemd/transient/run-u1665.service; transient; vendor preset: disabled)\r\nTransient: yes\r\n   Active: active (running) since Thu 2017-09-07 20:11:58 CEST; 3min 22s ago\r\n Main PID: 15859 (sh)\r\n       IP: 168B in, 168B out\r\n    Tasks: 3 (limit: 4915)\r\n   CGroup: /system.slice/run-u1665.service\r\n           ├─15859 /bin/sh\r\n           ├─15932 systemctl status run-u1665.service\r\n           └─15933 less\r\n\r\nSep 07 20:11:58 sigma systemd[1]: Started /bin/sh.\r\nsh-4.4# \r\n```\r\n\r\nAs expected, the `IP:` status line shows we generated some traffic. Now, let's see how the access list stuff works. Let's start from scratch:\r\n\r\n```\r\n# systemd-run -p IPAddressDeny=127.0.0.2 -t /bin/sh\r\nRunning as unit: run-u1720.service\r\nPress ^] three times within 1s to disconnect TTY.\r\nsh-4.4# \r\n```\r\nThis shell now can access all IP servers, except for 127.0.0.2 (which is on the local loopback). Let's try:\r\n\r\n```\r\nsh-4.4# ping -c 1 -W 5 127.0.0.1\r\nPING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.\r\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.091 ms\r\n\r\n--- 127.0.0.1 ping statistics ---\r\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\r\nrtt min/avg/max/mdev = 0.091/0.091/0.091/0.000 ms\r\nsh-4.4# ping -c 1 -W 5 127.0.0.2\r\nPING 127.0.0.2 (127.0.0.2) 56(84) bytes of data.\r\nping: sendmsg: Operation not permitted\r\n^C\r\n--- 127.0.0.2 ping statistics ---\r\n1 packets transmitted, 0 received, 100% packet loss, time 0ms\r\nsh-4.4# ping -c 1 -W 5 127.0.0.3\r\nPING 127.0.0.3 (127.0.0.3) 56(84) bytes of data.\r\n64 bytes from 127.0.0.3: icmp_seq=1 ttl=64 time=0.073 ms\r\n\r\n--- 127.0.0.3 ping statistics ---\r\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\r\nrtt min/avg/max/mdev = 0.073/0.073/0.073/0.000 ms\r\nsh-4.4# \r\n```\r\nAs expected, traffic to 127.0.0.1 and 127.0.0.3 still works, but traffic to 127.0.0.2 doesn't! Yay!","created_at":"2017-09-07T18:19:21Z","updated_at":"2017-09-11T16:38:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dec2817bea81d816ffa0ebd8a22b9dadc4f41564","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/systemd/systemd/pulls/6764/commits","review_comments_url":"https://api.github.com/repos/systemd/systemd/pulls/6764/comments","review_comment_url":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/6764/comments","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/f508179de394dda7dce848cde3d7bdefcc84b79d","head":{"label":"poettering:bpf-firewall","ref":"bpf-firewall","sha":"f508179de394dda7dce848cde3d7bdefcc84b79d","user":{"login":"poettering","id":2130732,"avatar_url":"https://avatars1.githubusercontent.com/u/2130732?v=4","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"repo":{"id":37097921,"name":"systemd","full_name":"poettering/systemd","owner":{"login":"poettering","id":2130732,"avatar_url":"https://avatars1.githubusercontent.com/u/2130732?v=4","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/poettering/systemd","description":"systemd upstream","fork":true,"url":"https://api.github.com/repos/poettering/systemd","forks_url":"https://api.github.com/repos/poettering/systemd/forks","keys_url":"https://api.github.com/repos/poettering/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poettering/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poettering/systemd/teams","hooks_url":"https://api.github.com/repos/poettering/systemd/hooks","issue_events_url":"https://api.github.com/repos/poettering/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/poettering/systemd/events","assignees_url":"https://api.github.com/repos/poettering/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/poettering/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/poettering/systemd/tags","blobs_url":"https://api.github.com/repos/poettering/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poettering/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poettering/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/poettering/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poettering/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/poettering/systemd/languages","stargazers_url":"https://api.github.com/repos/poettering/systemd/stargazers","contributors_url":"https://api.github.com/repos/poettering/systemd/contributors","subscribers_url":"https://api.github.com/repos/poettering/systemd/subscribers","subscription_url":"https://api.github.com/repos/poettering/systemd/subscription","commits_url":"https://api.github.com/repos/poettering/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/poettering/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/poettering/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/poettering/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/poettering/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/poettering/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poettering/systemd/merges","archive_url":"https://api.github.com/repos/poettering/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poettering/systemd/downloads","issues_url":"https://api.github.com/repos/poettering/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/poettering/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/poettering/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/poettering/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poettering/systemd/labels{/name}","releases_url":"https://api.github.com/repos/poettering/systemd/releases{/id}","deployments_url":"https://api.github.com/repos/poettering/systemd/deployments","created_at":"2015-06-08T23:07:59Z","updated_at":"2017-08-23T14:09:32Z","pushed_at":"2017-09-11T16:13:07Z","git_url":"git://github.com/poettering/systemd.git","ssh_url":"git@github.com:poettering/systemd.git","clone_url":"https://github.com/poettering/systemd.git","svn_url":"https://github.com/poettering/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":72612,"stargazers_count":8,"watchers_count":8,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":8,"default_branch":"master"}},"base":{"label":"systemd:master","ref":"master","sha":"e3695e499a54071aa5fa3b79bdbff0be2c528204","user":{"login":"systemd","id":1918868,"avatar_url":"https://avatars0.githubusercontent.com/u/1918868?v=4","gravatar_id":"","url":"https://api.github.com/users/systemd","html_url":"https://github.com/systemd","followers_url":"https://api.github.com/users/systemd/followers","following_url":"https://api.github.com/users/systemd/following{/other_user}","gists_url":"https://api.github.com/users/systemd/gists{/gist_id}","starred_url":"https://api.github.com/users/systemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemd/subscriptions","organizations_url":"https://api.github.com/users/systemd/orgs","repos_url":"https://api.github.com/users/systemd/repos","events_url":"https://api.github.com/users/systemd/events{/privacy}","received_events_url":"https://api.github.com/users/systemd/received_events","type":"Organization","site_admin":false},"repo":{"id":32873313,"name":"systemd","full_name":"systemd/systemd","owner":{"login":"systemd","id":1918868,"avatar_url":"https://avatars0.githubusercontent.com/u/1918868?v=4","gravatar_id":"","url":"https://api.github.com/users/systemd","html_url":"https://github.com/systemd","followers_url":"https://api.github.com/users/systemd/followers","following_url":"https://api.github.com/users/systemd/following{/other_user}","gists_url":"https://api.github.com/users/systemd/gists{/gist_id}","starred_url":"https://api.github.com/users/systemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemd/subscriptions","organizations_url":"https://api.github.com/users/systemd/orgs","repos_url":"https://api.github.com/users/systemd/repos","events_url":"https://api.github.com/users/systemd/events{/privacy}","received_events_url":"https://api.github.com/users/systemd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/systemd/systemd","description":"systemd System and Service Manager","fork":false,"url":"https://api.github.com/repos/systemd/systemd","forks_url":"https://api.github.com/repos/systemd/systemd/forks","keys_url":"https://api.github.com/repos/systemd/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/systemd/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/systemd/systemd/teams","hooks_url":"https://api.github.com/repos/systemd/systemd/hooks","issue_events_url":"https://api.github.com/repos/systemd/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/systemd/systemd/events","assignees_url":"https://api.github.com/repos/systemd/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/systemd/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/systemd/systemd/tags","blobs_url":"https://api.github.com/repos/systemd/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/systemd/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/systemd/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/systemd/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/systemd/systemd/languages","stargazers_url":"https://api.github.com/repos/systemd/systemd/stargazers","contributors_url":"https://api.github.com/repos/systemd/systemd/contributors","subscribers_url":"https://api.github.com/repos/systemd/systemd/subscribers","subscription_url":"https://api.github.com/repos/systemd/systemd/subscription","commits_url":"https://api.github.com/repos/systemd/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/systemd/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/systemd/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/systemd/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/systemd/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/systemd/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/systemd/systemd/merges","archive_url":"https://api.github.com/repos/systemd/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/systemd/systemd/downloads","issues_url":"https://api.github.com/repos/systemd/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/systemd/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/systemd/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/systemd/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/systemd/systemd/labels{/name}","releases_url":"https://api.github.com/repos/systemd/systemd/releases{/id}","deployments_url":"https://api.github.com/repos/systemd/systemd/deployments","created_at":"2015-03-25T15:27:27Z","updated_at":"2017-09-11T01:50:47Z","pushed_at":"2017-09-11T16:13:09Z","git_url":"git://github.com/systemd/systemd.git","ssh_url":"git@github.com:systemd/systemd.git","clone_url":"https://github.com/systemd/systemd.git","svn_url":"https://github.com/systemd/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":72613,"stargazers_count":2184,"watchers_count":2184,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":922,"mirror_url":null,"open_issues_count":767,"forks":922,"open_issues":767,"watchers":2184,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/6764"},"html":{"href":"https://github.com/systemd/systemd/pull/6764"},"issue":{"href":"https://api.github.com/repos/systemd/systemd/issues/6764"},"comments":{"href":"https://api.github.com/repos/systemd/systemd/issues/6764/comments"},"review_comments":{"href":"https://api.github.com/repos/systemd/systemd/pulls/6764/comments"},"review_comment":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/systemd/systemd/pulls/6764/commits"},"statuses":{"href":"https://api.github.com/repos/systemd/systemd/statuses/f508179de394dda7dce848cde3d7bdefcc84b79d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"alban"}}