larxius commited on
Commit
b2cee32
·
verified ·
1 Parent(s): fff7a39

Update backend_structured/scanners_core.py

Browse files
Files changed (1) hide show
  1. backend_structured/scanners_core.py +25 -6
backend_structured/scanners_core.py CHANGED
@@ -69,7 +69,7 @@ from reportlab.lib.pagesizes import letter
69
  from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
70
  from reportlab.pdfgen import canvas
71
  from reportlab.platypus import (
72
- SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, Image, Flowable
73
  )
74
  from reportlab.graphics.shapes import Drawing
75
  from reportlab.graphics.charts.barcharts import VerticalBarChart
@@ -1872,7 +1872,26 @@ def generate_scan_pdf(scan, vulnerabilities):
1872
 
1873
  # Legal Disclaimer & Confidentiality Notice
1874
  elements.append(PageBreak())
1875
- disclaimer_heading = Paragraph("<b>Legal Disclaimer, Scope Boundaries & Limitation of Liability</b>", styles['Heading3'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1876
  disclaimer_body = (
1877
  "<b>1. Nature of Automated Security Assessment (\"AS-IS\" Provision)</b><br/>"
1878
  "This vulnerability assessment report is completely system-generated by the LarShield automated engine. "
@@ -1896,16 +1915,16 @@ def generate_scan_pdf(scan, vulnerabilities):
1896
  "This report contains sensitive, proprietary vulnerability intelligence regarding the client organization's digital assets. "
1897
  "Unauthorized distribution, public exposure, or reproduction of this document without prior written authorization from both the client organization and LarShield is strictly prohibited."
1898
  )
1899
- disclaimer_table = Table([[disclaimer_heading], [Paragraph(disclaimer_body, normal)]], colWidths=[460])
1900
  disclaimer_table.setStyle(TableStyle([
1901
  ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F8FAFC")),
1902
  ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#CBD5E1")),
1903
- ('TOPPADDING', (0,0), (-1,-1), 12),
1904
- ('BOTTOMPADDING', (0,0), (-1,-1), 12),
1905
  ('LEFTPADDING', (0,0), (-1,-1), 12),
1906
  ('RIGHTPADDING', (0,0), (-1,-1), 12),
1907
  ]))
1908
- elements.append(disclaimer_table)
1909
  elements.append(Spacer(1, 15))
1910
 
1911
  return elements
 
69
  from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
70
  from reportlab.pdfgen import canvas
71
  from reportlab.platypus import (
72
+ SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, Image, Flowable, KeepTogether
73
  )
74
  from reportlab.graphics.shapes import Drawing
75
  from reportlab.graphics.charts.barcharts import VerticalBarChart
 
1872
 
1873
  # Legal Disclaimer & Confidentiality Notice
1874
  elements.append(PageBreak())
1875
+
1876
+ disclaimer_title_style = ParagraphStyle(
1877
+ 'DisclaimerTitleStyle',
1878
+ parent=styles['Heading3'],
1879
+ fontSize=11,
1880
+ leading=14,
1881
+ textColor=colors.HexColor("#0F172A"),
1882
+ spaceAfter=6
1883
+ )
1884
+
1885
+ disclaimer_body_style = ParagraphStyle(
1886
+ 'DisclaimerBodyStyle',
1887
+ parent=styles['Normal'],
1888
+ fontSize=8,
1889
+ leading=10.5,
1890
+ textColor=colors.HexColor("#334155"),
1891
+ alignment=4
1892
+ )
1893
+
1894
+ disclaimer_heading = Paragraph("<b>Legal Disclaimer, Scope Boundaries & Limitation of Liability</b>", disclaimer_title_style)
1895
  disclaimer_body = (
1896
  "<b>1. Nature of Automated Security Assessment (\"AS-IS\" Provision)</b><br/>"
1897
  "This vulnerability assessment report is completely system-generated by the LarShield automated engine. "
 
1915
  "This report contains sensitive, proprietary vulnerability intelligence regarding the client organization's digital assets. "
1916
  "Unauthorized distribution, public exposure, or reproduction of this document without prior written authorization from both the client organization and LarShield is strictly prohibited."
1917
  )
1918
+ disclaimer_table = Table([[disclaimer_heading], [Paragraph(disclaimer_body, disclaimer_body_style)]], colWidths=[460])
1919
  disclaimer_table.setStyle(TableStyle([
1920
  ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F8FAFC")),
1921
  ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#CBD5E1")),
1922
+ ('TOPPADDING', (0,0), (-1,-1), 10),
1923
+ ('BOTTOMPADDING', (0,0), (-1,-1), 10),
1924
  ('LEFTPADDING', (0,0), (-1,-1), 12),
1925
  ('RIGHTPADDING', (0,0), (-1,-1), 12),
1926
  ]))
1927
+ elements.append(KeepTogether(disclaimer_table))
1928
  elements.append(Spacer(1, 15))
1929
 
1930
  return elements