Skip to content

Commit

Permalink
Merge branch 'master' of github.com:greenbone/gvm into openvas-via-osp
Browse files Browse the repository at this point in the history
  • Loading branch information
timopollmeier committed May 21, 2019
2 parents 8694edf + 25ff0d7 commit 6565f37
Show file tree
Hide file tree
Showing 34 changed files with 1,799 additions and 15,296 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2009-2018 Greenbone Networks GmbH
# Copyright (C) 2009-2019 Greenbone Networks GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
Expand Down Expand Up @@ -117,7 +117,7 @@ include (CPack)

## Variables

set (GVMD_DATABASE_VERSION 206)
set (GVMD_DATABASE_VERSION 208)

set (GVMD_SCAP_DATABASE_VERSION 15)

Expand Down
12 changes: 7 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Prerequisites:
* cmake >= 3.0
* glib-2.0 >= 2.42
* gnutls >= 3.2.15
* libgvm_base, libgvm_util, libgvm_osp, libgvm_gmp >= 1.0.0
* libgvm_base, libgvm_util, libgvm_osp, libgvm_gmp >= 11.0.0
* sqlite3 library >= 3.8.3 or PostgreSQL database
* pkg-config
* libical >= 1.0.0
Expand Down Expand Up @@ -161,8 +161,8 @@ properly.
If the `gsf-access-key` file was already migrated for the `openvas-scanner`
module it can be removed from the `$prefix/etc/openvas/` directory.

- move ´$prefix/var/lib/openvas/scap-data`` to
$prefix/var/lib/gvm/scap-data
- move `$prefix/var/lib/openvas/scap-data` to
`$prefix/var/lib/gvm/scap-data`

- move `$prefix/var/lib/openvas/cert-data` to
`$prefix/var/lib/gvm/cert-data`
Expand All @@ -180,8 +180,10 @@ properly.
`$prefix/var/lib/gvm/gvmd/gvmd.db`

- (Postgres backend only) rename database to `gvmd`:
sudo -u postgres sh
psql --command='ALTER DATABASE tasks RENAME TO gvmd;'
```
sudo -u postgres sh
psql --command='ALTER DATABASE tasks RENAME TO gvmd;'
```


Migrating the Database
Expand Down
26 changes: 13 additions & 13 deletions report_formats/HTML/HTML.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
encoding="UTF-8" />

<!--
Copyright (C) 2010-2018 Greenbone Networks GmbH
Copyright (C) 2010-2019 Greenbone Networks GmbH
SPDX-License-Identifier: GPL-2.0-or-later
Expand Down Expand Up @@ -351,27 +351,27 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</xsl:if>
</xsl:template>

<xsl:template name="ref_cert_list">
<xsl:param name="certlist"/>
<xsl:template name="ref_list">
<xsl:param name="reflist"/>
<xsl:variable name="token" select="/envelope/token"/>
<xsl:variable name="certcount" select="count($certlist/cert_ref)"/>
<xsl:variable name="refcount" select="count($reflist/ref)"/>

<xsl:if test="count($certlist/warning)">
<xsl:for-each select="$certlist/warning">
<xsl:if test="count($reflist/warning)">
<xsl:for-each select="$reflist/warning">
<tr valign="top">
<td>CERT:</td>
<td><i>Warning: <xsl:value-of select="text()"/></i></td>
</tr>
</xsl:for-each>
</xsl:if>

<xsl:if test="$certcount &gt; 0">
<xsl:if test="$refcount &gt; 0">
<tr valign="top">
<td>CERT:</td>
<td>
<xsl:for-each select="$certlist/cert_ref">
<xsl:for-each select="$reflist/ref">
<xsl:value-of select="@id"/>
<xsl:if test="position() &lt; $certcount">
<xsl:if test="position() &lt; $refcount">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
Expand Down Expand Up @@ -665,14 +665,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<xsl:value-of select="nvt/bid/text()"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="cert_ref" select="nvt/cert"/>
<xsl:variable name="refs" select="nvt/refs"/>
<xsl:variable name="xref">
<xsl:if test="nvt/xref != '' and nvt/xref != 'NOXREF'">
<xsl:value-of select="nvt/xref/text()"/>
</xsl:if>
</xsl:variable>

