Skip to content

Updated version #72

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

Merged
merged 1 commit into from
Apr 8, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = 'socket.dev'
__version__ = '2.0.40'
__version__ = '2.0.41'

1 change: 0 additions & 1 deletion socketsecurity/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ def add_package_alerts_to_collection(self, package: Package, alerts_collection:
alert = Alert(**alert_item)
props = getattr(self.config.all_issues, alert.type, default_props)
introduced_by = self.get_source_data(package, packages)

issue_alert = Issue(
pkg_type=package.type,
pkg_name=package.name,
Expand Down
18 changes: 15 additions & 3 deletions socketsecurity/core/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
from pathlib import Path

from docutils.nodes import title
from mdutils import MdUtils
from prettytable import PrettyTable

Expand Down Expand Up @@ -233,10 +234,21 @@ def create_security_comment_sarif(diff) -> dict:
# Create a unique rule id and name by appending the manifest file.
unique_rule_id = f"{base_rule_id} ({mf})"
rule_name = f"Alert {base_rule_id} ({mf})"

short_desc = (f"{alert.props.get('note', '')}<br/><br/>Suggested Action:<br/>{alert.suggestion}"
props = {}
if hasattr(alert, 'props'):
props = alert.props
suggestion = ''
if hasattr(alert, 'suggestion'):
suggestion = alert.suggestion
alert_title = ''
if hasattr(alert, 'title'):
alert_title = alert.title
description = ''
if hasattr(alert, 'description'):
description = alert.description
short_desc = (f"{props.get('note', '')}<br/><br/>Suggested Action:<br/>{suggestion}"
f"<br/><a href=\"{socket_url}\">{socket_url}</a>")
full_desc = "{} - {}".format(alert.title, alert.description.replace('\r\n', '<br/>'))
full_desc = "{} - {}".format(alert_title, description.replace('\r\n', '<br/>'))

if unique_rule_id not in rules_map:
rules_map[unique_rule_id] = {
Expand Down
Loading