You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/batch_policy_override.py
+47-33Lines changed: 47 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -37,9 +37,11 @@
37
37
component_name = field 0 (Column A in Excel lingo)
38
38
component_version = field 1 (Column B in Excel lingo)
39
39
policy_violation_status = field 8 (Column I in Excel lingo)
40
-
override_rationale = field 11 (Column L in Excel lingo)
41
-
project_name = field 13 (Column N in Excel lingo)
42
-
project_version = field 14 (Column O in Excel lingo)
40
+
override_category = field 9 (Column J in Excel lingo)
41
+
override_date = field 11 (Column L in Excel lingo)
42
+
override_rationale = field 12 (Column M in Excel lingo)
43
+
project_name = field 14 (Column O in Excel lingo)
44
+
project_version = field 15 (Column P in Excel lingo)
43
45
44
46
Usage:
45
47
@@ -65,14 +67,16 @@
65
67
Component Policy Status (Column I) - NOT_IN_VIOLATION, IN_VIOLATION, IN_VIOLATION_OVERRIDEN
66
68
as determined by BD (the script would only look for
67
69
components that are shown as “IN_VIOLATION”)
68
-
Override Rationale (Column L) - Alteryx will export whatever Override comment is already in BD.
70
+
Policy Category (Column J) - If componet has multiple policy vialations only ovewrride
71
+
those with this category
72
+
Override Rationale (Column M) - Alteryx will export whatever Override comment is already in BD.
69
73
For components IN_VIOLATION, this column will be used to work
70
74
iteratively on the draft Override comment.
71
-
project_name (Column N) - Project name used by the product team for the BD scan
72
-
version_number (Column O) - Project version used by the product team for the BD scan
75
+
project_name (Column O) - Project name used by the product team for the BD scan
76
+
version_number (Column P) - Project version used by the product team for the BD scan
73
77
74
78
The script would parse the spreadsheet and for each component that has a status of “IN_VIOLATION”, it would:
75
-
Upload the Override Rationale (Column L) into the Override Comment field for that component in BD (for that project name/version).
79
+
Upload the Override Rationale (Column M) into the Override Comment field for that component in BD (for that project name/version).
76
80
Update the Override Date to “now” (not sure of the best way to get the correct date-stamp).
77
81
Update the Overridden Field with the name of the individual running the script (not sure of the best way to get the individual’s identity).
78
82
Not sure if the Component Policy Status field needs to be updated to IN_VIOLATION_OVERRIDEN by the script or if BD will do it automatically once the Override Comment has been added.
logging.info(f"Attemting to override policy status for{component_name}{component_version} in {project_name}{project_version} with ''{override_rationale}''")
logging.info(f"Processing category {override_category}{component_name}{component_version} in {project_name}{project_version} with ''{override_rationale}''")
logging.info(f"Processing category {override_category}{component_name}{component_version} in {project_name}{project_version} with ''{override_rationale}''")
0 commit comments