Secure-Compliance-Solutions-LLC / GVM-Docker

Greenbone Vulnerability Management Docker Image with OpenVAS
https://securecompliance.gitbook.io/projects/
MIT License
247 stars 91 forks source link

[Bug] rsync: [receiver] mkstemp "XXXXXX" failed: Permission denied (13) #277

Closed v1c5anchez closed 3 years ago

v1c5anchez commented 3 years ago

Describe the bug

Dear all,

Initially I detected the following situation:

When parsing the gvmd.log file in order to list the feed updates (and the corresponding number of NVTs) I found what follows:

root@XXXXXXX:/# grep "... done" /usr/local/var/log/gvm/gvmd.log
md manage:   INFO:2021-07-02 11h43.03 utc:1440: Updating VTs in database ... done (74526 VTs).
md manage:   INFO:2021-07-07 07h58.04 utc:990: Updating VTs in database ... done (74526 VTs).
md manage:   INFO:2021-07-08 16h22.09 utc:23153: Updating VTs in database ... done (74529 VTs).
(...)
md manage:   INFO:2021-09-14 10h18.58 utc:2057524: Updating VTs in database ... done (74546 VTs).
md manage:   INFO:2021-09-14 11h08.02 utc:1099: Updating VTs in database ... done (74549 VTs).
md manage:   INFO:2021-09-15 14h14.56 utc:2146837: Updating VTs in database ... done (74549 VTs).

The number of NVTs has not grown significantly since 2021-07-02.

However, when creating a new container from the very same image (and subsequently, downloading the feed for the first time in the new container) I have detected that the number of NVTs is way larger (around 76000 NVTs).

As a consequence of this I have attempted to force update the NVTs by hand as shown by @pixelsquared in https://github.com/Secure-Compliance-Solutions-LLC/GVM-Docker/discussions/147#discussioncomment-548518, using the command:

docker exec -it gvm /sync-all.sh

What I see in the logs is the following:

(...)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.xst_http_trace.nasl.W7o4q3" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yabb_xss.nasl.UDp9k5" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yacy_xss.nasl.28Tog2" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yahoo_dos.nasl.qo83b5" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yapig_multiple_flaws.nasl.KWZL21" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yapig_pass_dir_access.nasl.uRb9O1" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yapig_remote_vuln.nasl.SsV3F1" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yawcam_dir_traversal.nasl.TSAta4" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.yusasp_asset_manager_detection.nasl.VwjBK1" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zebra_dos.nasl.tg10Z5" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zeroboard_flaws.nasl.iYsLy5" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zeroboard_flaws2.nasl.FYVvB1" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zeroboard_xss.nasl.3Wo3q3" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zml_cgi_traversal.nasl.7kROE3" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zone_alarm_fw_p67.nasl.5JZbc5" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zope_path_disclosure.nasl.68fRQ2" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zope_zclass.nasl.8urJK1" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zyxel_http_pwd.nasl.xZ5QB4" failed: Permission denied (13)
rsync: [receiver] mkstemp "/usr/local/var/lib/openvas/plugins/pre2008/.zyxel_pwd.nasl.4IJbG1" failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1816) [generator=3.2.3]
Updating GVMd data...
Greenbone community feed server - http://feed.community.greenbone.net/
This service is hosted by Greenbone Networks - http://www.greenbone.net/

All transactions are logged.

If you have any questions, please use the Greenbone community portal.
See https://community.greenbone.net for details.

By using this service you agree to our terms and conditions.

Only one sync per time, otherwise the source ip will be temporarily blocked.

receiving incremental file list
timestamp
             13 100%   12.70kB/s    0:00:00 (xfr#1, to-chk=0/1)

sent 43 bytes  received 115 bytes  316.00 bytes/sec
total size is 13  speedup is 0.08
Updating SCAP data...
/usr/local/sbin/greenbone-feed-sync: 259: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 260: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 261: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 262: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 263: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 264: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 265: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 266: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 267: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 268: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 269: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 270: cannot create /usr/local/var/lib/gvm/scap-data/feed.xml: Permission denied
Greenbone community feed server - http://feed.community.greenbone.net/
This service is hosted by Greenbone Networks - http://www.greenbone.net/

All transactions are logged.

If you have any questions, please use the Greenbone community portal.
See https://community.greenbone.net for details.

By using this service you agree to our terms and conditions.

Only one sync per time, otherwise the source ip will be temporarily blocked.

receiving incremental file list
timestamp
             13 100%   12.70kB/s    0:00:00 (xfr#1, to-chk=0/1)

sent 43 bytes  received 115 bytes  316.00 bytes/sec
total size is 13  speedup is 0.08
Updating CERT data...
/usr/local/sbin/greenbone-feed-sync: 259: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 260: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 261: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 262: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 263: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 264: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 265: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 266: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 267: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 268: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 269: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
/usr/local/sbin/greenbone-feed-sync: 270: cannot create /usr/local/var/lib/gvm/cert-data/feed.xml: Permission denied
Greenbone community feed server - http://feed.community.greenbone.net/
This service is hosted by Greenbone Networks - http://www.greenbone.net/

All transactions are logged.

If you have any questions, please use the Greenbone community portal.
See https://community.greenbone.net for details.

By using this service you agree to our terms and conditions.

Only one sync per time, otherwise the source ip will be temporarily blocked.

receiving incremental file list
timestamp
             13 100%   12.70kB/s    0:00:00 (xfr#1, to-chk=0/1)

sent 43 bytes  received 115 bytes  105.33 bytes/sec
total size is 13  speedup is 0.08

All files seem to be in place:

# ls -l /usr/local/var/lib/gvm/scap-data/feed.xml
-rw-r--r-- 1 1001 121 583 Jul  1 00:46 /usr/local/var/lib/gvm/scap-data/feed.xml
# ls -l /usr/local/var/lib/gvm/scap-data/oval/5.10/org.mitre.oval/
total 20
drwxr-xr-x 2 1001 121 4096 Jul  1 00:45 c
drwxr-xr-x 2 1001 121 4096 Jul  1 00:45 i
drwxr-xr-x 2 1001 121 4096 Jul  1 00:45 m
drwxr-xr-x 2 1001 121 4096 Jul  1 00:46 p
drwxr-xr-x 3 1001 121 4096 Jul  1 00:43 v
# ls -l /usr/local/var/lib/gvm/scap-data/oval/5.10/org.mitre.oval/c/
total 264
-rw-r--r-- 1 1001 121 268150 Sep 18  2014 oval.xml

Additionally, when logged in the docker container:

# whoami
root
# ls -l sync-all.sh
-rwxr-xr-x 1 root root 1318 May 31 14:09 sync-all.sh

To Reproduce

docker exec -it gvm /sync-all.sh

Expected behavior I suppose I should not get those #Permission denied (13) logs

Host Device:

Static hostname: XXXXXXXX
Icon name: computer-vm
Chassis: vm
Virtualization: oracle
Operating System: Arch Linux
Kernel: Linux 5.12.12-arch1-1
Architecture: x86-64
Hardware Vendor: innotek GmbH
Hardware Model: VirtualBox

Image in use:

Dexus commented 3 years ago

Please use a newer version or wait for the new Debian based release.

ilyaevseev commented 1 year ago

The same problem with newest image.