I have some questions (more like clarifications) regarding the functioning of GVM11NVT’s management. I am trying to grasp how gvm is working behind the scenes.
Running greenbone-nvt-sync synchronizes NVT’s local postgresql db.
Using openvas -u loads the plugins (which includes NVT’s) into Redis.
This is not necessary should I run a scanner using ospd-openvas as it will do the update automatically each time a new feed is detected (I understand this new feed as being the comparison to the manager’s postgresql).
We can start a manager by specifying --osp-vt-update=<scanner-socket> (Unix socket for OSP NVT update) so that when there is a new feed, the manager will send the new NVT’s (from postgres) into the scanner’s Redis. So if I want a new scanner they need to share the same socket or it won’t get updated?
Every couple of seconds or so the manager spawns two processes:
I understand the manager is using osp through openvas-ospd and updating NVT cache on the scanner. How does this cache relate to Redis?
Also, what is the point on doing it with such high frequency, even on standby (i.e no scans running)?
This is a bit unrelated but whenever postgres fails and comes back up gvmd displays the following logs:
These logs are repeated indefinitely every 10s despite postgres being back up and GVM being able to perform scans, get reports etc. It appears to be happening with sqlitehttps://github.com/greenbone/gvmd/issues/347 on previous versions. Sounds like something is not being closed. I’ll take a further look this weekend but any hints are welcome.
The NVT’s update is performed in the opposite direction. When greenbone-nvt-feed is run, you get the new feed and ospd-scanner stores it in Redis automatically (or you can do it manually running openvas -u). Then, gvmd asks ospd-scanner for the feed version (once each 10 seconds). In case there is a new feed, gvmd will get the new/modified NVT’s.
Regarding the point 5., unfortunately I don’t have the answer for that.
Thank you for the response!
So greenbone-nvt-sync downloads/syncs and stores in Redis while openvas -u by itself only loads existing plugins to Redis. I guess the manager asks ospd-scanner with 10s frequency because it needs the updated feed with some “novelty” for the interface.
When working within gsad, all NVT data is in place and all scans are working perfectly.
However, under GSA menu “Administration” > “Feed Status”, only the SCAP and CERT feed versions are visible, the NVT feed version is nowhere to be seen. Just the same, the NVT feed is up to date on the system as can be seen with “$ greenbone-nvt-sync --feedversion”.
What happens in case the scanner is run remotely, so not available via file socket. We could imagine a situation, although probably not frequent, where the scanner is not running on the server hosting gvmd and gsad. I have looked into gvmd but I could not find out any option like --osp-vt-update which could be used with a network socket.
I don’t think it’s possible with current version.My understanding is that you need to setup feeds updates with a socket ospd-openvas on the system where gsad/gvmd run AND on the slave, you need to setup feeds updates too, but you don’t need to have gvmd run there. Only ospd-openvas + greenbone feeds updates scripts.
It’s what I’m doing at the moment and it works. The burden being you need to managed updates on all nodes separately, knowing that when a slave is updated, you won’t be able to start scan from the manager; which will set the scan task as “Done” because it doesn’t know a feed update is under way on the slave node.
From my perspective, it would makes more sense to have feeds updates managed centrally. This would avoid the risk of inconsistencies between scanners, and would reduce the load on feeds.greenbone.net because you would only need to download the feeds on one central node.
Hm, thanks for the insight. Then it currently makes no sense to switch to OSP. With GPM you can attach a remote GVM and distribute tasks to it. The remote GVM contacts the local ospd-openvas thru socket so you have NVT’s.