I’m a bit new to GMP but have a heavy background in dev and integrations with APIs. However, I’m stumped on this one.
According to https://github.com/greenbone/gvm-tools, you can
Return all tasks visible to the GMP user with the provided credentials
gvm-cli --gmp-username foo --gmp-password bar socket --xml "<get_tasks/>"
obviously with foo and bar being replaced with their respective values. However, when I perform this exact same command with the “admin” user and the randomly generated password provided during the gvm-setup installation guide, it gives me an “Authentication Failed” error.
I can at least get a 200 OK without using –gmp-username and –gmp-password, but never with those arguments.
┌──(root💀ubuntu)-[~] └─# gvm-cli socket --xml="<authenticate> <credentials><username>admin</username><password>[my-creds]</password> </credentials></authenticate>" <authenticate_response status="200" status_text="OK"><role>Admin</role><timezone>UTC</timezone></authenticate_response>
I’m not quite sure why this is the case because the installation/configuration seems pretty straight forward and requires absolutely no input other than simply running the gvm-setup command and observing the output. I can login to the web interface using the exact same credentials. I’ve read the docs (https://gvm-tools.readthedocs.io/en/latest/) already but unfortunately they don’t actually provide a practical way of using gvm-cli. For example, the docs say you can run this:
gvm-cli socket --xml "<get_tasks/>"
and get a 200 OK, but that doesn’t appear to be the case – there are no creds provided in that example, and neither is an example provided of the default ~/.config/gvm-tools.conf file to understand why this command actually works.
I’m using GVM-21.4.0. and have confirmed that my setup installation is OK based on gvm-check-setup
I feel like this is a pretty basic, GMP 101 situation that I can’t figure out. What am I doing wrong here?