Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
flan
Commits
19f6e99d
Commit
19f6e99d
authored
5 years ago
by
sw
Browse files
Options
Downloads
Patches
Plain Diff
escaped some characters in latex report builder
parent
c5b480a2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/report_builders/latex_report_builder.py
+23
-23
23 additions, 23 deletions
contrib/report_builders/latex_report_builder.py
with
23 additions
and
23 deletions
contrib/report_builders/latex_report_builder.py
+
23
−
23
View file @
19f6e99d
...
@@ -26,7 +26,7 @@ class LatexReportBuilder(ReportBuilder):
...
@@ -26,7 +26,7 @@ class LatexReportBuilder(ReportBuilder):
+
start_date
+
start_date
+
'
UTC.
\n\\
begin{lstlisting}
\n
'
+
'
UTC.
\n\\
begin{lstlisting}
\n
'
+
nmap_command
+
nmap_command
+
'
\n
\end{lstlisting}
\n
To find out what IPs were scanned see the end of this report.
\n
'
)
+
'
\n\
\
end{lstlisting}
\n
To find out what IPs were scanned see the end of this report.
\n
'
)
def
build
(
self
)
->
Any
:
def
build
(
self
)
->
Any
:
return
self
.
buffer
return
self
.
buffer
...
@@ -37,7 +37,7 @@ class LatexReportBuilder(ReportBuilder):
...
@@ -37,7 +37,7 @@ class LatexReportBuilder(ReportBuilder):
def
add_vulnerable_services
(
self
,
scan_results
:
Dict
[
str
,
ScanResult
]):
def
add_vulnerable_services
(
self
,
scan_results
:
Dict
[
str
,
ScanResult
]):
for
s
,
report
in
scan_results
.
items
():
for
s
,
report
in
scan_results
.
items
():
self
.
_append
(
'
\item
\\
textbf{\large
'
+
s
+
'
\large}
'
)
self
.
_append
(
'
\
\
item
\\
textbf{
\
\
large
'
+
s
+
'
\
\
large}
'
)
vulns
=
report
.
vulns
vulns
=
report
.
vulns
locations
=
report
.
locations
locations
=
report
.
locations
num_vulns
=
len
(
vulns
)
num_vulns
=
len
(
vulns
)
...
@@ -51,50 +51,50 @@ class LatexReportBuilder(ReportBuilder):
...
@@ -51,50 +51,50 @@ class LatexReportBuilder(ReportBuilder):
+
'
}
\\
begin{tabular}{@{}p{15cm}>{
\\
raggedleft
\\
arraybackslash} p{0.5cm}@{}}
\\
textbf{
'
+
'
}
\\
begin{tabular}{@{}p{15cm}>{
\\
raggedleft
\\
arraybackslash} p{0.5cm}@{}}
\\
textbf{
'
+
v
.
name
+
'
'
+
severity_name
+
'
(
'
+
v
.
name
+
'
'
+
severity_name
+
'
(
'
+
str
(
v
.
severity
)
+
str
(
v
.
severity
)
+
'
)} & \href{
'
+
description
.
url
+
'
)} &
\
\
href{
'
+
description
.
url
+
'
}{\large
\\
faicon{link}}
'
+
'
}{
\
\
large
\\
faicon{link}}
'
+
'
\end{tabular}
\\\\\n
Summary:
'
+
'
\
\
end{tabular}
\\\\\n
Summary:
'
+
description
.
text
+
description
.
text
+
'
\\\\
\hline \end{tabular}
'
)
+
'
\\\\
\
\
hline
\
\
end{tabular}
'
)
self
.
_append
(
'
\end{figure}
\n
'
)
self
.
_append
(
'
\
\
end{figure}
\n
'
)
self
.
_append
(
'
\FloatBarrier
\n\\
textbf{The above
'
self
.
_append
(
'
\
\
FloatBarrier
\n\\
textbf{The above
'
+
str
(
num_vulns
)
+
str
(
num_vulns
)
+
'
vulnerabilities apply to these network locations:}
\n\\
begin{itemize}
\n
'
)
+
'
vulnerabilities apply to these network locations:}
\n\\
begin{itemize}
\n
'
)
for
addr
in
locations
:
for
addr
in
locations
:
self
.
_append
(
'
\item
'
+
addr
+
'
Ports:
'
+
str
(
locations
[
addr
])
+
'
\n
'
)
self
.
_append
(
'
\
\
item
'
+
addr
+
'
Ports:
'
+
str
(
locations
[
addr
])
+
'
\n
'
)
self
.
_append
(
'
\\\\
\\\\
\n
\end{itemize}
\n
'
)
self
.
_append
(
'
\\\\
\\\\
\n
\
\
end{itemize}
\n
'
)
self
.
_append
(
'
\end{enumerate}
\n
'
)
self
.
_append
(
'
\
\
end{enumerate}
\n
'
)
def
add_non_vulnerable_services
(
self
,
scan_results
:
Dict
[
str
,
ScanResult
]):
def
add_non_vulnerable_services
(
self
,
scan_results
:
Dict
[
str
,
ScanResult
]):
for
app_name
,
result
in
scan_results
.
items
():
for
app_name
,
result
in
scan_results
.
items
():
self
.
_append
(
'
\item
\\
textbf{\large
'
+
app_name
+
'
\large}
\n\\
begin{itemize}
\n
'
)
self
.
_append
(
'
\
\
item
\\
textbf{
\
\
large
'
+
app_name
+
'
\
\
large}
\n\\
begin{itemize}
\n
'
)
locations
=
result
.
locations
locations
=
result
.
locations
for
addr
in
locations
:
for
addr
in
locations
:
self
.
_append
(
'
\item
'
+
addr
+
'
Ports:
'
+
str
(
locations
[
addr
])
+
'
\n
'
)
self
.
_append
(
'
\
\
item
'
+
addr
+
'
Ports:
'
+
str
(
locations
[
addr
])
+
'
\n
'
)
self
.
_append
(
'
\end{itemize}
\n
'
)
self
.
_append
(
'
\
\
end{itemize}
\n
'
)
self
.
_append
(
'
\end{enumerate}
\n
'
)
self
.
_append
(
'
\
\
end{enumerate}
\n
'
)
def
initialize_section
(
self
):
def
initialize_section
(
self
):
self
.
_append
(
'
\\
begin{enumerate}[wide, labelwidth=!, labelindent=0pt, label=
\\
textbf{\large
\\
arabic{enumi}
'
self
.
_append
(
'
\\
begin{enumerate}[wide, labelwidth=!, labelindent=0pt, label=
\\
textbf{
\
\
large
\\
arabic{enumi}
'
'
\large}]
\n
'
)
'
\
\
large}]
\n
'
)
def
add_vulnerable_section
(
self
):
def
add_vulnerable_section
(
self
):
self
.
_append
(
'
\section*{Services with Vulnerabilities}
'
)
self
.
_append
(
'
\
\
section*{Services with Vulnerabilities}
'
)
def
add_non_vulnerable_section
(
self
):
def
add_non_vulnerable_section
(
self
):
self
.
_append
(
'
\section*{Services With No Known Vulnerabilities}
'
)
self
.
_append
(
'
\
\
section*{Services With No Known Vulnerabilities}
'
)
def
add_ips_section
(
self
):
def
add_ips_section
(
self
):
self
.
_append
(
'
\section*{List of IPs Scanned}
'
)
self
.
_append
(
'
\
\
section*{List of IPs Scanned}
'
)
self
.
_append
(
'
\\
begin{itemize}
\n
'
)
self
.
_append
(
'
\\
begin{itemize}
\n
'
)
def
add_ip_address
(
self
,
ip
:
str
):
def
add_ip_address
(
self
,
ip
:
str
):
self
.
_append
(
'
\item
'
+
ip
+
'
\n
'
)
self
.
_append
(
'
\
\
item
'
+
ip
+
'
\n
'
)
def
finalize
(
self
):
def
finalize
(
self
):
self
.
_append
(
'
\end{itemize}
\n
'
)
self
.
_append
(
'
\
\
end{itemize}
\n
'
)
self
.
_append
(
'
\end{document}
'
)
self
.
_append
(
'
\
\
end{document}
'
)
def
_append
(
self
,
text
:
str
):
def
_append
(
self
,
text
:
str
):
self
.
buffer
+=
text
self
.
buffer
+=
text
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment