Skip to content

Commit e4a880f

Browse files
committed
Update of cis_report.py
1 parent ad55eb7 commit e4a880f

File tree

1 file changed

+6
-9
lines changed
  • security/security-design/oci-security-health-check-standard/scripts/cis_reports

1 file changed

+6
-9
lines changed

security/security-design/oci-security-health-check-standard/scripts/cis_reports/cis_reports.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
except:
3434
OUTPUT_TO_XLSX = False
3535

36-
RELEASE_VERSION = "2.5.11"
36+
RELEASE_VERSION = "2.5.12"
3737
PYTHON_SDK_VERSION = "2.103.0"
38-
UPDATED_DATE = "June 20, 2023"
38+
UPDATED_DATE = "June 29, 2023"
3939

4040
##########################################################################
4141
# Print header centered
@@ -1299,7 +1299,6 @@ def __os_read_buckets(self):
12991299
search_details=oci.resource_search.models.StructuredSearchDetails(
13001300
query="query Bucket resources return allAdditionalFields where compartmentId != '" + self.__managed_paas_compartment_id + "'")
13011301
).data
1302-
13031302
# Getting Bucket Info
13041303
for bucket in buckets_data:
13051304
try:
@@ -1328,12 +1327,10 @@ def __os_read_buckets(self):
13281327
}
13291328
self.__buckets.append(record)
13301329
except Exception as e:
1331-
deep_link = self.__oci_buckets_uri + bucket.additional_details['namespace'] + \
1332-
"/" + bucket.display_name + "/objects?region=" + region_key
13331330
record = {
13341331
"id": "",
13351332
"name": bucket.display_name,
1336-
"deep_link": self.__generate_csv_hyperlink(deep_link, bucket.display_name),
1333+
"deep_link": "",
13371334
"kms_key_id": "",
13381335
"namespace": bucket.additional_details['namespace'],
13391336
"compartment_id": bucket.compartment_id,
@@ -3371,7 +3368,7 @@ def __report_cis_analyze_tenancy_data(self):
33713368
for sl in self.__network_security_lists:
33723369
for irule in sl['ingress_security_rules']:
33733370
if irule['source'] == "0.0.0.0/0" and irule['protocol'] == '6':
3374-
if irule['tcp_options']:
3371+
if irule['tcp_options'] and irule['tcp_options']['destinationPortRange']:
33753372
port_min = irule['tcp_options']['destinationPortRange']['min']
33763373
port_max = irule['tcp_options']['destinationPortRange']['max']
33773374
ports_range = range(port_min, port_max +1)
@@ -3419,7 +3416,7 @@ def __report_cis_analyze_tenancy_data(self):
34193416
for nsg in self.__network_security_groups:
34203417
for rule in nsg['rules']:
34213418
if rule['source'] == "0.0.0.0/0" and rule['protocol'] == '6':
3422-
if rule['tcp_options']:
3419+
if rule['tcp_options'] and rule['tcp_options'].destination_port_range:
34233420
port_min = rule['tcp_options'].destination_port_range.min
34243421
port_max = rule['tcp_options'].destination_port_range.max
34253422
ports_range = range(port_min,port_max+1)
@@ -3693,7 +3690,7 @@ def __obp_analyze_tenancy_data(self):
36933690
## Determines if a Budget Exists with an alert rule
36943691
if len(self.__budgets) > 0:
36953692
for budget in self.__budgets:
3696-
if budget['alert_rule_count'] > 0:
3693+
if budget['alert_rule_count'] >0 and budget['target_compartment_id'] == self.__tenancy.id:
36973694
self.obp_foundations_checks['Cost_Tracking_Budgets']['Status'] = True
36983695
self.obp_foundations_checks['Cost_Tracking_Budgets']['OBP'].append(budget)
36993696
else:

0 commit comments

Comments
 (0)