{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/osquery/pulls/comments/91642308","pull_request_review_id":12068009,"id":91642308,"diff_hunk":"@@ -0,0 +1,113 @@\n+/*\n+ *  Copyright (c) 2016-present, Jean-Francois Dive <jfdive@gmail.com>\n+ *  All rights reserved.\n+ *\n+ *  This source code is licensed under the BSD-style license found in the\n+ *  LICENSE file in the root directory of this source tree. An additional grant\n+ *  of patent rights can be found in the PATENTS file in the same directory.\n+ *\n+ */\n+\n+#pragma once\n+\n+#include <string>\n+\n+#include \"include/osquery/tables.h\"\n+\n+namespace osquery {\n+namespace tables {\n+\n+/**\n+ * @brief SuperClass for AWS metadata accessors\n+ */\n+class AwsData {\n+  protected:\n+  /**\n+   * @brief SQL type for the value\n+   */\n+  ColumnType sqlType;\n+\n+  /**\n+   * @brief SQL column name\n+   */\n+  std::string fieldName;\n+\n+  /**\n+   * @brief API URL\n+   */\n+  std::string subUrl;\n+\n+  /**\n+   * @brief HTTP get the data\n+   *\n+   * @return osquery Status\n+   */\n+  std::string DoGet();\n+\n+  public:\n+  /**\n+   * @brief ctor\n+   */\n+  AwsData(ColumnType in_sqlType, std::string in_fieldName, std::string in_subUrl) {\n+    sqlType = in_sqlType;\n+    fieldName = in_fieldName;\n+    subUrl = in_subUrl;\n+  }\n+\n+  /**\n+   * @brief dtor\n+   */\n+  virtual ~AwsData() {}\n+\n+  /**\n+   * @brief Extract relevant data from return API call, pure virtual\n+   *\n+   * @param r The row to which the value need to be added\n+   * @param http_body content of the http response body\n+   * @return osquery Status\n+   */\n+  virtual Status ExtractResult(Row& r, std::string http_body) = 0;","path":"osquery/tables/networking/aws_metadata.h","position":69,"original_position":69,"commit_id":"e3facd8e7016bc96ca55a9839979395c16ee3bef","original_commit_id":"e3facd8e7016bc96ca55a9839979395c16ee3bef","user":{"login":"theopolis","id":981645,"avatar_url":"https://avatars.githubusercontent.com/u/981645?v=3","gravatar_id":"","url":"https://api.github.com/users/theopolis","html_url":"https://github.com/theopolis","followers_url":"https://api.github.com/users/theopolis/followers","following_url":"https://api.github.com/users/theopolis/following{/other_user}","gists_url":"https://api.github.com/users/theopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/theopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theopolis/subscriptions","organizations_url":"https://api.github.com/users/theopolis/orgs","repos_url":"https://api.github.com/users/theopolis/repos","events_url":"https://api.github.com/users/theopolis/events{/privacy}","received_events_url":"https://api.github.com/users/theopolis/received_events","type":"User","site_admin":false},"body":"It looks like this can be marked `const`.","created_at":"2016-12-09T01:08:54Z","updated_at":"2016-12-09T01:09:54Z","html_url":"https://github.com/facebook/osquery/pull/2853#discussion_r91642308","pull_request_url":"https://api.github.com/repos/facebook/osquery/pulls/2853","_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/91642308"},"html":{"href":"https://github.com/facebook/osquery/pull/2853#discussion_r91642308"},"pull_request":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2853"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/2853","id":97070456,"html_url":"https://github.com/facebook/osquery/pull/2853","diff_url":"https://github.com/facebook/osquery/pull/2853.diff","patch_url":"https://github.com/facebook/osquery/pull/2853.patch","issue_url":"https://api.github.com/repos/facebook/osquery/issues/2853","number":2853,"state":"open","locked":false,"title":"(#2852) implement AWS metadata query","user":{"login":"jfdive","id":16338096,"avatar_url":"https://avatars.githubusercontent.com/u/16338096?v=3","gravatar_id":"","url":"https://api.github.com/users/jfdive","html_url":"https://github.com/jfdive","followers_url":"https://api.github.com/users/jfdive/followers","following_url":"https://api.github.com/users/jfdive/following{/other_user}","gists_url":"https://api.github.com/users/jfdive/gists{/gist_id}","starred_url":"https://api.github.com/users/jfdive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfdive/subscriptions","organizations_url":"https://api.github.com/users/jfdive/orgs","repos_url":"https://api.github.com/users/jfdive/repos","events_url":"https://api.github.com/users/jfdive/events{/privacy}","received_events_url":"https://api.github.com/users/jfdive/received_events","type":"User","site_admin":false},"body":"This is an initial implementation which give access to a subset of data available trough the AWS metadata REST server capabilities. Let's note a lack of testing function which would require refactoring the way AwsData super class GET it's data, to be done.","created_at":"2016-12-08T07:13:36Z","updated_at":"2016-12-09T01:09:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08cd56ed057f4a4a3e126d6c9d22cde8a27c7d90","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/osquery/pulls/2853/commits","review_comments_url":"https://api.github.com/repos/facebook/osquery/pulls/2853/comments","review_comment_url":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/2853/comments","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/e3facd8e7016bc96ca55a9839979395c16ee3bef","head":{"label":"jfdive:master","ref":"master","sha":"e3facd8e7016bc96ca55a9839979395c16ee3bef","user":{"login":"jfdive","id":16338096,"avatar_url":"https://avatars.githubusercontent.com/u/16338096?v=3","gravatar_id":"","url":"https://api.github.com/users/jfdive","html_url":"https://github.com/jfdive","followers_url":"https://api.github.com/users/jfdive/followers","following_url":"https://api.github.com/users/jfdive/following{/other_user}","gists_url":"https://api.github.com/users/jfdive/gists{/gist_id}","starred_url":"https://api.github.com/users/jfdive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfdive/subscriptions","organizations_url":"https://api.github.com/users/jfdive/orgs","repos_url":"https://api.github.com/users/jfdive/repos","events_url":"https://api.github.com/users/jfdive/events{/privacy}","received_events_url":"https://api.github.com/users/jfdive/received_events","type":"User","site_admin":false},"repo":{"id":75706428,"name":"osquery","full_name":"jfdive/osquery","owner":{"login":"jfdive","id":16338096,"avatar_url":"https://avatars.githubusercontent.com/u/16338096?v=3","gravatar_id":"","url":"https://api.github.com/users/jfdive","html_url":"https://github.com/jfdive","followers_url":"https://api.github.com/users/jfdive/followers","following_url":"https://api.github.com/users/jfdive/following{/other_user}","gists_url":"https://api.github.com/users/jfdive/gists{/gist_id}","starred_url":"https://api.github.com/users/jfdive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfdive/subscriptions","organizations_url":"https://api.github.com/users/jfdive/orgs","repos_url":"https://api.github.com/users/jfdive/repos","events_url":"https://api.github.com/users/jfdive/events{/privacy}","received_events_url":"https://api.github.com/users/jfdive/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jfdive/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/jfdive/osquery","forks_url":"https://api.github.com/repos/jfdive/osquery/forks","keys_url":"https://api.github.com/repos/jfdive/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jfdive/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jfdive/osquery/teams","hooks_url":"https://api.github.com/repos/jfdive/osquery/hooks","issue_events_url":"https://api.github.com/repos/jfdive/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/jfdive/osquery/events","assignees_url":"https://api.github.com/repos/jfdive/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/jfdive/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/jfdive/osquery/tags","blobs_url":"https://api.github.com/repos/jfdive/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jfdive/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jfdive/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/jfdive/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jfdive/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/jfdive/osquery/languages","stargazers_url":"https://api.github.com/repos/jfdive/osquery/stargazers","contributors_url":"https://api.github.com/repos/jfdive/osquery/contributors","subscribers_url":"https://api.github.com/repos/jfdive/osquery/subscribers","subscription_url":"https://api.github.com/repos/jfdive/osquery/subscription","commits_url":"https://api.github.com/repos/jfdive/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/jfdive/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/jfdive/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/jfdive/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/jfdive/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/jfdive/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jfdive/osquery/merges","archive_url":"https://api.github.com/repos/jfdive/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jfdive/osquery/downloads","issues_url":"https://api.github.com/repos/jfdive/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/jfdive/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/jfdive/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/jfdive/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jfdive/osquery/labels{/name}","releases_url":"https://api.github.com/repos/jfdive/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/jfdive/osquery/deployments","created_at":"2016-12-06T07:31:08Z","updated_at":"2016-12-06T07:31:11Z","pushed_at":"2016-12-08T07:02:23Z","git_url":"git://github.com/jfdive/osquery.git","ssh_url":"git@github.com:jfdive/osquery.git","clone_url":"https://github.com/jfdive/osquery.git","svn_url":"https://github.com/jfdive/osquery","homepage":"https://osquery.io","size":9659,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"facebook:master","ref":"master","sha":"272771acb8b615024472ecaf8ae0517bb2a365a8","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":22394357,"name":"osquery","full_name":"facebook/osquery","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":false,"url":"https://api.github.com/repos/facebook/osquery","forks_url":"https://api.github.com/repos/facebook/osquery/forks","keys_url":"https://api.github.com/repos/facebook/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/osquery/teams","hooks_url":"https://api.github.com/repos/facebook/osquery/hooks","issue_events_url":"https://api.github.com/repos/facebook/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/osquery/events","assignees_url":"https://api.github.com/repos/facebook/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/osquery/tags","blobs_url":"https://api.github.com/repos/facebook/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/osquery/languages","stargazers_url":"https://api.github.com/repos/facebook/osquery/stargazers","contributors_url":"https://api.github.com/repos/facebook/osquery/contributors","subscribers_url":"https://api.github.com/repos/facebook/osquery/subscribers","subscription_url":"https://api.github.com/repos/facebook/osquery/subscription","commits_url":"https://api.github.com/repos/facebook/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/osquery/merges","archive_url":"https://api.github.com/repos/facebook/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/osquery/downloads","issues_url":"https://api.github.com/repos/facebook/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/osquery/labels{/name}","releases_url":"https://api.github.com/repos/facebook/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/osquery/deployments","created_at":"2014-07-29T20:27:33Z","updated_at":"2016-12-08T23:38:38Z","pushed_at":"2016-12-08T17:11:53Z","git_url":"git://github.com/facebook/osquery.git","ssh_url":"git@github.com:facebook/osquery.git","clone_url":"https://github.com/facebook/osquery.git","svn_url":"https://github.com/facebook/osquery","homepage":"https://osquery.io","size":13962,"stargazers_count":7525,"watchers_count":7525,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":873,"mirror_url":null,"open_issues_count":86,"forks":873,"open_issues":86,"watchers":7525,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2853"},"html":{"href":"https://github.com/facebook/osquery/pull/2853"},"issue":{"href":"https://api.github.com/repos/facebook/osquery/issues/2853"},"comments":{"href":"https://api.github.com/repos/facebook/osquery/issues/2853/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2853/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2853/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/osquery/statuses/e3facd8e7016bc96ca55a9839979395c16ee3bef"}}}}
{"actor":{"display_login":"theopolis"}}