From 0e0424fa3001bd23d2e84010f5444b9125291e07 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Thu, 17 Sep 2020 10:36:54 +0200 Subject: [PATCH] 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'])