benoit@0: {# benoit@0: # Description: benoit@0: # Template for generation of CVRF documents benoit@0: # benoit@0: # Authors: benoit@0: # BenoƮt Allard benoit@0: # benoit@0: # Copyright: benoit@0: # Copyright (C) 2014 Greenbone Networks GmbH benoit@0: # benoit@0: # This program is free software; you can redistribute it and/or benoit@0: # modify it under the terms of the GNU General Public License benoit@0: # as published by the Free Software Foundation; either version 2 benoit@0: # of the License, or (at your option) any later version. benoit@0: # benoit@0: # This program is distributed in the hope that it will be useful, benoit@0: # but WITHOUT ANY WARRANTY; without even the implied warranty of benoit@0: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the benoit@0: # GNU General Public License for more details. benoit@0: # benoit@0: # You should have received a copy of the GNU General Public License benoit@0: # along with this program; if not, write to the Free Software benoit@0: # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. benoit@0: -#} benoit@0: benoit@0: benoit@0: benoit@0: {#- Some macros for producttree generation #} benoit@0: {%- macro FullProductNames(producttree, parent) %} benoit@0: {%- for product in producttree._products %} benoit@0: {%- if product._parent is sameas parent %} benoit@0: benoit@0: {{- product._name -}} benoit@0: benoit@0: {%- endif %} benoit@0: {%- endfor %} benoit@0: {%- endmacro %} benoit@0: benoit@0: {%- macro Note(note) -%} benoit@0: benoit@0: {{- note._note | escape -}} benoit@0: benoit@0: {%- endmacro %} benoit@0: benoit@0: {{ cvrf._title }} benoit@0: {{ cvrf._type }} benoit@0: {%- with publisher = cvrf._publisher %} benoit@0: benoit@0: {%- if publisher._contact %} benoit@0: {{ publisher._contact }} benoit@0: {%- endif %} benoit@0: {%- if publisher._authority %} benoit@0: {{ publisher._authority }} benoit@0: {%- endif %} benoit@0: benoit@0: {%- endwith %} benoit@0: {%- with tracking = cvrf._tracking %} benoit@0: benoit@0: benoit@0: {{ tracking._identification._id }} benoit@0: {%- for alias in tracking._identification._aliases %} benoit@0: {{ alias }} benoit@0: {%- endfor %} benoit@0: benoit@0: {{ tracking._status }} benoit@0: {{ tracking._version | join('.') }} benoit@0: benoit@0: {%- for revision in tracking._history %} benoit@0: benoit@0: {{ revision._number | join('.') }} benoit@0: {{ revision._date.isoformat() }} benoit@0: {{ revision._description }} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {{ tracking._initialDate.isoformat() }} benoit@0: {{ tracking._currentDate.isoformat() }} benoit@0: {%- if tracking._generator %} benoit@0: benoit@0: {%- with generator = tracking._generator %} benoit@0: {%- if generator._engine %} benoit@0: {{ generator._engine }} benoit@0: {%- endif %} benoit@0: {%- if generator._date %} benoit@0: {{ generator._date.isoformat() }} benoit@0: {%- endif %} benoit@0: {%- endwith %} benoit@0: benoit@0: {%- endif %} benoit@0: benoit@0: {%- endwith %} benoit@0: {%- if cvrf._notes %} benoit@0: benoit@0: {%- for note in cvrf._notes %} benoit@0: {{ Note(note) }} benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if cvrf._distribution %} benoit@0: {{ cvrf._distribution }} benoit@0: {%- endif %} benoit@0: {#- AggregateSeverity is missing #} benoit@0: {%- if cvrf._references %} benoit@0: benoit@0: {%- for reference in cvrf._references %} benoit@0: benoit@0: {{ reference._url }} benoit@0: {{ reference._description }} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if cvrf._acknowledgments %} benoit@0: benoit@0: {%- for acknowledgment in cvrf._acknowledgments %} benoit@0: benoit@0: {%- if acknowledgment._name %} benoit@0: {{ acknowledgment._name }} benoit@0: {%- endif %} benoit@0: {%- if acknowledgment._organization %} benoit@0: {{ acknowledgment._organization }} benoit@0: {%- endif %} benoit@0: {%- if acknowledgment._description %} benoit@0: {{ acknowledgment._description }} benoit@0: {%- endif %} benoit@0: {%- if acknowledgment._url %} benoit@0: {{ acknowledgment._url }} benoit@0: {%- endif %} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if cvrf._producttree %} benoit@0: benoit@0: {%- with producttree = cvrf._producttree %} benoit@0: {%- for branch in producttree._branches recursive %} benoit@0: benoit@0: {{- loop(branch._childs) }} benoit@0: {{- FullProductNames(producttree, branch) }} benoit@0: benoit@0: {%- endfor %} benoit@0: {{ FullProductNames(producttree, producttree) }} benoit@0: {%- for relationship in producttree._relationships -%} benoit@0: benoit@0: {{- FullProductNames(producttree, relationship) }} benoit@0: benoit@0: {%- endfor %} benoit@0: {%- if producttree._groups %} benoit@0: benoit@0: {%- for group in producttree._groups %} benoit@0: benoit@0: {%- if group._description %} benoit@0: {{ group._description }} benoit@0: {%- endif %} benoit@0: {%- for productid in group._productids %} benoit@0: {{ productid }} benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- endwith %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- for vulnerability in cvrf._vulnerabilities %} benoit@0: benoit@0: {%- if vulnerability._title %} benoit@0: {{ vulnerability._title }} benoit@0: {%- endif %} benoit@0: {%- if vulnerability._id %} benoit@0: {{ vulnerability._id._value }} benoit@0: {%- endif %} benoit@0: {%- if vulnerability._notes %} benoit@0: benoit@0: {%- for note in vulnerability._notes %} benoit@0: {{ Note(note) }} benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if vulnerability._discoverydate %} benoit@0: {{ vulnerability._discoverydate.isoformat() }} benoit@0: {%- endif %} benoit@0: {%- if vulnerability._releasedate %} benoit@0: {{ vulnerability._releasedate.isoformat() }} benoit@0: {%- endif %} benoit@0: {%- if vulnerability._involvements %} benoit@0: benoit@0: {%- for involvement in vulnerability._involvements %} benoit@0: benoit@0: {%- if involvement._description %} benoit@0: {{ involvement._description }} benoit@0: {%- endif %} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if vulnerability._cve %} benoit@0: {{ vulnerability._cve }} benoit@0: {%- endif %} benoit@0: {%- for cwe in vulnerability._cwes %} benoit@0: {{ cwe._value }} benoit@0: {%- endfor %} benoit@0: {%- if vulnerability._productstatuses %} benoit@0: benoit@0: {%- for status in vulnerability._productstatuses %} benoit@0: benoit@0: {%- for productid in status._productids %} benoit@0: {{ productid }} benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if vulnerability._cvsss %} benoit@0: benoit@0: {%- for cvss in vulnerability._cvsss %} benoit@0: benoit@0: {{ cvss._basescore }} benoit@0: {%- if cvss._temporalscore %} benoit@0: {{ cvss._temporalscore }} benoit@0: {%- endif %} benoit@0: {%- if cvss._environmentalscore %} benoit@0: {{ cvss._environmentalscore }} benoit@0: {%- endif %} benoit@0: {%- if cvss._vector %} benoit@0: {{ cvss._vector }} benoit@0: {%- endif %} benoit@0: {%- for productid in cvss._productids %} benoit@0: {{productid}} benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: {%- if vulnerability._remediations %} benoit@0: benoit@0: {%- for remediation in vulnerability._remediations %} benoit@0: benoit@0: {{ remediation._description }} benoit@0: {%- if remediation._entitlement %} benoit@0: {{ remediation._entitlement }} benoit@0: {%- endif %} benoit@0: {%- if remediation._url %} benoit@0: {{ remediation._url }} benoit@0: {%- endif %} benoit@0: {%- for productid in remediation._productids %} benoit@0: {{ productid }} benoit@0: {%- endfor %} benoit@0: {%- for groupid in remediation._groupids %} benoit@0: {{ groupid }} benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endfor %} benoit@0: benoit@0: {%- endif %} benoit@0: benoit@0: {%- endfor %} benoit@0: