immauss / openvas

Containers for running the Greenbone Vulnerability Manager. Run as a single container with all services or separate single applications containers via docker-compose.
GNU Affero General Public License v3.0
354 stars 102 forks source link

immauss/openvas:armv7: Two problems that prevent me from using the container #55

Closed TheUntouchable closed 3 years ago

TheUntouchable commented 3 years ago

Image: immauss/openvas:armv7 Version: 21.04.02

Just tried this on my raspberrypi 3 and had some problems :)

First, I had to recreate the container with "Privileged mode" on, as I got this error: sleep: cannot read realtime clock: Operation not permitted

Second, after that was fixed, I got the following error:

10 Jul 2021 23:40:13.554 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10 Jul 2021 23:40:13.554 # Redis version=5.0.7, bits=32, commit=00000000, modified=0, pid=9, just started
10 Jul 2021 23:40:13.554 # Configuration loaded
Wait for redis socket to be created...
Testing redis status...
Redis ready.
Creating Data and database folder...
Fixing Database folder...
Fixing local/var/lib ... 
cp: cannot stat '/usr/local/var/lib/*': No such file or directory

The following folders were created on the storage: grafik

immauss commented 3 years ago

Sorry. Arm/v7 is giving me a hard time. At the moment, I'm not able to build it. It fails on dependencies with the same Dockerfile the arm64 and amd64 work fine on.

TheUntouchable commented 3 years ago

No problem! Take your time :) Just wanted to migrate everything which I have currently running on my Synology NAS to my RaspverryPI ;)

immauss commented 3 years ago

See the most recent update on the README.md Short story .. a seperate ARMv7 tag is coming.

immauss commented 3 years ago

Soooo .... there is an armv7 tag ... but I've been on the beach all week and don't have an actual armv7 to test this on. I've been testing with qemu-arm (emulation) which may be causing the problem I'm seeing with postgresql. If you have time and a system, could you see if it works. You'll need to first build a good DB as I've not been able to do that for pg11 since this image keeps crashing. Use something like:

docker pull immauss/openvas:armv7 && docker run -d -p 9392:9392 --name armv7 -v armv7:/data -e NEWDB=true immauss/openvas:armv7 && docker logs -f armv7

IF that is successful, it will build the new DB after rsync with greenbone.
to restart it, you will need to stop, then delete the original container, and restart with the same command without the -e NEWDB=true

Thanks, Scott

TheUntouchable commented 3 years ago

Hey Scott,

Here are my startup logs, I think the intitial start was successfull, but I realized that my raspberry pi 3 with 1GB of RAM is really to less for OpenVAS, the update never finished with a very hight load :D I will buy a new 4 the next days.. Please let me know if you need more of this logs

`8:C 23 Jul 2021 20:38:03.422 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 8:C 23 Jul 2021 20:38:03.422 # Redis version=5.0.3, bits=32, commit=00000000, modified=0, pid=8, just started 8:C 23 Jul 2021 20:38:03.422 # Configuration loaded Wait for redis socket to be created... Testing redis status... Redis ready. Creating Data and database folder... '/etc/postgresql/11/main/conf.d' -> '/data/database/conf.d' '/etc/postgresql/11/main/environment' -> '/data/database/environment' '/etc/postgresql/11/main/pg_ctl.conf' -> '/data/database/pg_ctl.conf' '/etc/postgresql/11/main/pg_hba.conf' -> '/data/database/pg_hba.conf' '/etc/postgresql/11/main/pg_ident.conf' -> '/data/database/pg_ident.conf' '/etc/postgresql/11/main/postgresql.conf' -> '/data/database/postgresql.conf' '/etc/postgresql/11/main/start.conf' -> '/data/database/start.conf' Fixing Database folder... Fixing local/var/lib ... Fixing local/share ... Fixing log directory for persistent logs .... Settup for Postgresql 11 Starting PostgreSQL... waiting for server to start....2021-07-23 20:38:25.670 UTC [40] LOG: listening on IPv4 address "127.0.0.1", port 5432 2021-07-23 20:38:25.670 UTC [40] LOG: could not bind IPv6 address "::1": Cannot assign requested address 2021-07-23 20:38:25.670 UTC [40] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2021-07-23 20:38:25.681 UTC [40] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2021-07-23 20:38:25.735 UTC [41] LOG: database system was shut down at 2021-07-21 06:04:26 UTC 2021-07-23 20:38:25.761 UTC [40] LOG: database system is ready to accept connections done server started Running first start configuration... Adding gvm user Fixing feed rsync options Generating certs... Generated private key in /tmp/tmp.LyKvjhWLjg/cakey.pem. Generated self signed certificate in /tmp/tmp.LyKvjhWLjg/cacert.pem. Installed private key to /usr/local/var/lib/gvm/private/CA/cakey.pem. Installed certificate to /usr/local/var/lib/gvm/CA/cacert.pem. Generated private key in /tmp/tmp.LyKvjhWLjg/serverkey.pem. Generated certificate request in /tmp/tmp.LyKvjhWLjg/serverrequest.pem. Signed certificate request in /tmp/tmp.LyKvjhWLjg/serverrequest.pem with CA certificate in /usr/local/var/lib/gvm/CA/cacert.pem to generate certificate in /tmp/tmp.LyKvjhWLjg/servercert.pem Installed private key to /usr/local/var/lib/gvm/private/CA/serverkey.pem. Installed certificate to /usr/local/var/lib/gvm/CA/servercert.pem. Generated private key in /tmp/tmp.LyKvjhWLjg/clientkey.pem. Generated certificate request in /tmp/tmp.LyKvjhWLjg/clientrequest.pem. Signed certificate request in /tmp/tmp.LyKvjhWLjg/clientrequest.pem with CA certificate in /usr/local/var/lib/gvm/CA/cacert.pem to generate certificate in /tmp/tmp.LyKvjhWLjg/clientcert.pem Installed private key to /usr/local/var/lib/gvm/private/CA/clientkey.pem. Installed certificate to /usr/local/var/lib/gvm/CA/clientcert.pem. Removing temporary directory /tmp/tmp.LyKvjhWLjg. Checking for existing DB postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 | template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres

DB is Creating Greenbone Vulnerability Manager database CREATE ROLE GRANT ROLE CREATE EXTENSION CREATE EXTENSION waiting for server to shut down....2021-07-23 20:38:45.644 UTC [40] LOG: received fast shutdown request 2021-07-23 20:38:45.674 UTC [40] LOG: aborting any active transactions 2021-07-23 20:38:45.683 UTC [40] LOG: background worker "logical replication launcher" (PID 47) exited with exit code 1 2021-07-23 20:38:45.689 UTC [42] LOG: shutting down 2021-07-23 20:38:45.935 UTC [40] LOG: database system is shut down done server stopped waiting for server to start....2021-07-23 20:38:46.018 UTC [171] LOG: listening on IPv4 address "127.0.0.1", port 5432 2021-07-23 20:38:46.019 UTC [171] LOG: could not bind IPv6 address "::1": Cannot assign requested address 2021-07-23 20:38:46.019 UTC [171] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2021-07-23 20:38:46.041 UTC [171] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2021-07-23 20:38:46.110 UTC [172] LOG: database system was shut down at 2021-07-23 20:38:45 UTC 2021-07-23 20:38:46.146 UTC [171] LOG: database system is ready to accept connections done server started Unpacking base feeds data from /usr/lib/var-lib.tar.xz ERROR: function create_index(unknown, unknown, unknown) does not exist LINE 1: SELECT create_index ('vt_severities_by_vt_oid','vt_severitie... ^ 2021-07-23 20:41:33.860 UTC [196] postgres@gvmd ERROR: function create_index(unknown, unknown, unknown) does not exist at character 8 HINT: No function matches the given name and argument types. You might need to add explicit type casts. 2021-07-23 20:41:33.860 UTC [196] postgres@gvmd HINT: No function matches the given name and argument types. You might need to add explicit type casts. 2021-07-23 20:41:33.860 UTC [196] postgres@gvmd STATEMENT: SELECT create_index ('vt_severities_by_vt_oid','vt_severities', 'vt_oid'); Migrating the database to the latest version if needed. Updating NVTs and other data This could take a while if you are not using persistent storage for your NVTs or this is the first time pulling to your persistent storage. the time will be mostly dependent on your available bandwidth. We sleep for 5 seconds between sync command to make sure everything closes and it doesnt' look like we are connecting more than once. Pulling NVTs from greenbone

<28>Jul 23 20:41:35 greenbone-nvt-sync: The log facility is not working as expected. All messages will be written to the standard error stream. <29>Jul 23 20:41:35 greenbone-nvt-sync: No Greenbone Security Feed access key found, falling back to Greenbone Community Feed <29>Jul 23 20:41:40 greenbone-nvt-sync: Configured NVT rsync feed: rsync://feed.community.greenbone.net:/nvt-feed`
immauss commented 3 years ago

OK. The new "armv7" tag is available and seems to be operational. It seems to work on hardware, but it took me a while to realize that postgres just does not like to be run with qemu on the armv7.
I'm closing all of the current armv7 issues since since this is basically a complete rebuild. If you have new (or the same ) problems, please open a new issue.

Thanks, Scott