{% set run = runs[-1] %} {% set invocation = run.invocations[-1] %} {% set results = run.results %} {% set metrics = run.properties.metrics %} {% set tool = run.tool %} {% set isError = True if metrics.critical > 0 or metrics.high > 2 or metrics.medium > 5 else False %} {% set versionControlProvenance = run.versionControlProvenance[-1] %}

SAST scan status

Report from the scan performed on   {{ invocation.endTimeUtc|replace("T", " at ")|replace("Z", "") }} for {{ versionControlProvenance.repositoryUri|default('local') }}

Repository Details
{{ versionControlProvenance.repositoryUri|default('local') }}
Branch {{ versionControlProvenance.branch }}
Commit {{ versionControlProvenance.revisionId }}
Invocation Details
{{ tool.driver.name }}
Run Id {{ inlineExternalProperties[-1].runGuid }}
Directory {{ invocation.workingDirectory.uri }}
Executive Summary

This report was generated by AppThreat from the SAST scan invocation on {{ invocation.endTimeUtc|replace("T", " at ")|replace("Z", "") }}. The scan used the open source tool {{ tool.driver.name }} to scan the source code repository {{ versionControlProvenance.repositoryUri|default('local')|urlize(40, target='_blank') }}.

{% if metrics.total %}

Below is a summary of the issues identified:

{% for sev in ["critical", "high", "medium", "low", "total"] -%} {%- endfor %}
Severity Count
{{ sev|upper }} {{ metrics.get(sev)|default('NA') }}
{% endif %} {% if isError %}

 

  AppThreat recommends immediate remediation of the key issues identified before using this application in a live environment.

{% else %}

 

  Based on this report, the application is certified as ready for deployment to test and production environments. Please refer to the dependency and container scan reports (if available) for additional context.

{% endif %}
{% if key_issues|length %}
Key Issues {{ key_issues|length }} / {{ metrics.critical }}
{% for result in key_issues -%} {% set result_index = loop.index %}
{% for location in result.locations -%}

{{ result.ruleId|default('') }}

{{ location.physicalLocation.artifactLocation.uri|basename }}

{{ result.message.text|auto_text_highlight|safe }}

{% set allLines = location.physicalLocation.contextRegion.snippet.text %} {% set firstLine = allLines.split("\n")[0].strip() %} {% set remLines = "
".join(allLines.split("\n")[1:]) %}
 {{ location.physicalLocation.contextRegion.startLine }}: {{ firstLine|safe }}
{{ remLines|safe }}
{%- endfor %}
{%- endfor %}
{% endif %}

All Issues ({{ metrics.total }})

{% for result in results|sort(attribute="properties.issue_severity") -%} {% set result_index = loop.index %} {% for location in result.locations -%} {% set allLines = location.physicalLocation.contextRegion.snippet.text %} {% set firstLine = allLines.split("\n")[0].strip() %} {% set remLines = "
".join(allLines.split("\n")[1:]) %} {%- endfor %} {%- endfor %}
Rule Severity Source location Message
{{ result.ruleId|default('') }} {{ result.properties.issue_severity }} {{ location.physicalLocation.artifactLocation.uri|basename }} {{ result.message.text|auto_text_highlight|safe }}
{{ firstLine|safe }}
{{ remLines|safe }}

Thank you for supporting AppThreat