How to build a Template¶
We use Jinja2 to create Report Templates. Here are listed the main variables available when creating a Template.
These are the variables loaded when creating a report
date - the date when the Report was created, as the name of the month and four digits for the year
- workspace.scope - a list containing the different scopes of the workspace.
- workspace - a dictionary with all workspace information.
start_date and end_date are displayed in timestamp format. If you want to change their format, you can use datetimeformat() function and pass the desired format as parameter. E.g.:
workspace.duration.start_date|datetimeformat('%m-%d-%Y') workspace.duration.end_date|datetimeformat('%B %Y')
- hosts_amount - an int containing the amount of hosts in the Workspace
- hosts - a dictionary with all the hosts in the Workspace
- services_amount - an int containing the amount of services in the Workspace
- services - a dictionary with all the services in the Workspace
- counter_severity - a dictionary with all the severities and the amount of vulns for each one vulnerability pie charts
- vulns_amount - an int containing the amount of vulnerabilities in the Workspace except for vulns with severity unclassified, which are not included
vulns - a dictionary with all the vulnerabilities in the Workspace except for vulns with severity unclassified, which are not included
Grouped reports will have an additional field: vulns_grouped_amount - an int containing the total amount of vulnerabilities after grouping
Custom Fields in Executive Report¶
You can access your Custom Attributes on the docx templates like a dictionary and by the field name:
For more technical information, here is the Jinja2 context, where you can find all the DataTypes and structures implemented with Jinja.
Here are some basic templates.