Skip to content

Commit

Permalink
correct total of all alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
tkishel committed Mar 17, 2021
1 parent 1e12f5b commit 0c44cc6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pcs-inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def process_collected_data():
def process_aggregated_alerts(alerts):
alerts_by = {
'policy': {},
'type': {'anomaly': 0, 'audit_event': 0, 'config': 0, 'data': 0, 'iam': 0},
'type': {'anomaly': 0, 'audit_event': 0, 'config': 0, 'data': 0, 'iam': 0,'network': 0},
'severity': {'high': 0, 'medium': 0, 'low': 0},
'status': {'open': 0, 'resolved': 0}
}
Expand Down Expand Up @@ -685,6 +685,7 @@ def process_summary():
RESULTS['summary']['count_of_aggregated_open_alerts'] = RESULTS['alerts_aggregated_by']['status']['open']
else:
RESULTS['summary']['count_of_policies_with_alerts_from_policies'] = sum(v['alertCount'] != 0 for k,v in RESULTS['policies'].items())
RESULTS['summary']['count_of_open_closed_alerts'] = len(DATA['ALERTS'])
RESULTS['summary']['count_of_compliance_standards_with_alerts_from_policies'] = sum(v != {'high': 0, 'medium': 0, 'low': 0} for k,v in RESULTS['compliance_standards_from_policies'].items())
RESULTS['summary']['count_of_compliance_standards_with_alerts_from_alerts'] = len(RESULTS['compliance_standards_from_alerts'])
RESULTS['summary']['count_of_policies_with_alerts_from_alerts'] = len(RESULTS['policies_from_alerts'])
Expand Down Expand Up @@ -872,7 +873,7 @@ def output_alerts_summary(panda_writer):
('',''),
('Number of Policies with Alerts', RESULTS['summary']['count_of_policies_with_alerts_from_alerts']),
('',''),
('Number of Alerts', RESULTS['summary']['count_of_aggregated_open_alerts']),
('Number of Alerts', RESULTS['summary']['count_of_open_closed_alerts']),
('',''),
('Anomaly Alerts', RESULTS['alert_counts_from_alerts']['type']['anomaly']),
('Audit Alerts', RESULTS['alert_counts_from_alerts']['type']['audit_event']),
Expand Down

0 comments on commit 0c44cc6

Please sign in to comment.