[PATCH 38 of 54] HTML: Make one article per Vulnerability
Wald Commits
scm-commit at wald.intevation.org
Wed Jan 7 10:56:55 CET 2015
# HG changeset patch
# User Benoît Allard <benoit.allard at greenbone.net>
# Date 1418811185 -3600
# Node ID ba0eb65d413495f7c86594c9913bb9012e5934b1
# Parent cb8e8416a765a25c9761784692e0be7efc686b66
HTML: Make one article per Vulnerability
diff -r cb8e8416a765 -r ba0eb65d4134 farolluz/templates/html.j2
--- a/farolluz/templates/html.j2 Tue Dec 16 16:20:50 2014 +0100
+++ b/farolluz/templates/html.j2 Wed Dec 17 11:13:05 2014 +0100
@@ -9,8 +9,10 @@
<body>
<article>
<header>
- <h1>{{ cvrf._title }}</h1>
- <h2>{{ cvrf._type }}</h2>
+ <hgroup>
+ <h1>{{ cvrf._title }}</h1>
+ <h2>{{ cvrf._type }}</h2>
+ </hgroup>
</header>
{%- for note in cvrf._notes %}
<section>
@@ -18,61 +20,59 @@
<p>{{ note._description }}</p>
</section>
{%- endfor %}
- {%- for vuln in cvrf._vulnerabilities %}{% for note in vuln._notes %}
- <section>
- <h3>{{ note._title if note._title else note._type }}</h3>
- <p>{{ note._note }}</p>
- </section>
- {%- endfor %}{% endfor %}
- <section>
- <h3>Affected</h3>
- <ul>
- {%- for vuln in cvrf._vulnerabilities %}
- {%- for status in vuln._productstatuses %}
- <li>{{status._type}}: {% set comma = joiner(', ') %}
- {%- for prodid in status._productids %}
- {%- with product = cvrf.getProductForID(prodid) %}
- {{- comma() }}{{ product._name }}
- {%- endwith %}
- {%- endfor -%}
- </li>
- {%- endfor %}
+ {%- for vuln in cvrf._vulnerabilities %}
+ <article>
+ <header>
+ {%- if vuln._title %}<h2>{{ vuln._title }}</h2>{% endif %}
+ {%- if vuln._cve %}<h2>{{ vuln._cve }}</h2>{% endif %}
+ </header>
+ {%- for note in vuln._notes %}
+ <section>
+ <h3>{{ note._title if note._title else note._type }}</h3>
+ <p>{{ note._note }}</p>
+ </section>
{%- endfor %}
- </ul>
- </section>
- {%- with cvss = cvrf.getHighestCVSS() %}{% if cvss %}
- <section>
- <h3>Severity</h3>
- <p><tt>{{ cvss._vector }}</tt> ({{ cvss._basescore }} - {{ cvss._basescore | risk_factor }})<p>
- </section>
- {%- endif %}{% endwith %}
- <section>
- <h3>Resolution</h3>
- {%- for vuln in cvrf._vulnerabilities %}
- {%- for rem in vuln._remediations %}
<section>
- <h4>{{ rem._type }}</h4>
- <p>{{ rem._description }}</p>
+ <h3>Affected</h3>
+ <ul>
+ {%- for status in vuln._productstatuses %}
+ <li>{{status._type}}: {% set comma = joiner(', ') %}
+ {%- for prodid in status._productids %}
+ {%- with product = cvrf.getProductForID(prodid) %}
+ {{- comma() }}{{ product._name }}
+ {%- endwith %}
+ {%- endfor -%}
+ </li>
+ {%- endfor %}
+ </ul>
</section>
- {%- endfor %}
- {%- endfor %}
- </section>
- <section>
- <h3>References</h3>
- <ul>
- {%- for ref in cvrf._references if not ref._type == 'Self' %}
- <li>{{ ref }}</li>
- {%- endfor %}
- {%- for vuln in cvrf._vulnerabilities %}
- {%- for ref in vuln._references if not ref._type == 'Self' %}
- <li>{{ ref }}</li>
+ {%- with cvss = vuln._cvss %}{% if cvss %}
+ <section>
+ <h3>Severity</h3>
+ <p><tt>{{ cvss._vector }}</tt> ({{ cvss._basescore }} - {{ cvss._basescore | risk_factor }})<p>
+ </section>
+ {%- endif %}{% endwith %}
+ <section>
+ <h3>Resolution</h3>
+ {%- for rem in vuln._remediations %}
+ <section>
+ <h4>{{ rem._type }}</h4>
+ <p>{{ rem._description }}</p>
+ </section>
{%- endfor %}
- {%- if vuln._cve %}
- <li>{{ vuln._cve }}</li>
- {%- endif %}
- {%- endfor %}
- </ul>
- </section>
+ </section>
+ {%- if vuln._references %}
+ <section>
+ <h3>References</h3>
+ <ul>
+ {%- for ref in vuln._references %}
+ <li><a href="{{ ref._url }}">{{ ref._description }}</a></li>
+ {%- endfor %}
+ </ul>
+ </section>
+ {%- endif %}
+ </article>
+ {%- endfor %}
<section>
<h3>History</h3>
<ul>
@@ -81,6 +81,16 @@
{%- endfor %}
</ul>
</section>
+ {%- if cvrf._references %}
+ <section>
+ <h3>References</h3>
+ <ul>
+ {%- for ref in cvrf._references %}
+ <li><a href="{{ ref._url }}">{{ ref._description }}</a></li>
+ {%- endfor %}
+ </ul>
+ </section>
+ {%- endif %}
</article>
</body>
More information about the Farol-commits
mailing list