Secure-Compliance-Solutions-LLC / GVM-Docker

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

Tasks are not being executed as scheduled #72

Closed chris-fh closed 3 years ago

chris-fh commented 4 years ago

Describe the bug Tasks are not being executed as scheduled

To Reproduce

  1. Create Target
  2. Create Schedule
  3. Create Task
  4. In my container the tasks are not being executed as they are scheduled. They are not executed at all, but i can start them manually (by removing the link to the schedule and clicking "play")

Expected behavior Tasks are executed at the time of the linked schedule

Additional context I do not know how to debug this. I cannot locate the log files. Maybe logging is deactivated by default. This is what i can find:

root@c5d55ef7af0a:/var/log# ls -la
total 476
drwxr-xr-x  7 root  root       4096 Aug  7 08:57 .
drwxr-xr-x 22 root  root       4096 Aug 12 12:27 ..
-rw-r--r--  1 root  root      18157 Jun 17 18:39 alternatives.log
drwxr-xr-x  2 root  root       4096 Jun 17 18:41 apt
-rw-r--r--  1 root  root      58592 Jun  6 01:18 bootstrap.log
-rw-rw----  1 root  utmp          0 Jun  6 01:18 btmp
-rw-r--r--  1 root  root     359799 Jun 17 18:41 dpkg.log
-rw-r--r--  1 root  root      32064 Aug  7 08:57 faillog
-rw-r--r--  1 root  root        977 Jun 17 18:39 fontconfig.log
-rw-rw-r--  1 root  utmp     292584 Aug  7 08:57 lastlog
drwxrwxr-t  2 root  postgres   4096 Jun 17 18:39 postgresql
drwxr-s---  2 redis adm        4096 Jun 17 18:39 redis
drwxr-x---  2 root  adm        4096 Apr 30 19:17 samba
-rw-rw-r--  1 root  utmp          0 Jun  6 01:18 wtmp
root@c5d55ef7af0a:/var/log# cat faillog 
root@c5d55ef7af0a:/var/log# cat lastlog

Help in finding out what the problem is will be most appreciated.

disarmm commented 4 years ago

the logs can be viewed using docker logs.

my initial thought is that the timezone is set incorrectly. https://docs.greenbone.net/GSM-Manual/gos-3.1/en/mysettings.html Check the timezone in my settings at the top right, but also make sure you set the correct time zone when you're creating the schedule. I use the schedules for scans on a regular basis and almost never have any issues, unless i forget to change the time zones.

if its not the timezone, then please schedule a task for a specific time and then run docker logs -f --tail=20 see what happens when the scheduled time comes. post the logs here and we can take a look.

chris-fh commented 4 years ago

It can't be a timezone issue because I waited long enough (more than a day) for the task to start, before. If it would be a timezone issue the task would have started, just not at the right time.

The logs say nothing. You can see here:

# docker logs -f --tail=20 openvas

==> /usr/local/var/log/gvm/ospd-openvas.log <==
2020-08-19 15:37:12,497 OSPD - openvas: INFO: (ospd.ospd) 10.0.1.170-10.0.1.179, 10.0.1.210, 10.0.1.211: Host scan finished.
2020-08-19 15:37:13,847 OSPD - openvas: INFO: (ospd.ospd) d6ca40c4-2699-4d7a-a7e1-59114360023d: Scan finished.

==> /usr/local/var/log/gvm/gvmd.log <==
event task:MESSAGE:2020-08-19 15h37.37 UTC:14737: Status of task VoIP infrastructure (195ca811-8012-4a39-aaa2-61fc539dff55) has changed to Done

==> /usr/local/var/log/gvm/gsad.log <==
gsad  gmp:MESSAGE:2020-08-20 11h37.22 utc:398: Authentication success for 'admin' from 10.0.1.63

==> /usr/local/var/log/gvm/gvmd.log <==
event schedule:MESSAGE:2020-08-20 11h39.01 UTC:21122: Schedule test2 (4ec217de-6134-4383-b1b9-1b2650a761f6) has been modified by admin
event schedule:MESSAGE:2020-08-20 11h39.21 UTC:21154: Schedule test3 (4836426c-4144-4579-92d7-fea4dbc5c2d0) has been modified by admin
event task:MESSAGE:2020-08-20 11h39.33 UTC:21237: Task Network infrastructure (178d5384-fef4-49a6-9297-79532bcb9179) has been modified by admin
event task:MESSAGE:2020-08-20 11h39.40 UTC:21310: Task NAS infrastructure (39a41d66-c5e3-4a49-a3ca-7af9e4b11490) has been modified by admin
event task:MESSAGE:2020-08-20 11h39.50 UTC:21379: Task fleetcloud.com (ce02f40b-6cf5-4640-8b05-53db469d7976) has been modified by admin
event task:MESSAGE:2020-08-20 11h39.58 UTC:21453: Task DMZ hosts (860328f6-efbe-4591-9ef9-f9a7f6d1246c) has been modified by admin
event task:MESSAGE:2020-08-20 11h40.04 UTC:21518: Task Discover any hosts (9b8f19a7-b7da-4494-b8e7-8d05198d10d5) has been modified by admin
event task:MESSAGE:2020-08-20 11h40.11 UTC:21587: Task All prod instances (04d4f33a-e70d-4f10-847a-1a85c7a1d645) has been modified by admin

==> /usr/local/var/log/gvm/gsad.log <==
gsad  gmp:MESSAGE:2020-08-20 11h56.51 UTC:398: Authentication success for 'admin' from 10.0.1.63
gsad  gmp:MESSAGE:2020-08-20 12h21.55 UTC:398: Authentication success for 'admin' from 10.0.1.63

I changed the schedules so the tasks would have started 40 and 10 minutes ago (at 13:45 cest and 14:15 cest). Now it is 14:25 cest. Nothing happened. Since I choose weekly it says it will run in a week from now: Bildschirmfoto 2020-08-20 um 14 00 00

The two relevant schedules can be seen here: Bildschirmfoto 2020-08-20 um 14 00 22

This is when the tasks ran last. 6 of them should have run today (20. Aug): Bildschirmfoto 2020-08-20 um 14 22 26

I do not know, where to go from here... how could I determine where the problem is?

karpiozoo commented 4 years ago

Unfortunately I have the same problem :/

ghost commented 4 years ago

We have same situation. Latest image.

disarmm commented 4 years ago

Is there any other details you could provide that might be useful? i haven't been able to reproduce the issue.

We just built a new version and you can pull it using the docker tag :master

the new version is 20.8 but we haven't created a release for it yet as we're still doing some testing.

karpiozoo commented 4 years ago

Mostly I see any action in logs but not scheduled tasks. image image image

chris-fh commented 4 years ago

I tried the new version with tag :master. The problem still persists.

austinsonger commented 3 years ago

Going to close this. Please try new version. If the problem persists, this can be reopened.