{"action":"created","comment":{"url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/comments/172717776","pull_request_review_id":101782681,"id":172717776,"diff_hunk":"@@ -115,16 +120,29 @@ def grab_secrets(self):\n                   with open(output_path, 'w') as cert_file:\n                       cert_file.write(self.cert_to_pem(cert.cer))\n \n+    def dump_secret(self, secret):\n+              value = base64.decodestring(secret.value)\n+              if secret.tags is not None and 'file-encoding' in secret.tags:\n+                     encoding = secret.tags['file-encoding']\n+                     if encoding == 'base64':\n+                                 value = base64.decodestring(value)\n+\n+              return value\n+\n     def dump_pfx(self, pfx, name):\n-              import base64\n               from OpenSSL import crypto\n               p12 = crypto.load_pkcs12(base64.decodestring(pfx))\n               pk = crypto.dump_privatekey(crypto.FILETYPE_PEM, p12.get_privatekey())\n               cert = crypto.dump_certificate(crypto.FILETYPE_PEM, p12.get_certificate())\n+              ca_certs = p12.get_ca_certificates()\n               with open(os.path.join(self.keys_output_folder, name), 'w') as key_file:\n                     key_file.write(pk)\n               with open(os.path.join(self.certs_output_folder, name), 'w') as cert_file:\n                     cert_file.write(cert)\n+              if ca_certs is not None:","path":"app/main.py","position":null,"original_position":49,"commit_id":"73b44960bb2169a5da1d59eae6c5a48f53ce0f58","original_commit_id":"af92d698fe21702dceb42ce950ece5db640ae055","user":{"login":"technicianted","id":26074659,"avatar_url":"https://avatars3.githubusercontent.com/u/26074659?v=4","gravatar_id":"","url":"https://api.github.com/users/technicianted","html_url":"https://github.com/technicianted","followers_url":"https://api.github.com/users/technicianted/followers","following_url":"https://api.github.com/users/technicianted/following{/other_user}","gists_url":"https://api.github.com/users/technicianted/gists{/gist_id}","starred_url":"https://api.github.com/users/technicianted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicianted/subscriptions","organizations_url":"https://api.github.com/users/technicianted/orgs","repos_url":"https://api.github.com/users/technicianted/repos","events_url":"https://api.github.com/users/technicianted/events{/privacy}","received_events_url":"https://api.github.com/users/technicianted/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-03-07T01:35:51Z","updated_at":"2018-03-07T01:35:51Z","html_url":"https://github.com/Hexadite/acs-keyvault-agent/pull/5#discussion_r172717776","pull_request_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/comments/172717776"},"html":{"href":"https://github.com/Hexadite/acs-keyvault-agent/pull/5#discussion_r172717776"},"pull_request":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5"}},"in_reply_to_id":171810558},"pull_request":{"url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5","id":172322645,"html_url":"https://github.com/Hexadite/acs-keyvault-agent/pull/5","diff_url":"https://github.com/Hexadite/acs-keyvault-agent/pull/5.diff","patch_url":"https://github.com/Hexadite/acs-keyvault-agent/pull/5.patch","issue_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues/5","number":5,"state":"open","locked":false,"title":"Support certificate chains and base64 decode secrets","user":{"login":"technicianted","id":26074659,"avatar_url":"https://avatars3.githubusercontent.com/u/26074659?v=4","gravatar_id":"","url":"https://api.github.com/users/technicianted","html_url":"https://github.com/technicianted","followers_url":"https://api.github.com/users/technicianted/followers","following_url":"https://api.github.com/users/technicianted/following{/other_user}","gists_url":"https://api.github.com/users/technicianted/gists{/gist_id}","starred_url":"https://api.github.com/users/technicianted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicianted/subscriptions","organizations_url":"https://api.github.com/users/technicianted/orgs","repos_url":"https://api.github.com/users/technicianted/repos","events_url":"https://api.github.com/users/technicianted/events{/privacy}","received_events_url":"https://api.github.com/users/technicianted/received_events","type":"User","site_admin":false},"body":"This PR adds support to decode certificate chains if included in certificates in KeyVault. In addition, if the the requested secret had `base64` encoding, it will be automatically decoded.","created_at":"2018-03-01T18:54:53Z","updated_at":"2018-03-07T01:35:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34a4965f0ea0cf1737a00f72f3f6291fd0057d00","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues/5/comments","statuses_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/statuses/73b44960bb2169a5da1d59eae6c5a48f53ce0f58","head":{"label":"technicianted:master","ref":"master","sha":"73b44960bb2169a5da1d59eae6c5a48f53ce0f58","user":{"login":"technicianted","id":26074659,"avatar_url":"https://avatars3.githubusercontent.com/u/26074659?v=4","gravatar_id":"","url":"https://api.github.com/users/technicianted","html_url":"https://github.com/technicianted","followers_url":"https://api.github.com/users/technicianted/followers","following_url":"https://api.github.com/users/technicianted/following{/other_user}","gists_url":"https://api.github.com/users/technicianted/gists{/gist_id}","starred_url":"https://api.github.com/users/technicianted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicianted/subscriptions","organizations_url":"https://api.github.com/users/technicianted/orgs","repos_url":"https://api.github.com/users/technicianted/repos","events_url":"https://api.github.com/users/technicianted/events{/privacy}","received_events_url":"https://api.github.com/users/technicianted/received_events","type":"User","site_admin":false},"repo":{"id":114306607,"name":"acs-keyvault-agent","full_name":"technicianted/acs-keyvault-agent","owner":{"login":"technicianted","id":26074659,"avatar_url":"https://avatars3.githubusercontent.com/u/26074659?v=4","gravatar_id":"","url":"https://api.github.com/users/technicianted","html_url":"https://github.com/technicianted","followers_url":"https://api.github.com/users/technicianted/followers","following_url":"https://api.github.com/users/technicianted/following{/other_user}","gists_url":"https://api.github.com/users/technicianted/gists{/gist_id}","starred_url":"https://api.github.com/users/technicianted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicianted/subscriptions","organizations_url":"https://api.github.com/users/technicianted/orgs","repos_url":"https://api.github.com/users/technicianted/repos","events_url":"https://api.github.com/users/technicianted/events{/privacy}","received_events_url":"https://api.github.com/users/technicianted/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/technicianted/acs-keyvault-agent","description":"A Azure Key Vault agent container that grabs secrets from Azure Key Vault securely and passes them to other containers in its pod","fork":true,"url":"https://api.github.com/repos/technicianted/acs-keyvault-agent","forks_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/forks","keys_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/teams","hooks_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/hooks","issue_events_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/issues/events{/number}","events_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/events","assignees_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/assignees{/user}","branches_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/branches{/branch}","tags_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/tags","blobs_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/languages","stargazers_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/stargazers","contributors_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/contributors","subscribers_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/subscribers","subscription_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/subscription","commits_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/contents/{+path}","compare_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/merges","archive_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/downloads","issues_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/issues{/number}","pulls_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/labels{/name}","releases_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/releases{/id}","deployments_url":"https://api.github.com/repos/technicianted/acs-keyvault-agent/deployments","created_at":"2017-12-14T23:38:52Z","updated_at":"2017-12-14T23:38:53Z","pushed_at":"2018-03-07T01:30:11Z","git_url":"git://github.com/technicianted/acs-keyvault-agent.git","ssh_url":"git@github.com:technicianted/acs-keyvault-agent.git","clone_url":"https://github.com/technicianted/acs-keyvault-agent.git","svn_url":"https://github.com/technicianted/acs-keyvault-agent","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Hexadite:master","ref":"master","sha":"59d1d8ae52cd679655018e35d334ada9f2f901d6","user":{"login":"Hexadite","id":8150291,"avatar_url":"https://avatars2.githubusercontent.com/u/8150291?v=4","gravatar_id":"","url":"https://api.github.com/users/Hexadite","html_url":"https://github.com/Hexadite","followers_url":"https://api.github.com/users/Hexadite/followers","following_url":"https://api.github.com/users/Hexadite/following{/other_user}","gists_url":"https://api.github.com/users/Hexadite/gists{/gist_id}","starred_url":"https://api.github.com/users/Hexadite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hexadite/subscriptions","organizations_url":"https://api.github.com/users/Hexadite/orgs","repos_url":"https://api.github.com/users/Hexadite/repos","events_url":"https://api.github.com/users/Hexadite/events{/privacy}","received_events_url":"https://api.github.com/users/Hexadite/received_events","type":"Organization","site_admin":false},"repo":{"id":113326695,"name":"acs-keyvault-agent","full_name":"Hexadite/acs-keyvault-agent","owner":{"login":"Hexadite","id":8150291,"avatar_url":"https://avatars2.githubusercontent.com/u/8150291?v=4","gravatar_id":"","url":"https://api.github.com/users/Hexadite","html_url":"https://github.com/Hexadite","followers_url":"https://api.github.com/users/Hexadite/followers","following_url":"https://api.github.com/users/Hexadite/following{/other_user}","gists_url":"https://api.github.com/users/Hexadite/gists{/gist_id}","starred_url":"https://api.github.com/users/Hexadite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hexadite/subscriptions","organizations_url":"https://api.github.com/users/Hexadite/orgs","repos_url":"https://api.github.com/users/Hexadite/repos","events_url":"https://api.github.com/users/Hexadite/events{/privacy}","received_events_url":"https://api.github.com/users/Hexadite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Hexadite/acs-keyvault-agent","description":"A Azure Key Vault agent container that grabs secrets from Azure Key Vault securely and passes them to other containers in its pod","fork":false,"url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent","forks_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/forks","keys_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/teams","hooks_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/hooks","issue_events_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/events","assignees_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/tags","blobs_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/languages","stargazers_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/stargazers","contributors_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/contributors","subscribers_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/subscribers","subscription_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/subscription","commits_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/merges","archive_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/downloads","issues_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/labels{/name}","releases_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/releases{/id}","deployments_url":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/deployments","created_at":"2017-12-06T14:29:31Z","updated_at":"2018-03-05T22:17:32Z","pushed_at":"2018-03-07T01:30:12Z","git_url":"git://github.com/Hexadite/acs-keyvault-agent.git","ssh_url":"git@github.com:Hexadite/acs-keyvault-agent.git","clone_url":"https://github.com/Hexadite/acs-keyvault-agent.git","svn_url":"https://github.com/Hexadite/acs-keyvault-agent","homepage":null,"size":18,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5"},"html":{"href":"https://github.com/Hexadite/acs-keyvault-agent/pull/5"},"issue":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues/5"},"comments":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Hexadite/acs-keyvault-agent/statuses/73b44960bb2169a5da1d59eae6c5a48f53ce0f58"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"technicianted"}}