From 156d5564e835928a8134d2ff53b6caed7a2cc6e1 Mon Sep 17 00:00:00 2001
From: Alexandre Dulaunoy
Date: Thu, 17 Sep 2020 07:40:13 +0200
Subject: [PATCH 1/2] chg: [add_github_user] more fields added from the GitHub
API
---
examples/add_github_user.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/examples/add_github_user.py b/examples/add_github_user.py
index ef6005e..870f0ef 100755
--- a/examples/add_github_user.py
+++ b/examples/add_github_user.py
@@ -52,4 +52,11 @@ if __name__ == '__main__':
misp_object.add_attribute('link', github_user['html_url'])
misp_object.add_attribute('user-fullname', github_user['name'])
misp_object.add_attribute('username', github_user['login'])
+ misp_object.add_attribute('twitter_username', github_user['twitter_username'])
+ misp_object.add_attribute('location', github_user['location'])
+ misp_object.add_attribute('company', github_user['company'])
+ misp_object.add_attribute('public_gists', github_user['public_gists'])
+ misp_object.add_attribute('public_repos', github_user['public_repos'])
+ misp_object.add_attribute('blog', github_user['blog'])
+ misp_object.add_attribute('node_id', github_user['node_id'])
retcode = pymisp.add_object(args.event, misp_object)
From 0e0424fa3001bd23d2e84010f5444b9125291e07 Mon Sep 17 00:00:00 2001
From: Alexandre Dulaunoy
Date: Thu, 17 Sep 2020 10:36:54 +0200
Subject: [PATCH 2/2] chg: [add_github_user] add ssh keys of the user in the
MISP object
---
examples/add_github_user.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/examples/add_github_user.py b/examples/add_github_user.py
index 870f0ef..07b8abb 100755
--- a/examples/add_github_user.py
+++ b/examples/add_github_user.py
@@ -46,8 +46,11 @@ if __name__ == '__main__':
followers = rfollowers.json()
rfollowing = requests.get("https://api.github.com/users/{}/following".format(args.username))
followings = rfollowing.json()
+ rkeys = requests.get("https://api.github.com/users/{}/keys".format(args.username))
+ keys = rkeys.json()
misp_object.add_attributes("follower", *[follower['login'] for follower in followers])
misp_object.add_attributes("following", *[following['login'] for following in followings])
+ misp_object.add_attributes("ssh-public-key", *[sshkey['key'] for sshkey in keys])
misp_object.add_attribute('bio', github_user['bio'])
misp_object.add_attribute('link', github_user['html_url'])
misp_object.add_attribute('user-fullname', github_user['name'])