{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/samson/pulls/comments/88361194","pull_request_review_id":8937661,"id":88361194,"diff_hunk":"@@ -0,0 +1,53 @@\n+# frozen_string_literal: true\n+\n+module SamsonAuditLog\n+  class AuditPresenter\n+    ## Presenter for Audit Logger\n+    class << self\n+      AVAILABLE_PRESENTERS = [\n+        :deploy,\n+        :deploy_group,\n+        :project,\n+        :stage,\n+        :user,\n+        :user_project_role\n+      ].freeze\n+\n+      def present(object)\n+        return unless object\n+        type = object.class.name.underscore.to_sym\n+        if AVAILABLE_PRESENTERS.include?(type)\n+          send(type, object)\n+        else\n+          object","path":"plugins/audit_log/lib/samson_audit_log/audit_presenter.rb","position":22,"original_position":22,"commit_id":"65d1d5dad98481f6f2ca667539272d8ca936825b","original_commit_id":"65d1d5dad98481f6f2ca667539272d8ca936825b","user":{"login":"rikeoka","id":11447948,"avatar_url":"https://avatars.githubusercontent.com/u/11447948?v=3","gravatar_id":"","url":"https://api.github.com/users/rikeoka","html_url":"https://github.com/rikeoka","followers_url":"https://api.github.com/users/rikeoka/followers","following_url":"https://api.github.com/users/rikeoka/following{/other_user}","gists_url":"https://api.github.com/users/rikeoka/gists{/gist_id}","starred_url":"https://api.github.com/users/rikeoka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikeoka/subscriptions","organizations_url":"https://api.github.com/users/rikeoka/orgs","repos_url":"https://api.github.com/users/rikeoka/repos","events_url":"https://api.github.com/users/rikeoka/events{/privacy}","received_events_url":"https://api.github.com/users/rikeoka/received_events","type":"User","site_admin":false},"body":"There are cases where I'm not sending over ActiveRecord objects to the presenter.  It would blow up on non JSON serializable objects.","created_at":"2016-11-17T00:13:51Z","updated_at":"2016-11-17T00:13:51Z","html_url":"https://github.com/zendesk/samson/pull/1460#discussion_r88361194","pull_request_url":"https://api.github.com/repos/zendesk/samson/pulls/1460","_links":{"self":{"href":"https://api.github.com/repos/zendesk/samson/pulls/comments/88361194"},"html":{"href":"https://github.com/zendesk/samson/pull/1460#discussion_r88361194"},"pull_request":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1460"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/samson/pulls/1460","id":92853510,"html_url":"https://github.com/zendesk/samson/pull/1460","diff_url":"https://github.com/zendesk/samson/pull/1460.diff","patch_url":"https://github.com/zendesk/samson/pull/1460.patch","issue_url":"https://api.github.com/repos/zendesk/samson/issues/1460","number":1460,"state":"open","locked":false,"title":"Splunk Audit Logging","user":{"login":"rikeoka","id":11447948,"avatar_url":"https://avatars.githubusercontent.com/u/11447948?v=3","gravatar_id":"","url":"https://api.github.com/users/rikeoka","html_url":"https://github.com/rikeoka","followers_url":"https://api.github.com/users/rikeoka/followers","following_url":"https://api.github.com/users/rikeoka/following{/other_user}","gists_url":"https://api.github.com/users/rikeoka/gists{/gist_id}","starred_url":"https://api.github.com/users/rikeoka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikeoka/subscriptions","organizations_url":"https://api.github.com/users/rikeoka/orgs","repos_url":"https://api.github.com/users/rikeoka/repos","events_url":"https://api.github.com/users/rikeoka/events{/privacy}","received_events_url":"https://api.github.com/users/rikeoka/received_events","type":"User","site_admin":false},"body":"Setup Audit Logging using Splunk for security monitoring of deploys\r\n\r\n/cc @zendesk/samson\r\n\r\n### Tasks\r\n - [x] Setup AUDIT_LOGGER\r\n - [x] Create AuditLog Plugin\r\n - [X] Add hook fire :audit_action for relevant controllers for modification of create/delete/modify of Projects, Users, DeployGroups, Stages and Environments\r\n - [X] Add hook fire :audit_actions for login/logout events success and fails\r\n - [X] Log hooks from before/after deploy and add hook fire :audit_action for buddy bypass\r\n - [X] Create AuditPresenter for relevant models\r\n - [ ] :+1: from team\r\n\r\n### References\r\n - Jira link: https://zendesk.atlassian.net/browse/SECC-2144\r\n\r\n### Risks\r\n- Level: Low","created_at":"2016-11-08T20:32:31Z","updated_at":"2016-11-17T00:13:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a893c993aa42eddb5f422a2b56b7efa48dc07ac","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/samson/pulls/1460/commits","review_comments_url":"https://api.github.com/repos/zendesk/samson/pulls/1460/comments","review_comment_url":"https://api.github.com/repos/zendesk/samson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/samson/issues/1460/comments","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/65d1d5dad98481f6f2ca667539272d8ca936825b","head":{"label":"zendesk:rikeoka/audit_logging","ref":"rikeoka/audit_logging","sha":"65d1d5dad98481f6f2ca667539272d8ca936825b","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":20208662,"name":"samson","full_name":"zendesk/samson","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/samson","description":"Web interface for deployments","fork":false,"url":"https://api.github.com/repos/zendesk/samson","forks_url":"https://api.github.com/repos/zendesk/samson/forks","keys_url":"https://api.github.com/repos/zendesk/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/samson/teams","hooks_url":"https://api.github.com/repos/zendesk/samson/hooks","issue_events_url":"https://api.github.com/repos/zendesk/samson/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/samson/events","assignees_url":"https://api.github.com/repos/zendesk/samson/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/samson/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/samson/tags","blobs_url":"https://api.github.com/repos/zendesk/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/samson/languages","stargazers_url":"https://api.github.com/repos/zendesk/samson/stargazers","contributors_url":"https://api.github.com/repos/zendesk/samson/contributors","subscribers_url":"https://api.github.com/repos/zendesk/samson/subscribers","subscription_url":"https://api.github.com/repos/zendesk/samson/subscription","commits_url":"https://api.github.com/repos/zendesk/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/samson/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/samson/merges","archive_url":"https://api.github.com/repos/zendesk/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/samson/downloads","issues_url":"https://api.github.com/repos/zendesk/samson/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/samson/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/samson/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/samson/deployments","created_at":"2014-05-27T05:55:57Z","updated_at":"2016-11-15T20:58:54Z","pushed_at":"2016-11-16T19:03:16Z","git_url":"git://github.com/zendesk/samson.git","ssh_url":"git@github.com:zendesk/samson.git","clone_url":"https://github.com/zendesk/samson.git","svn_url":"https://github.com/zendesk/samson","homepage":null,"size":214812,"stargazers_count":789,"watchers_count":789,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":56,"forks":157,"open_issues":56,"watchers":789,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"244a0b54dbaa1b2b67986b9d55762dee2f0246cd","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":20208662,"name":"samson","full_name":"zendesk/samson","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/samson","description":"Web interface for deployments","fork":false,"url":"https://api.github.com/repos/zendesk/samson","forks_url":"https://api.github.com/repos/zendesk/samson/forks","keys_url":"https://api.github.com/repos/zendesk/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/samson/teams","hooks_url":"https://api.github.com/repos/zendesk/samson/hooks","issue_events_url":"https://api.github.com/repos/zendesk/samson/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/samson/events","assignees_url":"https://api.github.com/repos/zendesk/samson/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/samson/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/samson/tags","blobs_url":"https://api.github.com/repos/zendesk/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/samson/languages","stargazers_url":"https://api.github.com/repos/zendesk/samson/stargazers","contributors_url":"https://api.github.com/repos/zendesk/samson/contributors","subscribers_url":"https://api.github.com/repos/zendesk/samson/subscribers","subscription_url":"https://api.github.com/repos/zendesk/samson/subscription","commits_url":"https://api.github.com/repos/zendesk/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/samson/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/samson/merges","archive_url":"https://api.github.com/repos/zendesk/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/samson/downloads","issues_url":"https://api.github.com/repos/zendesk/samson/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/samson/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/samson/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/samson/deployments","created_at":"2014-05-27T05:55:57Z","updated_at":"2016-11-15T20:58:54Z","pushed_at":"2016-11-16T19:03:16Z","git_url":"git://github.com/zendesk/samson.git","ssh_url":"git@github.com:zendesk/samson.git","clone_url":"https://github.com/zendesk/samson.git","svn_url":"https://github.com/zendesk/samson","homepage":null,"size":214812,"stargazers_count":789,"watchers_count":789,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":56,"forks":157,"open_issues":56,"watchers":789,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1460"},"html":{"href":"https://github.com/zendesk/samson/pull/1460"},"issue":{"href":"https://api.github.com/repos/zendesk/samson/issues/1460"},"comments":{"href":"https://api.github.com/repos/zendesk/samson/issues/1460/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1460/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/samson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1460/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/samson/statuses/65d1d5dad98481f6f2ca667539272d8ca936825b"}}}}
{"actor":{"display_login":"rikeoka"}}