Installation and Execution of a Penetration Test with Horizon3
  • 13 Apr 2023
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Installation and Execution of a Penetration Test with Horizon3

  • Dark
    Light
  • PDF

Article summary

Validate Enviorment:

  1. To ensure that a Virtualization License is installed on the system:

    • Go to System :: Licenses.
    • If no Virtualisation license, install a valid license key
      Nodegrid_settings_license
  2. To ensure the Docker Service is started:

    • Go to *Security :: Services *.
    • Select Enable Docker and Save the page.
      Nodegrid_services_docker.png{height="" width="400px}
  3. To validate the system with the official h3 validation tool:

    • Open a console connection to the Nodegrid
    • Login with sudo and shell permissions (admin ).
    • Download and run the check utility
curl https://downloads.horizon3ai.com/utilities/checkenv.sh | bash

Output example

root@nodegrid:~# curl https://downloads.horizon3ai.com/utilities/checkenv.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12300  100 12300    0     0  24117      0 --:--:-- --:--:-- --:--:-- 25678

[#] Conducting pre-checks to validate the environment is NodeZero ready:

[#] Checking Docker functionality by running the hello-world test container:
[+] PASSED: Docker version installed meets the minimum required version 20.10.
[+] PASSED: Docker is installed and functioning properly.

[#] Checking Docker permissions to volume mount files from /home/root directory:
[+] PASSED: Docker permissions are correct for the /home/root directory location.

[#] Checking Operating System:
[+] PASSED: Linux is a supported Operating System.

[#] Gathering environmental variables to conduct further checks:
[+] PASSED: All environmental variables set and proceeding with next checks.

[#] Checking host time against current UTC time:
[+] PASSED: System time is within 5 minutes of UTC time.

[#] Checking HDD space requirements (20GB Recommended, 10GB Required):
[!] WARNING: 18GB is less than the recommended 20GB free space on this disk, please ensure to prune old images before running Node Zero again.

[#] Checking 8GB RAM requirement:
[+] PASSED: This system meets the recommended minimum RAM to support NodeZero.

[#] Checking compute resource requirements:
[+] PASSED: This system has 4 CPUs which meets the minimum logical CPU requirements to run NodeZero.

[#] Pre-check validation completed successfully.

Installation of the h3_cli tool

  1. An API key is required to access the H3 API. To copy the API key, go to User > Settings.(https://portal.horizon3ai.com/account-settings)

    Keep this API key secure. Otherwise, anyone with this API key can access the H3 account.

  2. To install the h3_cli git repo:

    • Open a console connection to the Nodegrid
    • Login with sudo and shell permissions (admin ).
    • install the h3_cli repo
    git clone https://github.com/horizon3ai/h3-cli
    
  3. This creates a new directory, h3-cli. Download the repo's contents to this location.

  4. To run the h3-cli install script

    • Enter the commands to install and configure h3-cli. Replace your-api-key-here with the actual API key.
    cd h3-cli
    bash install.sh your-api-key-here
    

The script installs dependencies (jq) and creates the h3-cli profile in the $HOME/.h3 directory. The API key is stored in the h3-cli profile. Profile permissions are restricted, so other users cannot read it.

  1. To update the users .profile:

    • Execute this command to create a .profile file:
    touch $HOME/.profile
    
    • Open the file with an editor and copy the following content into the file:
    vi $HOME/.profile
    export H3_CLI_HOME=/home/root/h3-cli
    export PATH="$H3_CLI_HOME/bin:$PATH"
    
  2. Save the file.

  3. Activate the new profile or log out and log in to activate the profile.

    . ~/.profile
    

8 To test the installation, run:
h3
If the installation is correct, the h3-cli help text displays.

Getting started

This section is only a brief introduction. For more details [see].(https://docs.horizon3ai.com/reference/api/cli/readme/#6-download-pentest-reports)

  1. To verify connectivity with the API, run the following command, and confirm the response:
    h3 hello-world
       
    {
      "data": {
        "hello": "world!"
      }
    }
    
  2. To run a pentest with the default template:
    h3 run-pentest
    

The JSON response includes details for the newly created pentest. To verify the pentest is provisioning, check the Horizon3.ai Portal or run h3 pentest.

  1. Run NodeZero to start the pentest:

    h3 run-nodezero
    
  2. NodeZero is a Docker container. View with docker ps or the Nodegrid UI under Applications :: Docker. The container name format is: n0-xxxx.
    Nodegrid_Applications_Docker

  3. View pentest reports at Horizon3 portal


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence