{"action":"created","comment":{"url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/comments/231071025","pull_request_review_id":171951598,"id":231071025,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTA3MTAyNQ==","diff_hunk":"@@ -0,0 +1,40 @@\n+import json\n+import logging\n+import os\n+\n+\n+import requests\n+\n+from ...core.events import handler\n+from ...core.events.types import Vulnerability, Event\n+from ...core.types import Hunter, KubernetesCluster, AccessRisk\n+from ..discovery.hosts import RunningAsPodEvent\n+\n+\"\"\" Vulnerabilities \"\"\"\n+class SecretsAccess(Vulnerability, Event):\n+    \"\"\" Accessing the pod's secrets within a compromised pod might disclose valuable data to a potential attacker\"\"\"\n+\n+    def __init__(self, evidence):\n+        Vulnerability.__init__(self, KubernetesCluster, name=\"Accessed to pod's secrets\", category=AccessRisk)\n+        self.evidence = evidence\n+\n+\n+# Passive Hunter\n+@handler.subscribe(RunningAsPodEvent)\n+class AccessSecrets(Hunter):\n+    \"\"\"Accessing the secrets accessible to the pod\"\"\"\n+\n+    def __init__(self, event):\n+        self.event = event\n+        self.secrets_evidence = ''\n+\n+    def get_services(self):\n+        logging.debug(self.event.host)\n+        logging.debug('Passive Hunter is attempting to access pod\\'s secrets directory')\n+        # get all files and subdirectories files:\n+        self.secrets_evidence = [val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk('/var/run/secrets/')] for val in sublist]\n+        return True if (len(self.secrets_evidence) > 0) else False","path":"src/modules/hunting/secrets.py","position":36,"original_position":36,"commit_id":"1171c8ae20ac0f2614bd62800d3ef232c4e2da5f","original_commit_id":"fc0960d3bbe4c15bf21489394a5f82da1aee6f47","user":{"login":"lizrice","id":458616,"node_id":"MDQ6VXNlcjQ1ODYxNg==","avatar_url":"https://avatars0.githubusercontent.com/u/458616?v=4","gravatar_id":"","url":"https://api.github.com/users/lizrice","html_url":"https://github.com/lizrice","followers_url":"https://api.github.com/users/lizrice/followers","following_url":"https://api.github.com/users/lizrice/following{/other_user}","gists_url":"https://api.github.com/users/lizrice/gists{/gist_id}","starred_url":"https://api.github.com/users/lizrice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizrice/subscriptions","organizations_url":"https://api.github.com/users/lizrice/orgs","repos_url":"https://api.github.com/users/lizrice/repos","events_url":"https://api.github.com/users/lizrice/events{/privacy}","received_events_url":"https://api.github.com/users/lizrice/received_events","type":"User","site_admin":false},"body":"I'm going to merge regardless :) ","created_at":"2018-11-06T10:30:14Z","updated_at":"2018-11-06T10:30:14Z","html_url":"https://github.com/aquasecurity/kube-hunter/pull/53#discussion_r231071025","pull_request_url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/comments/231071025"},"html":{"href":"https://github.com/aquasecurity/kube-hunter/pull/53#discussion_r231071025"},"pull_request":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53"}},"in_reply_to_id":231041974},"pull_request":{"url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53","id":221555902,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNTU1OTAy","html_url":"https://github.com/aquasecurity/kube-hunter/pull/53","diff_url":"https://github.com/aquasecurity/kube-hunter/pull/53.diff","patch_url":"https://github.com/aquasecurity/kube-hunter/pull/53.patch","issue_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/53","number":53,"state":"open","locked":false,"title":"Access secrets hunter","user":{"login":"oriagmon","id":6180516,"node_id":"MDQ6VXNlcjYxODA1MTY=","avatar_url":"https://avatars0.githubusercontent.com/u/6180516?v=4","gravatar_id":"","url":"https://api.github.com/users/oriagmon","html_url":"https://github.com/oriagmon","followers_url":"https://api.github.com/users/oriagmon/followers","following_url":"https://api.github.com/users/oriagmon/following{/other_user}","gists_url":"https://api.github.com/users/oriagmon/gists{/gist_id}","starred_url":"https://api.github.com/users/oriagmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oriagmon/subscriptions","organizations_url":"https://api.github.com/users/oriagmon/orgs","repos_url":"https://api.github.com/users/oriagmon/repos","events_url":"https://api.github.com/users/oriagmon/events{/privacy}","received_events_url":"https://api.github.com/users/oriagmon/received_events","type":"User","site_admin":false},"body":"Attempt to access the secrets under the default pod's secrets path","created_at":"2018-10-09T19:22:15Z","updated_at":"2018-11-06T10:30:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e97407a3ca4e77f8a39f8d80ad43d95f568cf15d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53/commits","review_comments_url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53/comments","review_comment_url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/53/comments","statuses_url":"https://api.github.com/repos/aquasecurity/kube-hunter/statuses/1171c8ae20ac0f2614bd62800d3ef232c4e2da5f","head":{"label":"aquasecurity:access-secrets-hunter","ref":"access-secrets-hunter","sha":"1171c8ae20ac0f2614bd62800d3ef232c4e2da5f","user":{"login":"aquasecurity","id":12783832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzgzODMy","avatar_url":"https://avatars1.githubusercontent.com/u/12783832?v=4","gravatar_id":"","url":"https://api.github.com/users/aquasecurity","html_url":"https://github.com/aquasecurity","followers_url":"https://api.github.com/users/aquasecurity/followers","following_url":"https://api.github.com/users/aquasecurity/following{/other_user}","gists_url":"https://api.github.com/users/aquasecurity/gists{/gist_id}","starred_url":"https://api.github.com/users/aquasecurity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquasecurity/subscriptions","organizations_url":"https://api.github.com/users/aquasecurity/orgs","repos_url":"https://api.github.com/users/aquasecurity/repos","events_url":"https://api.github.com/users/aquasecurity/events{/privacy}","received_events_url":"https://api.github.com/users/aquasecurity/received_events","type":"Organization","site_admin":false},"repo":{"id":141447532,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE0NDc1MzI=","name":"kube-hunter","full_name":"aquasecurity/kube-hunter","private":false,"owner":{"login":"aquasecurity","id":12783832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzgzODMy","avatar_url":"https://avatars1.githubusercontent.com/u/12783832?v=4","gravatar_id":"","url":"https://api.github.com/users/aquasecurity","html_url":"https://github.com/aquasecurity","followers_url":"https://api.github.com/users/aquasecurity/followers","following_url":"https://api.github.com/users/aquasecurity/following{/other_user}","gists_url":"https://api.github.com/users/aquasecurity/gists{/gist_id}","starred_url":"https://api.github.com/users/aquasecurity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquasecurity/subscriptions","organizations_url":"https://api.github.com/users/aquasecurity/orgs","repos_url":"https://api.github.com/users/aquasecurity/repos","events_url":"https://api.github.com/users/aquasecurity/events{/privacy}","received_events_url":"https://api.github.com/users/aquasecurity/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aquasecurity/kube-hunter","description":"Hunt for security weaknesses in Kubernetes clusters","fork":false,"url":"https://api.github.com/repos/aquasecurity/kube-hunter","forks_url":"https://api.github.com/repos/aquasecurity/kube-hunter/forks","keys_url":"https://api.github.com/repos/aquasecurity/kube-hunter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aquasecurity/kube-hunter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aquasecurity/kube-hunter/teams","hooks_url":"https://api.github.com/repos/aquasecurity/kube-hunter/hooks","issue_events_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/events{/number}","events_url":"https://api.github.com/repos/aquasecurity/kube-hunter/events","assignees_url":"https://api.github.com/repos/aquasecurity/kube-hunter/assignees{/user}","branches_url":"https://api.github.com/repos/aquasecurity/kube-hunter/branches{/branch}","tags_url":"https://api.github.com/repos/aquasecurity/kube-hunter/tags","blobs_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/refs{/sha}","trees_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aquasecurity/kube-hunter/statuses/{sha}","languages_url":"https://api.github.com/repos/aquasecurity/kube-hunter/languages","stargazers_url":"https://api.github.com/repos/aquasecurity/kube-hunter/stargazers","contributors_url":"https://api.github.com/repos/aquasecurity/kube-hunter/contributors","subscribers_url":"https://api.github.com/repos/aquasecurity/kube-hunter/subscribers","subscription_url":"https://api.github.com/repos/aquasecurity/kube-hunter/subscription","commits_url":"https://api.github.com/repos/aquasecurity/kube-hunter/commits{/sha}","git_commits_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/commits{/sha}","comments_url":"https://api.github.com/repos/aquasecurity/kube-hunter/comments{/number}","issue_comment_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/comments{/number}","contents_url":"https://api.github.com/repos/aquasecurity/kube-hunter/contents/{+path}","compare_url":"https://api.github.com/repos/aquasecurity/kube-hunter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aquasecurity/kube-hunter/merges","archive_url":"https://api.github.com/repos/aquasecurity/kube-hunter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aquasecurity/kube-hunter/downloads","issues_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues{/number}","pulls_url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls{/number}","milestones_url":"https://api.github.com/repos/aquasecurity/kube-hunter/milestones{/number}","notifications_url":"https://api.github.com/repos/aquasecurity/kube-hunter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aquasecurity/kube-hunter/labels{/name}","releases_url":"https://api.github.com/repos/aquasecurity/kube-hunter/releases{/id}","deployments_url":"https://api.github.com/repos/aquasecurity/kube-hunter/deployments","created_at":"2018-07-18T14:39:06Z","updated_at":"2018-11-05T18:18:22Z","pushed_at":"2018-11-06T09:30:20Z","git_url":"git://github.com/aquasecurity/kube-hunter.git","ssh_url":"git@github.com:aquasecurity/kube-hunter.git","clone_url":"https://github.com/aquasecurity/kube-hunter.git","svn_url":"https://github.com/aquasecurity/kube-hunter","homepage":null,"size":577,"stargazers_count":731,"watchers_count":731,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":60,"open_issues":9,"watchers":731,"default_branch":"master"}},"base":{"label":"aquasecurity:master","ref":"master","sha":"df5d0bc3f6f5a7eca73159416cf743be286e3e70","user":{"login":"aquasecurity","id":12783832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzgzODMy","avatar_url":"https://avatars1.githubusercontent.com/u/12783832?v=4","gravatar_id":"","url":"https://api.github.com/users/aquasecurity","html_url":"https://github.com/aquasecurity","followers_url":"https://api.github.com/users/aquasecurity/followers","following_url":"https://api.github.com/users/aquasecurity/following{/other_user}","gists_url":"https://api.github.com/users/aquasecurity/gists{/gist_id}","starred_url":"https://api.github.com/users/aquasecurity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquasecurity/subscriptions","organizations_url":"https://api.github.com/users/aquasecurity/orgs","repos_url":"https://api.github.com/users/aquasecurity/repos","events_url":"https://api.github.com/users/aquasecurity/events{/privacy}","received_events_url":"https://api.github.com/users/aquasecurity/received_events","type":"Organization","site_admin":false},"repo":{"id":141447532,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE0NDc1MzI=","name":"kube-hunter","full_name":"aquasecurity/kube-hunter","private":false,"owner":{"login":"aquasecurity","id":12783832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzgzODMy","avatar_url":"https://avatars1.githubusercontent.com/u/12783832?v=4","gravatar_id":"","url":"https://api.github.com/users/aquasecurity","html_url":"https://github.com/aquasecurity","followers_url":"https://api.github.com/users/aquasecurity/followers","following_url":"https://api.github.com/users/aquasecurity/following{/other_user}","gists_url":"https://api.github.com/users/aquasecurity/gists{/gist_id}","starred_url":"https://api.github.com/users/aquasecurity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquasecurity/subscriptions","organizations_url":"https://api.github.com/users/aquasecurity/orgs","repos_url":"https://api.github.com/users/aquasecurity/repos","events_url":"https://api.github.com/users/aquasecurity/events{/privacy}","received_events_url":"https://api.github.com/users/aquasecurity/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aquasecurity/kube-hunter","description":"Hunt for security weaknesses in Kubernetes clusters","fork":false,"url":"https://api.github.com/repos/aquasecurity/kube-hunter","forks_url":"https://api.github.com/repos/aquasecurity/kube-hunter/forks","keys_url":"https://api.github.com/repos/aquasecurity/kube-hunter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aquasecurity/kube-hunter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aquasecurity/kube-hunter/teams","hooks_url":"https://api.github.com/repos/aquasecurity/kube-hunter/hooks","issue_events_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/events{/number}","events_url":"https://api.github.com/repos/aquasecurity/kube-hunter/events","assignees_url":"https://api.github.com/repos/aquasecurity/kube-hunter/assignees{/user}","branches_url":"https://api.github.com/repos/aquasecurity/kube-hunter/branches{/branch}","tags_url":"https://api.github.com/repos/aquasecurity/kube-hunter/tags","blobs_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/refs{/sha}","trees_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aquasecurity/kube-hunter/statuses/{sha}","languages_url":"https://api.github.com/repos/aquasecurity/kube-hunter/languages","stargazers_url":"https://api.github.com/repos/aquasecurity/kube-hunter/stargazers","contributors_url":"https://api.github.com/repos/aquasecurity/kube-hunter/contributors","subscribers_url":"https://api.github.com/repos/aquasecurity/kube-hunter/subscribers","subscription_url":"https://api.github.com/repos/aquasecurity/kube-hunter/subscription","commits_url":"https://api.github.com/repos/aquasecurity/kube-hunter/commits{/sha}","git_commits_url":"https://api.github.com/repos/aquasecurity/kube-hunter/git/commits{/sha}","comments_url":"https://api.github.com/repos/aquasecurity/kube-hunter/comments{/number}","issue_comment_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/comments{/number}","contents_url":"https://api.github.com/repos/aquasecurity/kube-hunter/contents/{+path}","compare_url":"https://api.github.com/repos/aquasecurity/kube-hunter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aquasecurity/kube-hunter/merges","archive_url":"https://api.github.com/repos/aquasecurity/kube-hunter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aquasecurity/kube-hunter/downloads","issues_url":"https://api.github.com/repos/aquasecurity/kube-hunter/issues{/number}","pulls_url":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls{/number}","milestones_url":"https://api.github.com/repos/aquasecurity/kube-hunter/milestones{/number}","notifications_url":"https://api.github.com/repos/aquasecurity/kube-hunter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aquasecurity/kube-hunter/labels{/name}","releases_url":"https://api.github.com/repos/aquasecurity/kube-hunter/releases{/id}","deployments_url":"https://api.github.com/repos/aquasecurity/kube-hunter/deployments","created_at":"2018-07-18T14:39:06Z","updated_at":"2018-11-05T18:18:22Z","pushed_at":"2018-11-06T09:30:20Z","git_url":"git://github.com/aquasecurity/kube-hunter.git","ssh_url":"git@github.com:aquasecurity/kube-hunter.git","clone_url":"https://github.com/aquasecurity/kube-hunter.git","svn_url":"https://github.com/aquasecurity/kube-hunter","homepage":null,"size":577,"stargazers_count":731,"watchers_count":731,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":60,"open_issues":9,"watchers":731,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53"},"html":{"href":"https://github.com/aquasecurity/kube-hunter/pull/53"},"issue":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/53"},"comments":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/aquasecurity/kube-hunter/statuses/1171c8ae20ac0f2614bd62800d3ef232c4e2da5f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lizrice"}}