diff --git a/checkpoint/1.0.0/api.yaml b/checkpoint/1.0.0/api.yaml index 395d8dd7..49678e56 100644 --- a/checkpoint/1.0.0/api.yaml +++ b/checkpoint/1.0.0/api.yaml @@ -29,7 +29,7 @@ authentication: example: "******" required: true schema: - type: string + type: string actions: - name: list_packages description: Executes the install-policy on a given list of targets. @@ -76,12 +76,12 @@ actions: description: Create new object. parameters: - name: host_list - description: List of hosts + description: 'List of hosts in {"name": "foo", "ip": "0.0.0.0"} format' required: true multiline: false - example: 'INTERNET' + example: '[{"name": "Everybody", "ip": "0.0.0.0"}, {"name": "Example", "ip": "1.2.3.4"}]' schema: - type: array + type: string - name: ssl_verify description: Set ssl verification example: "False" diff --git a/checkpoint/1.0.0/src/app.py b/checkpoint/1.0.0/src/app.py index 42ad9d53..99209121 100644 --- a/checkpoint/1.0.0/src/app.py +++ b/checkpoint/1.0.0/src/app.py @@ -145,8 +145,8 @@ def add_host(self, ip_addr:str, user:str, password:str, host_list:list, ssl_veri } for host in host_list: json_payload = { - 'name': host, - 'ip-address' : host + 'name': host['name'], + 'ip-address' : host['ip'] } response = requests.post(url, data=json.dumps(json_payload), headers=request_headers, verify=ssl_verify) if response.json().get('errors') == None and response.json().get('warnings') == None : diff --git a/email/1.2.0/src/app.py b/email/1.2.0/src/app.py index 3187c900..c7ca4333 100644 --- a/email/1.2.0/src/app.py +++ b/email/1.2.0/src/app.py @@ -13,6 +13,7 @@ import mailparser import extract_msg import jsonpickle +import ssl from glom import glom from msg_parser import MsOxMessage @@ -82,6 +83,7 @@ def send_email_smtp( except ValueError: return "SMTP port needs to be a number (Current: %s)" % smtp_port + context=ssl.create_default_context() try: s = smtplib.SMTP(host=smtp_host, port=smtp_port) except socket.gaierror as e: @@ -92,9 +94,9 @@ def send_email_smtp( if ssl_verify == "false" or ssl_verify == "False": pass else: - s.starttls() + s.starttls(context=context) - if len(username) > 0 or len(password) > 0: + if (len(username) > 0 or len(password) > 0) and not password == '.': try: s.login(username, password) except smtplib.SMTPAuthenticationError as e: