larxius commited on
Commit
f793ed8
·
verified ·
1 Parent(s): 988cc8f

Update backend/scanners_core.py

Browse files
Files changed (1) hide show
  1. backend/scanners_core.py +81 -39
backend/scanners_core.py CHANGED
@@ -1896,58 +1896,100 @@ def generate_scan_pdf(scan, vulnerabilities):
1896
  # Legal Disclaimer & Confidentiality Notice
1897
  elements.append(PageBreak())
1898
 
1899
- disclaimer_title_style = ParagraphStyle(
1900
- 'DisclaimerTitleStyle',
1901
- parent=styles['Heading3'],
1902
- fontSize=11,
1903
- leading=14,
1904
  textColor=colors.HexColor("#0F172A"),
1905
- spaceAfter=6
1906
  )
1907
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1908
  disclaimer_body_style = ParagraphStyle(
1909
  'DisclaimerBodyStyle',
1910
  parent=styles['Normal'],
1911
- fontSize=8,
1912
- leading=10.5,
1913
  textColor=colors.HexColor("#334155"),
1914
- alignment=4
 
1915
  )
1916
 
1917
- disclaimer_heading = Paragraph("<b>Legal Disclaimer, Scope Boundaries & Limitation of Liability</b>", disclaimer_title_style)
1918
- disclaimer_body = (
1919
- "<b>1. Nature of Automated Security Assessment (\"AS-IS\" Provision)</b><br/>"
1920
- "This vulnerability assessment report is completely system-generated by the LarShield automated engine. "
1921
- "Automated security scanning tools inspect web applications, APIs, network services, and infrastructure against known vulnerability signatures, heuristic patterns, and behavioral anomalies. "
1922
- "Due to the dynamic and evolving nature of security threats, automated assessments may contain false positives (incorrectly identified flaws), false negatives (undetected vulnerabilities), or incomplete contextual findings. "
1923
- "This document is provided strictly on an <b>\"AS-IS\" and \"AS-AVAILABLE\" basis</b> without warranties or guarantees of any kind, whether express, implied, statutory, or otherwise, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or absolute system security.<br/><br/>"
1924
- "<b>2. Point-in-Time Evaluation & Scope Limitations</b><br/>"
1925
- "The findings, CVSS scoring, and risk calculations presented herein reflect a strict point-in-time snapshot of the target environment at the exact timestamp of scan execution. "
1926
- "Application updates, server configuration changes, firewall rule modifications, third-party component updates, or emerging zero-day exploits occurring after scan execution may fundamentally alter the target security posture. "
1927
- "LarShield makes no representation or warranty that target systems are completely immune to cyberattacks, unauthorized intrusion, data breaches, or operational disruptions.<br/><br/>"
1928
- "<b>3. Authorization & Compliance Verification</b><br/>"
1929
- "By initiating or scheduling security assessments using the LarShield platform, the requesting user or organization explicitly warrants and certifies that they possess full, legally verifiable authorization from all relevant infrastructure, network, and application owners to conduct security assessments against designated target endpoints. "
1930
- "LarShield disclaims all legal liability resulting from unauthorized scanning, misconfigured target inputs, or scans conducted against assets without explicit consent.<br/><br/>"
1931
- "<b>4. Strict Limitation of Liability</b><br/>"
1932
- "To the maximum extent permitted under applicable laws, under no circumstances shall LarShield, its parent company, operators, developers, officers, affiliates, or service providers be held liable for any direct, indirect, incidental, special, punitive, exemplary, or consequential damages whatsoever (including, without limitation, loss of business revenue, commercial profit, operational downtime, data corruption, unauthorized data access, regulatory fines, or third-party claims) arising out of or in connection with the use of, reliance upon, or inability to use this report or any security patch, configuration change, or remediation advice contained within.<br/><br/>"
1933
- "<b>5. Remediation & Patching Responsibility</b><br/>"
1934
- "All remediation guidance, code recommendations, and security configuration changes outlined in this report are advisory only. "
1935
- "Target system administrators and security personnel are solely responsible for thoroughly validating, testing, and reviewing any remediation steps in a non-production staging environment prior to production deployment. "
1936
- "LarShield assumes no responsibility for application breakage, service outage, or system instability resulting from remediation actions taken based on this report.<br/><br/>"
1937
- "<b>6. Proprietary Confidentiality Notice</b><br/>"
1938
- "This report contains sensitive, proprietary vulnerability intelligence regarding the client organization's digital assets. "
1939
- "Unauthorized distribution, public exposure, or reproduction of this document without prior written authorization from both the client organization and LarShield is strictly prohibited."
1940
- )
1941
- disclaimer_table = Table([[disclaimer_heading], [Paragraph(disclaimer_body, disclaimer_body_style)]], colWidths=[460])
1942
- disclaimer_table.setStyle(TableStyle([
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1943
  ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F8FAFC")),
1944
- ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#CBD5E1")),
1945
  ('TOPPADDING', (0,0), (-1,-1), 10),
1946
  ('BOTTOMPADDING', (0,0), (-1,-1), 10),
1947
- ('LEFTPADDING', (0,0), (-1,-1), 12),
1948
- ('RIGHTPADDING', (0,0), (-1,-1), 12),
1949
  ]))
1950
- elements.append(KeepTogether(disclaimer_table))
 
 
1951
  elements.append(Spacer(1, 15))
1952
 
1953
  return elements
 
1896
  # Legal Disclaimer & Confidentiality Notice
1897
  elements.append(PageBreak())
1898
 
1899
+ disclaimer_header_style = ParagraphStyle(
1900
+ 'DisclaimerHeaderStyle',
1901
+ parent=styles['Heading2'],
1902
+ fontSize=12,
1903
+ leading=15,
1904
  textColor=colors.HexColor("#0F172A"),
1905
+ spaceAfter=0
1906
  )
1907
 
1908
+ disclaimer_sub_style = ParagraphStyle(
1909
+ 'DisclaimerSubStyle',
1910
+ parent=styles['Normal'],
1911
+ fontSize=8,
1912
+ leading=10,
1913
+ textColor=colors.HexColor("#64748B"),
1914
+ spaceAfter=0
1915
+ )
1916
+
1917
+ disclaimer_item_title = ParagraphStyle(
1918
+ 'DisclaimerItemTitle',
1919
+ parent=styles['Normal'],
1920
+ fontSize=9.5,
1921
+ leading=12.5,
1922
+ textColor=colors.HexColor("#0F172A"),
1923
+ spaceBefore=5,
1924
+ spaceAfter=2
1925
+ )
1926
+
1927
  disclaimer_body_style = ParagraphStyle(
1928
  'DisclaimerBodyStyle',
1929
  parent=styles['Normal'],
1930
+ fontSize=8.5,
1931
+ leading=11.5,
1932
  textColor=colors.HexColor("#334155"),
1933
+ alignment=4,
1934
+ spaceAfter=4
1935
  )
1936
 
1937
+ header_p1 = Paragraph("<b>Legal Disclaimer, Scope Boundaries & Limitation of Liability</b>", disclaimer_header_style)
1938
+ header_p2 = Paragraph("OFFICIAL SYSTEM-GENERATED VULNERABILITY ASSESSMENT GOVERNANCE NOTICE", disclaimer_sub_style)
1939
+
1940
+ header_table = Table([[header_p1], [Spacer(1, 2)], [header_p2]], colWidths=[532])
1941
+ header_table.setStyle(TableStyle([
1942
+ ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F1F5F9")),
1943
+ ('LINELEFT', (0,0), (-1,-1), 4, colors.HexColor("#4F46E5")),
1944
+ ('TOPPADDING', (0,0), (-1,-1), 8),
1945
+ ('BOTTOMPADDING', (0,0), (-1,-1), 8),
1946
+ ('LEFTPADDING', (0,0), (-1,-1), 12),
1947
+ ('RIGHTPADDING', (0,0), (-1,-1), 12),
1948
+ ]))
1949
+
1950
+ disclaimer_items = [
1951
+ ("1. Nature of Automated Security Assessment (\"AS-IS\" Provision)",
1952
+ "This vulnerability assessment report is completely system-generated by the LarShield automated engine. Automated security scanning tools inspect web applications, APIs, network services, and infrastructure against known vulnerability signatures, heuristic patterns, and behavioral anomalies. Due to the dynamic and evolving nature of security threats, automated assessments may contain false positives (incorrectly identified flaws), false negatives (undetected vulnerabilities), or incomplete contextual findings. This document is provided strictly on an <b>\"AS-IS\" and \"AS-AVAILABLE\" basis</b> without warranties or guarantees of any kind, whether express, implied, statutory, or otherwise, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or absolute system security."),
1953
+
1954
+ ("2. Point-in-Time Evaluation & Scope Limitations",
1955
+ "The findings, CVSS scoring, and risk calculations presented herein reflect a strict point-in-time snapshot of the target environment at the exact timestamp of scan execution. Application updates, server configuration changes, firewall rule modifications, third-party component updates, or emerging zero-day exploits occurring after scan execution may fundamentally alter the target security posture. LarShield makes no representation or warranty that target systems are completely immune to cyberattacks, unauthorized intrusion, data breaches, or operational disruptions."),
1956
+
1957
+ ("3. Authorization & Compliance Verification",
1958
+ "By initiating or scheduling security assessments using the LarShield platform, the requesting user or organization explicitly warrants and certifies that they possess full, legally verifiable authorization from all relevant infrastructure, network, and application owners to conduct security assessments against designated target endpoints. LarShield disclaims all legal liability resulting from unauthorized scanning, misconfigured target inputs, or scans conducted against assets without explicit consent."),
1959
+
1960
+ ("4. Strict Limitation of Liability",
1961
+ "To the maximum extent permitted under applicable laws, under no circumstances shall LarShield, its parent company, operators, developers, officers, affiliates, or service providers be held liable for any direct, indirect, incidental, special, punitive, exemplary, or consequential damages whatsoever (including, without limitation, loss of business revenue, commercial profit, operational downtime, data corruption, unauthorized data access, regulatory fines, or third-party claims) arising out of or in connection with the use of, reliance upon, or inability to use this report or any security patch, configuration change, or remediation advice contained within."),
1962
+
1963
+ ("5. Remediation & Patching Responsibility",
1964
+ "All remediation guidance, code recommendations, and security configuration changes outlined in this report are advisory only. Target system administrators and security personnel are solely responsible for thoroughly validating, testing, and reviewing any remediation steps in a non-production staging environment prior to production deployment. LarShield assumes no responsibility for application breakage, service outage, or system instability resulting from remediation actions taken based on this report."),
1965
+
1966
+ ("6. Proprietary Confidentiality Notice",
1967
+ "This report contains sensitive, proprietary vulnerability intelligence regarding the client organization's digital assets. Unauthorized distribution, public exposure, or reproduction of this document without prior written authorization from both the client organization and LarShield is strictly prohibited.")
1968
+ ]
1969
+
1970
+ content_flowables = [header_table, Spacer(1, 10)]
1971
+
1972
+ card_cells = []
1973
+ for idx, (title, body) in enumerate(disclaimer_items):
1974
+ t_p = Paragraph(f"<b>{title}</b>", disclaimer_item_title)
1975
+ b_p = Paragraph(body, disclaimer_body_style)
1976
+ card_cells.append(t_p)
1977
+ card_cells.append(b_p)
1978
+ if idx < len(disclaimer_items) - 1:
1979
+ card_cells.append(Spacer(1, 4))
1980
+
1981
+ disclaimer_card_table = Table([[card_cells]], colWidths=[532])
1982
+ disclaimer_card_table.setStyle(TableStyle([
1983
  ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F8FAFC")),
1984
+ ('BOX', (0,0), (-1,-1), 0.75, colors.HexColor("#CBD5E1")),
1985
  ('TOPPADDING', (0,0), (-1,-1), 10),
1986
  ('BOTTOMPADDING', (0,0), (-1,-1), 10),
1987
+ ('LEFTPADDING', (0,0), (-1,-1), 14),
1988
+ ('RIGHTPADDING', (0,0), (-1,-1), 14),
1989
  ]))
1990
+
1991
+ content_flowables.append(disclaimer_card_table)
1992
+ elements.append(KeepTogether(content_flowables))
1993
  elements.append(Spacer(1, 15))
1994
 
1995
  return elements