Skip to content

Commit

Permalink
Merge pull request #28 from ggildong/master
Browse files Browse the repository at this point in the history
fix: modify yaml file for metric
  • Loading branch information
ggildong authored Sep 9, 2024
2 parents 3285cac + 01f3c66 commit 98e134c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/plugin/manager/prowler_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def _make_base_compliance_result(
self, compliance_id: str, requirement_id: str, requirement_seq: int, check_id: str, severity: str,
check_result: dict
) -> dict:
requirement_name, automation, requirement_skip = next(
((requirement['Description'], requirement['Automation'], requirement['Skip'])
requirement_name, automation, requirement_unsupported = next(
((requirement['Description'], requirement['Automation'], requirement['Unsupported'])
for requirement in self.requirement_info[self.cloud_service_type]['Requirements']
if requirement['Requirement_Seq'] == requirement_seq
),
Expand All @@ -365,7 +365,7 @@ def _make_base_compliance_result(
"requirement_seq": requirement_seq,
"automation": automation,
"description": check_result["finding_info"]["desc"] if check_id else "",
"status": "SKIP" if requirement_skip else ("PASS" if check_id else "UNKNOWN"),
"status": "UNSUPPORTED" if requirement_unsupported else ("PASS" if check_id else "UNKNOWN"),
"severity": severity if check_id else "",
"service": check_result["resources"][0]["group"]["name"] if check_id else "",
"checks": {},
Expand Down Expand Up @@ -447,7 +447,7 @@ def _load_requirement_info(self):
requirement_checks = requirement_json.get('Checks', [])
requirement_json['Requirement_Seq'] = i + 1
requirement_json['Automation'] = bool(requirement_checks)
requirement_json['Skip'] = not requirement_checks or (
requirement_json['Unsupported'] = not requirement_checks or (
bool(self.checklist) and not bool(set(self.checklist) & set(requirement_checks)))
frameworks[self.cloud_service_type]['Requirements'].append(requirement_json)

Expand Down
24 changes: 12 additions & 12 deletions src/plugin/metadata/prowler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ search:
- PASS: "PASS"
- FAIL: "FAIL"
- INFO: "INFO"
- SKIP: "SKIP"
- UNSUPPORTED: "UNSUPPORTED"
- UNKNOWN: "UNKNOWN"
- Compliance Score: data.stats.score.percent
type: float
Expand All @@ -34,6 +34,7 @@ table:
is_optional: true
- Automation: data.automation
data_type: boolean
is_optional: true
- Status: data.status
type: enum
enums:
Expand All @@ -43,7 +44,7 @@ table:
type: badge
- PASS: indigo.500
type: badge
- SKIP: peacock.500
- UNSUPPORTED: peacock.500
type: badge
- UNKNOWN: gray.500
type: badge
Expand All @@ -63,10 +64,11 @@ tabs.0:
sort:
key: data.checks.status
desc: false
root_path: data.checks
unwind: data.checks
fields:
- Requirement ID: data.requirement_id
- Check Title: data.checks.check_title
- Status: data.checks.status
- Check Title: check_title
- Status: status
type: enum
enums:
- FAIL: coral.500
Expand All @@ -81,15 +83,13 @@ tabs.0:
- MANUAL: peacock.500
label: MANUAL
type: badge
- Findings: data.checks.display.findings
- Findings: display.findings
sortable: false
- Severity: data.checks.severity
- Service: data.checks.service
- Risk: data.checks.risk
- Remediation: data.checks.remediation.description
- Severity: severity
- Service: service
- Risk: risk
- Remediation: remediation.description
search:
- key: data.requirement_id
name: Requirement ID
- key: data.checks.check_title
name: Check Title
- key: data.checks.status
Expand Down
5 changes: 3 additions & 2 deletions src/plugin/metrics/Prowler/Compliance/findings_count.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ query_options:
- key: data.findings.resource_type
name: Resource Type
filter:
- key: cloud_service_group
value: Prowler
- k: cloud_service_group
v: "Prowler"
o: match
unit: Count
namespace_id: ns-prowler-compliance
version: '1.0'

0 comments on commit 98e134c

Please sign in to comment.