offlinesec-client 1.1.0__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/PKG-INFO +1 -1
  2. offlinesec_client-1.1.2/offlinesec_client/__init__.py +1 -0
  3. offlinesec_client-1.1.2/offlinesec_client/api_sec_notes.py +60 -0
  4. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_patch_day.py +4 -1
  5. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_sec_notes.py +4 -1
  6. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/resolve_report.py +3 -3
  7. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client.egg-info/PKG-INFO +1 -1
  8. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client.egg-info/SOURCES.txt +1 -0
  9. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client.egg-info/entry_points.txt +1 -0
  10. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/setup.py +1 -0
  11. offlinesec_client-1.1.0/offlinesec_client/__init__.py +0 -1
  12. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/README.md +0 -0
  13. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/__main__.py +0 -0
  14. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/abap_system.py +0 -0
  15. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/agr_1251.py +0 -0
  16. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/bo_system.py +0 -0
  17. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/config.py +0 -0
  18. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/const.py +0 -0
  19. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/cwbntcust.py +0 -0
  20. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/func.py +0 -0
  21. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/get_reports.py +0 -0
  22. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/java_system.py +0 -0
  23. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/multi_systems.py +0 -0
  24. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_bo_notes.py +0 -0
  25. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_java_notes.py +0 -0
  26. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_notes_report.py +0 -0
  27. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_param_report.py +0 -0
  28. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/req_roles_report.py +0 -0
  29. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/rsparam.py +0 -0
  30. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/sap_gui.py +0 -0
  31. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client/sap_system.py +0 -0
  32. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client.egg-info/dependency_links.txt +0 -0
  33. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client.egg-info/requires.txt +0 -0
  34. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/offlinesec_client.egg-info/top_level.txt +0 -0
  35. {offlinesec_client-1.1.0 → offlinesec_client-1.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: offlinesec_client
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: Offline Security Client
5
5
  Home-page: https://offlinesec.com
6
6
  Author: Offline Security
@@ -0,0 +1 @@
1
+ __version__ = "1.1.2"
@@ -0,0 +1,60 @@
1
+ import argparse
2
+ import yaml
3
+ import sys
4
+ import time
5
+ import os
6
+ import offlinesec_client.func
7
+ from offlinesec_client.const import FILE
8
+ from offlinesec_client.multi_systems import process_yaml_file
9
+
10
+
11
+ # SUPPORTED_SYSTEMS = ["ABAP", "JAVA", "BO", "HANA"]
12
+ UPLOAD_URL = "/sec-notes"
13
+
14
+
15
+ def check_file_arg(s):
16
+ res = offlinesec_client.func.check_file_arg(s, ['yaml'], 200000)
17
+ with open(s, 'r') as file:
18
+ yaml_content = yaml.safe_load(file)
19
+ if "sap_systems" not in yaml_content:
20
+ raise argparse.ArgumentTypeError("Wrong the YAML file (%s) structure. The 'sap_systems' key not found" % (s,))
21
+ return res
22
+
23
+
24
+ def init_args():
25
+ parser = argparse.ArgumentParser()
26
+ parser.add_argument("-f", "--file", action="store", type=check_file_arg,
27
+ help="File Name (SAP systems (ABAP, JAVA, BO, ...) and their software components in YAML format)", required=True)
28
+ parser.add_argument('-p', '--patch_day', action='store_true', help="Last Patch Day Variant")
29
+ parser.add_argument('-', '--id', action='store', help="The Scan ID (any unique identifier)")
30
+ parser.parse_args()
31
+ return vars(parser.parse_args())
32
+
33
+
34
+ def print_errors(errors):
35
+ for error in errors:
36
+ print(error)
37
+
38
+
39
+ def process_it(args):
40
+ systems = process_yaml_file(args)
41
+ additional_keys = dict()
42
+ if args["patch_day"]:
43
+ additional_keys["patch_day"] = True
44
+ additional_keys["api_call"] = True
45
+ if args["id"]:
46
+ additional_keys["id"] = args["id"]
47
+ offlinesec_client.func.send_to_server(systems, UPLOAD_URL, additional_keys)
48
+
49
+
50
+ def main():
51
+ args = init_args()
52
+ if FILE in args and args[FILE]:
53
+ process_it(args)
54
+ else:
55
+ print("Please choose the configuration YAML file (-f option)")
56
+
57
+
58
+ if __name__ == '__main__':
59
+ main()
60
+
@@ -25,7 +25,8 @@ def init_args():
25
25
  parser = argparse.ArgumentParser()
26
26
  parser.add_argument("-f", "--file", action="store", type=check_file_arg,
27
27
  help="File Name (SAP systems (ABAP, JAVA, BO, ...) and their software components in YAML format)", required=True)
28
- parser.add_argument('--wait', action='store_true', help="Wait 5 minutes and download the report")
28
+ parser.add_argument('-w', '--wait', action='store_true', help="Wait 5 minutes and download the report")
29
+ parser.add_argument('-i', '--id', action='store', help="The scan Id (any unique identifier)")
29
30
  parser.parse_args()
30
31
  return vars(parser.parse_args())
31
32
 
@@ -39,6 +40,8 @@ def process_it(args):
39
40
  systems = process_yaml_file(args)
40
41
  additional_keys = dict()
41
42
  additional_keys["patch_day"] = True
43
+ if args["id"]:
44
+ additional_keys["id"] = args["id"]
42
45
  offlinesec_client.func.send_to_server(systems, UPLOAD_URL, additional_keys)
43
46
 
44
47
  wait = args["wait"]
@@ -25,7 +25,8 @@ def init_args():
25
25
  parser = argparse.ArgumentParser()
26
26
  parser.add_argument("-f", "--file", action="store", type=check_file_arg,
27
27
  help="File Name (SAP systems (ABAP, JAVA, BO, ...) and their software components in YAML format)", required=True)
28
- parser.add_argument('--wait', action='store_true', help="Wait 5 minutes and download the report")
28
+ parser.add_argument('-w', '--wait', action='store_true', help="Wait 5 minutes and download the report")
29
+ parser.add_argument('-i', '--id', action='store', help="The scan Id (any unique identifier)")
29
30
  parser.parse_args()
30
31
  return vars(parser.parse_args())
31
32
 
@@ -38,6 +39,8 @@ def print_errors(errors):
38
39
  def process_it(args):
39
40
  systems = process_yaml_file(args)
40
41
  additional_keys = dict()
42
+ if args["id"]:
43
+ additional_keys["id"] = args["id"]
41
44
  offlinesec_client.func.send_to_server(systems, UPLOAD_URL, additional_keys)
42
45
 
43
46
  wait = args["wait"]
@@ -47,9 +47,9 @@ def read_file(file):
47
47
  ws = wb.worksheets[1]
48
48
  resolve_roles_page2(ws, roles)
49
49
 
50
- img = openpyxl.drawing.image.Image('logo.jpg')
51
- img.anchor = 'A1'
52
- ws.add_image(img)
50
+ #img = openpyxl.drawing.image.Image('logo.jpg')
51
+ #img.anchor = 'A1'
52
+ #ws.add_image(img)
53
53
 
54
54
  wb.save(file)
55
55
  print(" * Roles in file %s have been converted" % (os.path.basename(file),))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: offlinesec-client
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: Offline Security Client
5
5
  Home-page: https://offlinesec.com
6
6
  Author: Offline Security
@@ -4,6 +4,7 @@ offlinesec_client/__init__.py
4
4
  offlinesec_client/__main__.py
5
5
  offlinesec_client/abap_system.py
6
6
  offlinesec_client/agr_1251.py
7
+ offlinesec_client/api_sec_notes.py
7
8
  offlinesec_client/bo_system.py
8
9
  offlinesec_client/config.py
9
10
  offlinesec_client/const.py
@@ -1,4 +1,5 @@
1
1
  [console_scripts]
2
+ offlinesec_api_secnotes = offlinesec_client.api_sec_notes:main
2
3
  offlinesec_bo_notes = offlinesec_client.req_bo_notes:main
3
4
  offlinesec_get_reports = offlinesec_client.get_reports:main
4
5
  offlinesec_inverse_transform = offlinesec_client.resolve_report:main
@@ -20,6 +20,7 @@ setup(
20
20
  entry_points={'console_scripts': ['offlinesec_sap_notes = offlinesec_client.req_notes_report:main',
21
21
  'offlinesec_sec_notes = offlinesec_client.req_sec_notes:main',
22
22
  'offlinesec_patch_day = offlinesec_client.req_patch_day:main',
23
+ 'offlinesec_api_secnotes = offlinesec_client.api_sec_notes:main',
23
24
  'offlinesec_get_reports = offlinesec_client.get_reports:main',
24
25
  'offlinesec_sap_params = offlinesec_client.req_param_report:main',
25
26
  'offlinesec_sap_roles = offlinesec_client.req_roles_report:main',
@@ -1 +0,0 @@
1
- __version__ = "1.1.0"