Hi, I have a docker installation for my greenbone setup. The thing is that I want to do the scans via my public IP address, while accessing the web interface by the private address. I did the second thing by putting into the ports section the address like this:
Your question is a bit confusing to me since you mention that you want to scan with a separate interface in the title, yet from a separate IP address in the question body. However, typically multiple interfaces share the same IP address. Maybe you can clarify your question with more details.
If I understand you correctly, then this may help: by default, OpenVAS uses the operating system’s default network configuration. It usually selects the default network interface for outgoing network traffic based on the machine’s routing table and the target addresses being scanned. So, the answer to the question I think you are asking would be to configure the default routing on the openvas-scanner container.
Sorry, but I’m not familiar with Docker, and maybe someone else can contribute an answer here, but in the docker-compose.yml file, you can specify the network_mode: "host" for the openvas container. This will allow the container to use the host machine’s networking stack directly, and it will use the network interfaces available on the host, for which you can configure the default routing to specify an interface for the external IP address you want to scan.