Skip to content
Open
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 doc/report/Report Writing - Procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ A finding consists of a `<finding>` element with the following attributes:
There are two optional fields:

- `status`, which can denote whether the finding is `new`, `unresolved`,
`not_retested` or `resolved`.
`not_retested`, `resolved`, or `accepted_risk`.
- `prefix`, to add a prefix to a finding identifier.

Furthermore, the `<finding>` is made up of several sub-elements:
Expand Down
1 change: 1 addition & 0 deletions dtd/pentestreport.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
<xs:enumeration value="resolved"/>
<xs:enumeration value="unresolved"/>
<xs:enumeration value="not_retested"/>
<xs:enumeration value="accepted_risk"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>
Expand Down
105 changes: 51 additions & 54 deletions xslt/auto.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
exclude-result-prefixes="xs my"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:my="http://www.radical.sexy"
version="2.0"
>

Expand Down Expand Up @@ -146,10 +147,7 @@
</xsl:template>

<xsl:template name="findingsSummaryContent">
<fo:table-row
xsl:use-attribute-sets="TableFont"
keep-together.within-column="always"
>
<fo:table-row xsl:use-attribute-sets="TableFont" keep-together.within-column="always">
<xsl:if test="position() mod 2 != 0">
<xsl:attribute name="background-color">#ededed</xsl:attribute>
</xsl:if>
Expand Down Expand Up @@ -185,40 +183,44 @@

<!-- Status Section -->
<xsl:if test="@status and @status != 'none' and @status != ''">

<xsl:variable name="prettyStatus">
<xsl:sequence
select="string-join(for $x in tokenize(@status, '_') return my:titleCase($x), ' ')"
/>
</xsl:variable>
<fo:block>
<fo:inline
xsl:use-attribute-sets="bold"
>Status: </fo:inline>
<fo:inline xsl:use-attribute-sets="bold">Status: </fo:inline>
<xsl:choose>
<xsl:when
test="@status = 'new' or @status = 'unresolved'"
>
<xsl:when test="@status = 'new' or @status = 'unresolved'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of select="$color_new" />
</xsl:attribute>
<xsl:value-of select="@status" />
<xsl:value-of select="$prettyStatus" />
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'not_retested'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of
select="$color_notretested"
/>
<xsl:value-of select="$color_notretested"/>
</xsl:attribute>
<xsl:value-of select="@status" />
<xsl:value-of select="$prettyStatus" />
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'resolved'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of
select="$color_resolved"
/>
<xsl:value-of select="$color_resolved"/>
</xsl:attribute>
<xsl:value-of select="@status" />
<xsl:value-of select="$prettyStatus" />
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'accepted_risk'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of select="$color_acceptedrisk"/>
</xsl:attribute>
<xsl:value-of select="$prettyStatus"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
Expand Down Expand Up @@ -342,10 +344,7 @@
</xsl:template>

<xsl:template name="recommendationsSummaryContent">
<fo:table-row
xsl:use-attribute-sets="TableFont"
keep-together.within-column="always"
>
<fo:table-row xsl:use-attribute-sets="TableFont" keep-together.within-column="always">
<xsl:if test="position() mod 2 != 0">
<xsl:attribute name="background-color">#ededed</xsl:attribute>
</xsl:if>
Expand All @@ -371,55 +370,58 @@
<xsl:value-of select="@threatLevel" />
</xsl:when>
</xsl:choose>
</fo:inline>
</fo:inline>
</fo:block>
</xsl:if>

<!-- Type -->
<xsl:if test="@type">
<fo:block>
<fo:inline
xsl:use-attribute-sets="bold"
>Type: </fo:inline>
<fo:inline xsl:use-attribute-sets="bold">Type: </fo:inline>
<xsl:value-of select="@type" />
</fo:block>
</xsl:if>

<!-- Status -->
<xsl:if test="@status and @status != 'none'">
<!-- Status Section -->
<xsl:if test="@status and @status != 'none' and @status != ''">
<xsl:variable name="prettyStatus">
<xsl:sequence
select="string-join(for $x in tokenize(@status, '_') return my:titleCase($x), ' ')"
/>
</xsl:variable>
<fo:block>
<fo:inline
xsl:use-attribute-sets="bold"
>Status: </fo:inline>
<fo:inline xsl:use-attribute-sets="bold">Status: </fo:inline>
<xsl:choose>
<xsl:when
test="@status = 'new' or @status = 'unresolved'"
>
<xsl:when test="@status = 'new' or @status = 'unresolved'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of select="$color_new" />
</xsl:attribute>
<xsl:value-of select="@status" />
<xsl:value-of select="$prettyStatus" />
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'not_retested'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of
select="$color_notretested"
/>
<xsl:value-of select="$color_notretested"/>
</xsl:attribute>
<xsl:value-of select="@status" />
<xsl:value-of select="$prettyStatus" />
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'resolved'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of
select="$color_resolved"
/>
<xsl:value-of select="$color_resolved"/>
</xsl:attribute>
<xsl:value-of select="@status" />
<xsl:value-of select="$prettyStatus" />
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'accepted_risk'">
<fo:inline>
<xsl:attribute name="color">
<xsl:value-of select="$color_acceptedrisk"/>
</xsl:attribute>
<xsl:value-of select="$prettyStatus"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
Expand All @@ -437,19 +439,14 @@
<xsl:for-each select="labels/label">
<fo:inline xsl:use-attribute-sets="label">
<xsl:attribute name="background-color">
<xsl:value-of
select="/pentest_report/meta/labels/label[@name = current()]/@color"
/>
<xsl:value-of select="/pentest_report/meta/labels/label[@name = current()]/@color"/>
</xsl:attribute>
<xsl:attribute name="color">
<xsl:value-of
select="/pentest_report/meta/labels/label[@name = current()]/@text"
/>
<xsl:value-of select="/pentest_report/meta/labels/label[@name = current()]/@text"/>
</xsl:attribute>
<xsl:value-of select="." />
</fo:inline>
<xsl:text
> </xsl:text> <!-- Add space between labels -->
<xsl:text> </xsl:text> <!-- Add space between labels -->
</xsl:for-each>
</fo:block>
</xsl:if>
Expand Down
4 changes: 4 additions & 0 deletions xslt/css.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ there.
color: <xsl:value-of select="$color_notretested"/>;
}

.status-accepted_risk {
color: <xsl:value-of select="$color_acceptedrisk"/>;
}

.status-resolved {
color: <xsl:value-of select="$color_resolved"/>;
}
Expand Down
16 changes: 13 additions & 3 deletions xslt/findings.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</fo:block>
</fo:table-cell>
<xsl:if
test="@status = 'new' or @status = 'resolved' or @status = 'unresolved' or @status = 'not_retested'">
test="@status = 'new' or @status = 'resolved' or @status = 'unresolved' or @status = 'not_retested' or @status = 'accepted_risk'">
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block xsl:use-attribute-sets="finding-meta">
<fo:inline xsl:use-attribute-sets="bold">Status: </fo:inline>
Expand All @@ -52,6 +52,11 @@
<xsl:value-of select="$prettyStatus"/>
</fo:inline>
</xsl:when>
<xsl:when test="@status = 'accepted_risk'">
<fo:inline xsl:use-attribute-sets="status-accepted_risk">
<xsl:value-of select="$prettyStatus"/>
</fo:inline>
</xsl:when>
</xsl:choose>

</fo:block>
Expand Down Expand Up @@ -157,7 +162,7 @@

<xsl:template match="update" name="update">
<xsl:if
test="../@status = 'resolved' or ../@status = 'unresolved' or ../@status = 'not_retested'">
test="../@status = 'resolved' or ../@status = 'unresolved' or ../@status = 'not_retested' or ../@status = 'accepted_risk'">
<fo:block xsl:use-attribute-sets="title-findingsection">
<xsl:choose>
<xsl:when test="../@status = 'unresolved'">
Expand All @@ -175,7 +180,12 @@
Update
</fo:inline>
</xsl:when>
</xsl:choose>
<xsl:when test="../@status = 'accepted_risk'">
<fo:inline xsl:use-attribute-sets="status-accepted_risk">
Update
</fo:inline>
</xsl:when>
</xsl:choose>
<xsl:if test="@date">
<xsl:text> </xsl:text>
<fo:inline xsl:use-attribute-sets="status-tag">
Expand Down
4 changes: 4 additions & 0 deletions xslt/functions_params_vars.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<xsl:variable name="color_new">#CC4900</xsl:variable>
<xsl:variable name="color_unresolved">#FF5C00</xsl:variable>
<xsl:variable name="color_notretested">#FE9920</xsl:variable>
<xsl:variable name="color_acceptedrisk">#333333</xsl:variable>
<xsl:variable name="color_resolved">#15B01A</xsl:variable>

<!-- generic pie chart colors -->
Expand Down Expand Up @@ -320,6 +321,9 @@
<xsl:when test="$label = 'not_retested'">
<xsl:value-of select="$color_notretested"/>
</xsl:when>
<xsl:when test="$label = 'accepted_risk'">
<xsl:value-of select="$color_acceptedrisk"/>
</xsl:when>
<xsl:when test="$label = 'resolved'">
<xsl:value-of select="$color_resolved"/>
</xsl:when>
Expand Down
5 changes: 5 additions & 0 deletions xslt/generate_html_report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@
<xsl:value-of select="$prettyStatus"/>
</span>
</xsl:when>
<xsl:when test="@status = 'accepted_risk'">
<span class="status-accepted_risk">
<xsl:value-of select="$prettyStatus"/>
</span>
</xsl:when>
</xsl:choose>
</div>
</xsl:if>
Expand Down
5 changes: 4 additions & 1 deletion xslt/styles_rep.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
<xsl:attribute-set name="status-not_retested">
<xsl:attribute name="color"><xsl:value-of select="$color_notretested"/></xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="status-accepted_risk">
<xsl:attribute name="color"><xsl:value-of select="$color_acceptedrisk"/></xsl:attribute>
</xsl:attribute-set>

<!-- Status tags -->
<xsl:attribute-set name="status-tag">
<xsl:attribute name="background-color"><xsl:value-of select="$c_support_light"/></xsl:attribute>
Expand Down
Loading