Skip to content

Improve error messages for invalid target configs #4204

@gemesa

Description

@gemesa

Expected behavior

When adding new targets under Configuration --> Target --> New Target we sometimes enter invalid data such as an invalid host. In these cases it would be helpful if more specific errors were raised for the user such as Invalid host or Invalid excluded host instead of a generic Unknown Error (see below).

Actual behavior

When trying to save the target Unknown Error is raised:

image

In this example I only added a host so I could rather quickly identify the issue. But when configuring multiple settings (hosts, excluded hosts, credentials etc.) it can take time to figure out what went wrong exactly. Since an Unknown Error is raised there appears to be some form of input validation in place. It would be helpful if more specific error messages were raised such as Invalid host or Invalid excluded host.

Steps to reproduce

See above.

GVM versions

I am not sure how to check, I am running OpenVAS in Docker and installed it today following this guide.

Environment

Operating system:

$ uname -a            
Linux fedora 6.11.7-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov  8 19:23:10 UTC 2024 x86_64 GNU/Linux
                                                                                                                      
$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="41 (Workstation Edition)"
RELEASE_TYPE=stable
ID=fedora
VERSION_ID=41
VERSION_CODENAME=""
PLATFORM_ID="platform:f41"
PRETTY_NAME="Fedora Linux 41 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:41"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f41/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=41
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=41
SUPPORT_END=2025-12-15
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Installation method / source: https://greenbone.github.io/docs/latest/22.4/container/index.html

Logfiles

gsa-1                  | gsad  gmp-Message: 15:20:08.759: Authentication success for 'admin' from 172.18.0.1
gvmd-1                 | event target:MESSAGE:2024-11-12 15h22.06 utc:2912: Target could not be created by admin
gvmd-1                 | event target:MESSAGE:2024-11-12 15h22.47 utc:2927: Target could not be created by admin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions