Macros

These are the included pre-built macros for the multi-scope report export template. Click each expandable section for more information.

display_narrative

Definition

{%p macro display_narrative(label,label_as_heading=true,heading_level = “h2”,error = true) %}

Description

Renders the title and rich-text contents of a narrative section field. Iterates through all narrative sections until a match is found for the label argument. The label (Title) will be displayed as a heading level unless false is passed as argument two. The default heading level is two unless a different value is passed as argument three. If the label passed is not found, an error message will be rendered in its place unless argument four is set to false.

Arguments

Examples

{{p display_narrative(“Methodology”) }}

{{p display_narrative(“Methodology”,false) }}

{{p display_narrative(“Methodology”,true,”h3”) }}

{{p display_narrative(“Methodology”,true,”h3”,false) }}

Sample Output

display_findings_count

Definition

{%p macro display_findings_count(scope_tag=”all”) %}

Description

Displays a table that tabulates finding count by severity for findings tagged with the passed argument for the scope. If no scope tag is passed, the count will include all findings in the report. If the default of “all” is used, this additional string will precede the table: If a single scope tag is passed (e.g., “internal”), only those findings with that tag will be tabulated.

Arguments

Examples

{{p display_findings_count() }} {# tabulates all findings by severity #}

{{p display_findings_count(ss.internal_tag) }} {# tabulates only internal findings #}

Sample Output

To modify the static text displayed before the table is rendered, search for the function call definition in the Set-Up code and adjust as desired:

display_all_findings_summaries

Definition

{%p macro display_all_findings_summaries() %}

Description

Renders Findings Summary Tables for every scope detected, using the style option set for the variable nn.summary_table_option. A separate table is created for each scope detected. There is simple static text preceding each scope in the Jinja template that can be modified as desired. No arguments are available for this function.

To modify the static text, search for the function name display_all_findings in the Set-Up code section of the Jinja template. Modify the static text as desired.

Example

{{p display_all_findings_summaries() }}

Sample Output

display_detailed_findings

Definition

{%p macro display_detailed_findings(scope_tag=”all”,scope_prefix=”ALL”,scope_heading=””) %}

Description

Displays the Detailed Findings for all scopes (default) or the scope tag passed as argument

It will use the scope_prefix for finding reference numbers (default to “ALL”).

The scope arguments passed should be the variables ss.<scope>_tag and ss.<scope>_prefix defined in the SCOPE DEFINITIONS section of the Set-Up Code. Don't overthink this part - just include the variables for the given scope as the arguments:

The scope_heading parameter is for a section title for the given scope. An optional string will be rendered as a heading (style Heading 2) before the findings are presented. In this example, “Internal Penetration Test Findings” is passed for the scope_heading argument.

Arguments

Examples

{{p display_detailed_findings(ss.internal_tag,ss.internal_prefix) }}

{{p display_detailed_findings(ss.internal_tag,ss.internal_prefix,”Internal Penetration Test Detailed Findings”) }}

{{p display_detailed_findings(ss.external_tag,ss.external_prefix) }}

{{p display_detailed_findings(ss.external_tag,ss.external_prefix,”External Findings”) }}

{{p display_detailed_findings(ss.webapp_tag,ss.webapp_prefix) }}

Sample Output 1 (no scope_heading argument)

Sample Output 2 (scope_heading argument of “Internal Penetration Test Findings”):

Last updated

© 2024 PlexTrac, Inc. All rights reserved.