{% load markdown %}
{% load vulns %}
{% load vulnmantags %}
{% load i18n %}

<article id="vulnerability" class="chapter">
    <h1 class="chapter-title" id="vulnerability-title">{% trans "Vulnerability Overview" %}</h1>
</article>

<article id="vulnerabilities-list" class="page-content">
    <section>
        <h2>{% trans "Vulnerability Risk Definition and Criteria" %}</h2>

        <p>
            {% blocktrans %}
            The risk ratings assigned to each vulnerability are determined by averaging several aspects of the exploit
            and the environment, including reputation, difficulty,
            and criticality.
            {% endblocktrans %}
        </p>
        <table class="table-bordered">
            <tr>
                <th class="text-critical">{% trans "Critical" %}</th>
                <td>
                    {% blocktrans %}
                    Critical vulnerabilities pose a serious threat to an organization's security, and should be fixed
                    immediately.
                    They may provide a total compromise of the target environment, or similar critical impacts.
                    {% endblocktrans %}
                </td>
            </tr>
            <tr>
                <th class="text-high">{% trans "High" %}</th>
                <td>
                    {% blocktrans %}
                    High risk vulnerabilities provide a serious risk to the company environment and should
                    be corrected promptly. These issues can significantly affect the organization's security
                    posture.
                    {% endblocktrans %}
                </td>
            </tr>
            <tr>
                <th class="text-medium">{% trans "Medium" %}</th>
                <td>
                    {% blocktrans %}
                        Medium severity vulnerabilities represent a moderate risk to the environment. They may
                    require additional context before remediation but should be remediated after critical
                    and high risks.
                    {% endblocktrans %}

                </td>
            </tr>
            <tr>
                <th class="text-low">{% trans "Low" %}</th>
                <td>
                    {% blocktrans %}
                    Low severity vulnerabilities provide minimal risk to the target environment, and often
                    theoretical in nature. Remediation of low risks is often a lower priority than other
                    security hardening techniques.
                    {% endblocktrans %}
                </td>
            </tr>
            <tr>
                <th class="text-informational">{% trans "Informational" %}</th>
                <td>
                    {% blocktrans %}
                    Informational vulnerabilities have little-or-no impact to the target scope by themselves.
                    They are included however, as they may be a risk when combined with other
                    circumstances or technologies not currently in place. Remediation of informational items
                    is not necessary.
                    {% endblocktrans %}
                </td>
            </tr>
        </table>
    </section>
    <div class="page-break"></div>

    <section>
        <h2>{% trans 'Vulnerability Categories' %}</h2>
        <p>
            {% blocktrans %}
            The vulnerabilities found were divided into categories.
            These provide an overview of the area in which the most errors were found.
            {% endblocktrans %}
        </p>
        <p>
            {% blocktrans %}
            In the case of clear deflections, consideration should be given to appropriate countermeasures in these areas.
            {% endblocktrans %}
        </p>
        <div class="chart-container">
            {{ CATEGORY_POLAR_CHART|safe }}
        </div>
    </section>

    <section>
        <h2>{% trans 'Vulnerabilities by Risk Level' %}</h2>
        <p>
            {% blocktrans %}
            The following vulnerabilities were found within each risk level.
            {% endblocktrans %}
        </p>
        <div class="chart-container">
            <div id="severity-chart">
            {{ SEVERITY_CHART_SRC|safe }}
            </div>
        </div>

    </section>
    <div class="page-break"></div>

    <section>
        <h2>{% trans 'Vulnerabilities' %}</h2>

        <p>{% trans 'The following table lists the vulnerabilities found in order of their criticality' %}.</p>

        <table class="table-bordered">
            <thead>
            <tr>
                <th>{% trans 'Vulnerability' %}</th>
                <th>{% trans 'Findings' %}</th>
                <th>{% trans 'Risk Level' %}</th>
            </tr>
            </thead>
            <tbody>
                {% for template in templates %}
                    <tr>
                        <td><a href="#template-{{ template.pk }}">{{template.name}}</a></td>
                        <td>{{template.count}}</td>
                        <td>
                            <span class="fa-layers text-{{ template.vulnerability__severity|get_severity_name|lower }}">
                                <i class="fas fa-bookmark"></i>
                                <span class="fa-layers-text" data-fa-transform="shrink-8 down-3" style="font-weight:900">{{ template.vulnerability__severity|get_severity_name|capfirst}}</span>
                            </span>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </section>
</article>