<xsl:if test="$cve_ref != '' or $bid_ref != '' or $xref != '' or count($cert_ref/cert_ref) > 0">
<xsl:if test="$cve_ref != '' or $bid_ref != '' or $xref != '' or count($refs/ref) > 0">
<div class="result_section">
<b>References</b><br/>
<p>
Expand All @@ -683,8 +683,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<xsl:call-template name="ref_bid_list">
<xsl:with-param name="bidlist" select="$bid_ref"/>
</xsl:call-template>
<xsl:call-template name="ref_cert_list">
<xsl:with-param name="certlist" select="$cert_ref"/>
<xsl:call-template name="ref_list">
<xsl:with-param name="reflist" select="$refs"/>
</xsl:call-template>
<xsl:call-template name="ref_xref_list">
<xsl:with-param name="xreflist" select="$xref"/>
Expand Down
16 changes: 8 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2009-2018 Greenbone Networks GmbH
# Copyright (C) 2009-2019 Greenbone Networks GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
Expand Down Expand Up @@ -27,10 +27,10 @@ find_package (Threads)
## list and throw an error, otherwise long install-cmake-install-cmake cycles
## might occur.

pkg_check_modules (LIBGVM_BASE REQUIRED libgvm_base>=1.0.0)
pkg_check_modules (LIBGVM_UTIL REQUIRED libgvm_util>=1.0.0)
pkg_check_modules (LIBGVM_OSP REQUIRED libgvm_osp>=1.0.0)
pkg_check_modules (LIBGVM_GMP REQUIRED libgvm_gmp>=1.0.0)
pkg_check_modules (LIBGVM_BASE REQUIRED libgvm_base>=11.0.0)
pkg_check_modules (LIBGVM_UTIL REQUIRED libgvm_util>=11.0.0)
pkg_check_modules (LIBGVM_OSP REQUIRED libgvm_osp>=11.0.0)
pkg_check_modules (LIBGVM_GMP REQUIRED libgvm_gmp>=11.0.0)
pkg_check_modules (GNUTLS REQUIRED gnutls>=3.2.15)
pkg_check_modules (GLIB REQUIRED glib-2.0>=2.42)
pkg_check_modules (LIBICAL REQUIRED libical>=1.00)
Expand Down Expand Up @@ -237,9 +237,9 @@ if (GVM_NVT_DIR)
add_definitions (-DGVM_NVT_DIR="${GVM_NVT_DIR}")
endif (GVM_NVT_DIR)

if (SBINDIR)
add_definitions (-DSBINDIR="${SBINDIR}")
endif (SBINDIR)
if (BINDIR)
add_definitions (-DBINDIR="${BINDIR}")
endif (BINDIR)

if (DEFINED GVM_SQLITE_SLEEP_MAX)
add_definitions (-DGVM_SQLITE_SLEEP_MAX=${GVM_SQLITE_SLEEP_MAX})
Expand Down
2 changes: 1 addition & 1 deletion src/alert_methods/SMB/alert
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def smb_error_print(message, stdout, stderr):


def smb_call(auth_path, share, command):
args = ["smbclient", "-m", "SMB3", "-A", auth_path, share, "-c", command]
args = ["smbclient", "-A", auth_path, share, "-c", command]
retries = 10
stdout = ''
stderr = ''
Expand Down
14 changes: 11 additions & 3 deletions src/alert_methods/TippingPoint/report-convert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# coding: utf-8
# Copyright (C) 2018 Greenbone Networks GmbH
# Copyright (C) 2019 Greenbone Networks GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
Expand Down Expand Up @@ -135,9 +135,17 @@ def convert (xml_tree, out_file):
ip = result_elem.find ('host').text
description = result_elem.find ('description').text

nvt_cve = '';
nvt_elem = result_elem.find ('nvt')
nvt_cve = nvt_elem.find ('cve').text;
if (nvt_cve == 'NOCVE' or nvt_cve == '' or nvt_cve is None):
nvt_refs = nvt_elem.find ('refs');
for ref in nvt_refs.findall('ref'):
if (ref.attrib['type'] == 'cve'):
if (nvt_cve == ''):
nvt_cve = ref.attrib['id'];
else:
nvt_cve = nvt_cve + ', ' + ref.attrib['id'];

if (nvt_cve == '' or nvt_cve is None):
continue;

nvt_oid = nvt_elem.attrib['oid']
Expand Down
Loading

0 comments on commit 6565f37

Please sign in to comment.