Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prowler_v4.py Prowler v4.5.0 changed the 'event_time' key with 'time_dt' #11213

Merged
merged 7 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dojo/tools/aws_prowler_v3plus/prowler_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def process_ocsf_json(self, file, test):
documentation = deserialized.get("remediation", {}).get("references", "")
documentation = str(documentation) + "\n" + str(deserialized.get("unmapped", {}).get("related_url", ""))
security_domain = deserialized.get("resources", [{}])[0].get("type", "")
timestamp = deserialized.get("event_time")
# Prowler v4.5.0 changed 'event_time' key in report with 'time_dt'
timestamp = deserialized.get("time_dt") or deserialized.get("event_time")
resource_arn = deserialized.get("resources", [{}])[0].get("uid", "")
resource_id = deserialized.get("resources", [{}])[0].get("name", "")
unique_id_from_tool = deserialized.get("finding_info", {}).get("uid", "")
Expand Down
6 changes: 3 additions & 3 deletions unittests/scans/aws_prowler_v3plus/many_vuln.ocsf.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"provider": "aws",
"region": "us-east-1"
},
"event_time": "2024-06-03T14:15:19.382075",
"time_dt": "2024-06-03T14:15:19.382075",
Maffooch marked this conversation as resolved.
Show resolved Hide resolved
"remediation": {
"desc": "Apply the principle of least privilege. Instead of AdministratorAccess, assign only the permissions necessary for specific roles and tasks. Create custom IAM policies with minimal permissions based on the principle of least privilege. If a role really needs AdministratorAccess, the trust relationship must be well defined to restrict it usage only to the Principal, Action, Audience and Subject intended for it.",
"references": [
Expand Down Expand Up @@ -155,7 +155,7 @@
"provider": "aws",
"region": "us-east-1"
},
"event_time": "2024-06-03T14:15:19.382075",
"time_dt": "2024-06-03T14:15:19.382075",
"remediation": {
"desc": "Remove the AWS-managed ReadOnlyAccess policy from all roles that have a trust policy, including third-party cloud accounts, or remove third-party cloud accounts from the trust policy of all roles that need the ReadOnlyAccess policy.",
"references": [
Expand Down Expand Up @@ -234,7 +234,7 @@
"provider": "aws",
"region": "us-east-1"
},
"event_time": "2024-06-03T14:15:19.382075",
"time_dt": "2024-06-03T14:15:19.382075",
"remediation": {
"desc": "Ensure IAM Roles do not allow assume role from any role of a cross account but only from specific roles of specific accounts.",
"references": [
Expand Down
2 changes: 1 addition & 1 deletion unittests/scans/aws_prowler_v3plus/one_vuln.ocsf.json
Maffooch marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"provider": "aws",
"region": "us-east-1"
},
"event_time": "2024-06-03T14:15:19.382075",
"time_dt": "2024-06-03T14:15:19.382075",
"remediation": {
"desc": "Apply the principle of least privilege. Instead of AdministratorAccess, assign only the permissions necessary for specific roles and tasks. Create custom IAM policies with minimal permissions based on the principle of least privilege. If a role really needs AdministratorAccess, the trust relationship must be well defined to restrict it usage only to the Principal, Action, Audience and Subject intended for it.",
"references": [
Expand Down
Loading