PyMISP/examples/edit_user.py

21 lines
722 B
Python
Raw Permalink Normal View History

2016-11-03 11:23:48 +01:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
2019-07-17 16:46:47 +02:00
from pymisp import ExpandedPyMISP, MISPUser
from keys import misp_url, misp_key, misp_verifycert
2016-11-03 11:23:48 +01:00
import argparse
if __name__ == '__main__':
2016-11-04 11:58:21 +01:00
parser = argparse.ArgumentParser(description='Edit the email of the user designed by the user_id.')
2016-11-03 11:23:48 +01:00
parser.add_argument("-i", "--user_id", required=True, help="The name of the json file describing the user you want to modify.")
2016-11-04 11:58:21 +01:00
parser.add_argument("-e", "--email", help="Email linked to the account.")
2016-11-03 11:23:48 +01:00
args = parser.parse_args()
2019-07-17 16:46:47 +02:00
misp = ExpandedPyMISP(misp_url, misp_key, misp_verifycert)
user = MISPUser
user.id = args.user_id
user.email = args.email
2016-11-03 11:23:48 +01:00
2019-07-17 16:46:47 +02:00
print(misp.edit_user(user, pythonify=True))