Max limit per hosts docker

Hello !

I need to scan a /16 network, but I can’t get through.

I’ve installed greenbone with a docker-compose, and I’d like to increase this limit.

I saw on another post that you can use the gvmd --max-ips-per-target command to increase this limit, but I can’t get it to run when gvmd starts.

I’ve tried various techniques such as the command directive or a script that executes this command in a loop at startup, but I can’t get it to work.

If anyone has any ideas on how to increase the limit, I’d be delighted.

If you are asking about the Greenbone Community Containers, please categorize your post into the correct category. In this case the correct category would be Community Containers. ~Thanks.

Yes sorry, i missed the category

Download the latest release of gvmd. Then you need to modify the source code of gvmd and then build it via docker-compose yourself.

In the file manag.h you can enter the specific amount you want to have:

/**
 * @brief Default maximum number of hosts a target may specify.
 */
#define MANAGE_MAX_HOSTS 4095

Modifying IP Limitations in Greenbone

Greenbone imposes a default maximum limit of 4,096 hosts per target, enforced through the preprocessor constant MANAGE_MAX_HOSTS in the src/manage.h file. For the purposes of this assessment, accommodating larger target sets was necessary. To adjust this limit, the value of the constant was modified, and the code was recompiled. This direct alteration in the source code allowed for a tailored configuration that met the specific requirements of the network assessment.

To implement this modification:

  • Obtain the right release of the source code of gvmd:
    The source code of gvmd was downloaded from GitHub
    (The source code can be downloaded here: https://github.com/greenbone/gvmd/releases).

  • Modify the limit:
    The MANAGE_MAX_HOSTS constant in the manage.h file was adjusted to the desired value.

  • File structure:
    As shown in Listing 1 below, the file structure should look like this:

    Listing 1: File structure of the project directory.

    ├── docker-compose.yml
    └── gvmd-24.0.0
        ├── cmake
        ├── CMakeLists.txt
        ├── config
        ├── COPYING
        ├── doc
        ├── INSTALL.md
        ├── README.md
        ├── src
        ├── tools
        └── VERSION.in
    
  • Update Docker Configuration:
    The docker-compose.yml file was updated to use the modified version of gvmd by specifying the build context and Dockerfile, as shown in Listing 2:

    Listing 2: Docker configuration referencing the modified gvmd build context.

    gvmd:
        build:
            context: ./gvmd-24.0.0
            dockerfile: .docker/prod.Dockerfile
    

The gvmd release obtained from GitHub conveniently included the necessary Dockerfile, which streamlined the process of building the modified image.