-
Notifications
You must be signed in to change notification settings - Fork 4
/
configAccountSets.py
98 lines (89 loc) · 3.44 KB
/
configAccountSets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
from configAgentless import configAgentless
import os
import json
CONFIG_FILE = os.getenv("CONFIG_FILE", "config.json")
if __name__ == "__main__":
headers = {
"Content-Type": "application/json"
}
with open(CONFIG_FILE) as config_file:
config = json.loads(config_file.read())
find_in_org = config["findInOrg"]
debug = config["debug"]
backup = config["backup"]
limit = config["limit"]
bulk_update_count = config["bulkUpdateCount"]
credentials = None
# Configure Account Sets
for account_set in config["accountSets"]:
# General parameters
change_state_only = account_set["changeStateOnly"]
organization_id = account_set["organizationId"]
organization_type = account_set["organizationType"]
account_groups = account_set["accountGroups"]
account_ids = account_set["accountIds"]
onboarding_mode = account_set["onboardingMode"]
scan_mode = account_set["scanMode"]
if "credentials" in account_set: credentials = account_set["credentials"]
# Agentless parameters
hub_account_id = account_set["agentless"]["hubAccountId"]
subnet_name = account_set["agentless"]["subnetName"]
security_group_name = account_set["agentless"]["securityGroupName"]
exclude_tags = account_set["agentless"]["excludeTags"]
include_tags = account_set["agentless"]["includeTags"]
custom_tags = account_set["agentless"]["customTags"]
regions = account_set["agentless"]["regions"]
scanners = account_set["agentless"]["scanners"]
scan_non_running = account_set["agentless"]["scanNonRunning"]
auto_scale = account_set["agentless"]["autoScale"]
enforce_permissions_check = account_set["agentless"]["enforcePermissionsCheck"]
oci_excluded_compartments = account_set["agentless"]["ociExcludedCompartments"]
oci_vcn = account_set["agentless"]["ociVcn"]
set_as_hub = account_set["agentless"]["setAsHub"]
agentless_state = account_set["agentless"]["agentlessState"]
# Serverless parameters
scan_latest = account_set["serverless"]["scanLatest"]
scan_cap = account_set["serverless"]["scanCap"]
scan_layers = account_set["serverless"]["scanLayers"]
radar_cap = account_set["serverless"]["radarCap"]
radar_latest = account_set["serverless"]["radarLatest"]
serverless_state = account_set["serverless"]["serverlessState"]
configAgentless(
# General values
organization_id,
organization_type,
account_ids,
change_state_only,
onboarding_mode,
account_groups,
scan_mode,
debug,
find_in_org,
backup,
# Agentless arguments
hub_account_id,
subnet_name,
security_group_name,
exclude_tags,
include_tags,
custom_tags,
scan_non_running,
scanners,
regions,
oci_excluded_compartments,
oci_vcn,
auto_scale,
enforce_permissions_check,
limit,
bulk_update_count,
set_as_hub,
agentless_state,
# Serverless arguments
scan_latest,
scan_cap,
scan_layers,
radar_cap,
radar_latest,
serverless_state,
credentials
)