Liquid Dynamic Content

This page contains:

Liquid in Projects

As of v4.9 of Dradis, you can now use Liquid to refer to content across sections. For example, maybe you want to use document properties inside Content Blocks, so you can refer to the dradis.client inside the Executive Summary Content Block, or perhaps you want to refer to the Node label inside a piece of evidence? Now you can! You can even use conditionals - for example, perhaps you want to be able to have a single Issue able to export to both an English and a Spanish template, without having duplicate fields. Conditional Liquid syntax makes that possible!

A list of the Liquid Drops available is below, but here is an example. If you put this content into an Issue:

#[Description]#
Tag Name:
{%  for tag in issue.tags %} {{ tag.name}} {%endfor%}

CVSSv3 score:
{{ issue.fields['CVSSv3.BaseScore'] }}

The {{ issue.title }} issue has {{ issue.evidence.size }} instances of Evidence

With Liquid Dynamic Content, the output in your UI should look something like this:

If you put this into a piece of Evidence:

#[Location]#
tcp/80

#[Output]#
Evidence location:
{{ evidence.fields["Location"] }}

Evidence issue title:
{{ evidence.issue.title }}

Node:
{{node.label}}

The output in your UI should look something like this:

If you put this into a Note:

#[Title]#
Details

#[Project]#
This project is called: {{project.name}}

The output should look something like this:

If you put this content into a Content Block:

#[Description]#
Author email: {{ content_block.author.email }}
Author name: {{ content_block.author.name }}

The output in your UI should look something like this:

Liquid Drops

Liquid Drops are the way that you can insert dynamic content into projects. Drops use the {{ }} syntax.

We have drops available for most content types inside of your Dradis project:

Conditionals

You can use Liquid to create if statements in projects. For example, if you use multiple templates and your project content has to suit several of them at once, for example for multiple languages, then you can use a conditional like this:

#[Title]#
{% if document_properties.dradis.lang == 'en' %}
Testing

{% elsif document_properties.dradis.lang == 'fr' %}
Essai

{% endif %}

#[Description]#
{% if document_properties.dradis.lang == 'en' %}
This is a test

{% elsif document_properties.dradis.lang == 'fr' %}
C'est un test

{% endif %}

In the example above, if the dradis.lang document property is set to en then the project will export in English; if it is set to fr it will export in French.

Content Blocks

Content Blocks are found on the Report Content page of your project.

The following drops are available:

{{ content_block.author }}
{{ content_block.block_group }}
{{ content_block.content }}
{{ content_block.fields['Field Name'] }}

Document Properties

Document Properties are found on the Report Content page of your project.

The following drops are available:

{{ document_properties.dradis.example }}

For example, if you have a Document Property called dradis.client, you can refer to it as {{ document_properties.dradis.client }}.

Evidence

The following drops are available:

{{ evidence.content }}
{{ evidence.fields['Field Name'] }}
{{ evidence.id }}
{{ evidence.issue }}
{{ evidence.title }}

Evidence cannot be accessed on their own, but must be within issues or nodes.

To show a count of Evidence for a specific Issue you can use something like issue.evidence.size.

Issues

The following drops are available:

{{ issue.affected }}
{{ issue.author }}
{{ issue.evidence }}
{{ issue.fields['Field Name'] }}
{{ issue.id }}
{{ issue.tags }}
{{ issue.text }}
{{ issue.title }}

Nodes

The following drops are available:

{{ node.evidence }}
{{ node.id }}
{{ node.label }}
{{ node.notes }}

Notes

The following drops are available:

{{ note.fields['Field Name'] }}
{{ note.id }}
{{ note.text }}
{{ note.title }}
{{ note.updated_at }}

Project

The following drops are available:

{{ project.authors }}
{{ project.id }}
{{ project.name }}
{{ project.updated_at }}

Tags

Tags are used to categorize Issues. The default tags are Critical, High, Medium, Low, and Info.

The following drops are available:

{{ tag.color }}
{{ tag.display_name }}
{{ tag.id }}
{{ tag.name }}
{{ tag.tag_issues }}

Teams

Each project can be associated with a Team.

The following drops are available:

{{ team.name }}

Liquid in Templates

The Liquid drops mentioned above can export the way you would expect them to in templates, IF they are on the same level. Word and HTML (not Excel!) are supported. You can access:

  • An IssueDrop or TagDrop inside the Issue content control
  • An EvidenceDrop inside the Issue or Evidence content control
  • A NodeDrop inside the Node content control
  • A ContentBlockDrop inside the ContentBlock control
  • A DocumentPropertyDrop, ProjectDrop, or TeamDrop anywhere

So, for example, this pasted inside an Issue should export just fine!

#[Description]#
    Global:
{{ project.name }} for {{ team.name }} team
{{document_properties.available_properties}}

Tag Name:
{%  for tag in issue.tags %} {{ tag.name}} {%endfor%}

CVSSv3 score:
{{ issue.fields['CVSSv3.BaseScore'] }}

Evidence:
{% for evidence in issue.evidence %} {{ evidence.fields["Label"] }} {%endfor%}

The {{ issue.title }} issue has {{ issue.evidence.size }} instances of Evidence

Evidence count per node:
{% for node in issue.affected %}
{{ node.label}} has {{node.evidence.size}} instances of evidence
{% endfor %}

Next help article: Combine multiple Issues →

Streamline InfoSec Project Delivery

Learn practical tips to reduce the overhead that drags down security assessment delivery with this 5-day course. These proven, innovative, and straightforward techniques will optimize all areas of your next engagement including:

  • Scoping
  • Scheduling
  • Project Planning
  • Delivery
  • Intra-team Collaboration
  • Reporting and much more...

Your email is kept private. We don't do the spam thing.