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

🐛 fix error 500 for ssh-audit #9228

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 18 additions & 9 deletions dojo/tools/ssh_audit/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import json

Check warning on line 1 in dojo/tools/ssh_audit/parser.py

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `none`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: The size of the files being changed in this pull request is too large. We are working on increasing that limit. Stay tuned for more...
from dojo.models import Endpoint, Finding


Expand Down Expand Up @@ -60,7 +60,8 @@
description = [f"**Algorithm**: {kexname}"]
description.append(f"**Description Failure**: {kex['notes']['fail']}")
description.append(f"**Description Warning**: {kex['notes']['warn']}")
description.append(f"**Info**: {kex['notes']['info']}")
if kex['notes'].get('info'):
description.append(f"**Info**: {kex['notes']['info']}")
severity = "High"
finding = Finding(title=str(title) + "_" + str(kexname),
test=test,
Expand All @@ -75,7 +76,8 @@
kexname = kex['algorithm']
description = [f"**Algorithm**: {kexname}"]
description.append(f"**Description Failure**: {kex['notes']['fail']}")
description.append(f"**Info**: {kex['notes']['info']}")
if kex['notes'].get('info'):
description.append(f"**Info**: {kex['notes']['info']}")
severity = "High"
finding = Finding(title=str(title) + "_" + str(kexname),
test=test,
Expand All @@ -90,7 +92,8 @@
kexname = kex['algorithm']
description = [f"**Algorithm**: {kexname}"]
description.append(f"**Description Warning**: {kex['notes']['warn']}")
description.append(f"**Info**: {kex['notes']['info']}")
if kex['notes'].get('info'):
description.append(f"**Info**: {kex['notes']['info']}")
severity = "Medium"
finding = Finding(title=str(title) + "_" + str(kexname),
test=test,
Expand All @@ -109,7 +112,8 @@
description.append(f"**Description Warning**: {key['notes']['warn']}")
if 'keysize' in key:
description.append(f"**KeySize**: {key['keysize']}")
description.append(f"**Info**: {key['notes']['info']}")
if key['notes'].get('info'):
description.append(f"**Info**: {key['notes']['info']}")
severity = "High"
finding = Finding(title=str(title) + "_" + str(keyname),
test=test,
Expand All @@ -126,7 +130,8 @@
description.append(f"**Description Failure**: {key['notes']['fail']}")
if 'keysize' in key:
description.append(f"**KeySize**: {key['keysize']}")
description.append(f"**Info**: {key['notes']['info']}")
if key['notes'].get('info'):
description.append(f"**Info**: {key['notes']['info']}")
severity = "High"
finding = Finding(title=str(title) + "_" + str(keyname),
test=test,
Expand All @@ -143,7 +148,8 @@
description.append(f"**Description Warning**: {key['notes']['warn']}")
if 'keysize' in key:
description.append(f"**KeySize**: {key['keysize']}")
description.append(f"**Info**: {key['notes']['info']}")
if key['notes'].get('info'):
description.append(f"**Info**: {key['notes']['info']}")
severity = "Medium"
finding = Finding(title=str(title) + "_" + str(keyname),
test=test,
Expand All @@ -160,7 +166,8 @@
description = [f"**Algorithm**: {macname}"]
description.append(f"**Description Failure**: {mac['notes']['fail']}")
description.append(f"**Description Warning**: {mac['notes']['warn']}")
description.append(f"**Info**: {mac['notes']['info']}")
if mac['notes'].get('info'):
description.append(f"**Info**: {mac['notes']['info']}")
severity = "High"
finding = Finding(title=str(title) + "_" + str(macname),
test=test,
Expand All @@ -175,7 +182,8 @@
macname = mac['algorithm']
description = [f"**Algorithm**: {macname}"]
description.append(f"**Description Failure**: {mac['notes']['fail']}")
description.append(f"**Info**: {mac['notes']['info']}")
if mac['notes'].get('info'):
description.append(f"**Info**: {mac['notes']['info']}")
severity = "High"
finding = Finding(title=str(title) + "_" + str(macname),
test=test,
Expand All @@ -190,7 +198,8 @@
macname = mac['algorithm']
description = [f"**Algorithm**: {macname}"]
description.append(f"**Description Warning**: {mac['notes']['warn']}")
description.append(f"**Info**: {mac['notes']['info']}")
if mac['notes'].get('info'):
description.append(f"**Info**: {mac['notes']['info']}")
severity = "Medium"
finding = Finding(title=str(title) + "_" + str(macname),
test=test,
Expand Down