To securely connect to the Linux server, you will need to set up SSH keys.
If you don't have SSH keys already, you can generate them using the following command in your server terminal:
β οΈ When copying keys, make sure you copy without spaces.
Set SSH key to your Server
After generating the SSH keys, you need to copy the public SSH key to the Linux server. Use this command to copy the public key:
Replace <username> with your Linux server account username, and <server-ip-address> with the IP address of the Linux server. You will be prompted to enter your password for authentication.
Open the file on your local machine where the private SSH key is stored. The private key is typically saved with a .pem or .ssh file extension.
Select and copy the contents of the private key file. Ensure you copy the key with the correct permissions and line breaks intact.
Please note that the AppSec Portal is currently incompatible with Amazon Aurora database.
Step 1: Fork the AppSec Portal repository.
This will create a copy of the repository under your account, which you can then modify and configure as needed
Step 2: Set the public SSH key on the host where the portal will be deployed.
Add an SSH key to your GitLab account
This key will be used to establish a secure connection between the host and the repository
mandatory environment variables that must be specified
(In the CI/CD settings, you need to set the following environment variables for these keys):
SEC_PORTAL_HOST: Specify the host where the portal will be deployed SSH_KEY_PRIVATE: Set the private SSH key within the forked repository.
This key will be used for authentication during the installation process
optional environment variables.
You can choose to accept the default values provided for demonstration purposes or specified it if necessary:
The IMAGE_VERSION The script will autonomously determine the most recent version
For optimal performance (tested on 1 million findings), it is recommended to specify the following environment values: GUNICORN_WORKERS = 4 and GUNICORN_THREADS= 4
To configure the import worker and import threads, the following is necessary:
IMPORTER_GUNICORN_WORKERS determines the number of workers for processing import tasks. It is recommended to set a value that takes into account the volume and intensity of import tasks.
IMPORTER_GUNICORN_THREADS defines the number of threads within each import worker. This affects the parallel processing of tasks within the worker.
DB_NAME, DB_USER, DB_PASS, DB_HOST, DB_PORT variables are required for database configuration
If the message broker is hosted on a third-party server, only the AMQP_HOST_STRING must be specified. However, if the container is raised locally, all three variables, including RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS need to be specified.
The username and password in the RABBITMQ_DEFAULT_PASS and RABBITMQ_DEFAULT_USER variables must be the same as in AMQP_HOST_STRING.
The COOKIES_SECURE variable determines the cookie security flag. It should be set to True if HTTPS is used.
Step 4: Run pipeline
Step 5: Click on install section
The GitLab CI script provided in the forked repository will handle the installation process
This script will raise the portal and generate a user with administrator privileges using the default login and password credentials"admin/admin"
Please note that after the initial installation, it is necessary to reset the password for the administrator user via the Django admin panel: follow the <your-domain>.com/admin URL and sign in using the superuser credentials, then select "Users" in the left panel. You can add users from there
Clone the AppSec Portal repository to your server:
Step 2: Navigate to the root directory
Navigate to the root directory of the AppSec Portal project by executing the following command:
Step 3: Set environment variables
In the root directory of the AppSec Portal project, execute the following command:
The script prompts you for values for the following environment variables, including optional ones. You can also accept the default values for optional variables by pressing Enter:
The IMAGE_VERSION the required variable must be specified. Specify a specific version, e.g. release_v24.08.4
The DOMAINthe required variable must be specified. Specify the domain where the AppSec Portal will be accessible
DB_NAME, DB_USER, DB_PASS, DB_HOST, DB_PORT optional variable. Specify the variables needed to configure the database, or use the defaults.
If the message broker is hosted on a third-party server, only the AMQP_HOST_STRING must be specified. However, if the container is raised locally, all three variables, including RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS need to be specified
The username and password in the RABBITMQ_DEFAULT_PASS and RABBITMQ_DEFAULT_USER variables must be the same as in AMQP_HOST_STRING.
The COOKIES_SECURE variable determines the cookie security flag. It should be set to True if HTTPS is used
The set_vars.sh script creates the .env file with the configured environment variables and generates a pair of JWT keys, which are used to sign JWT keys and SECRET_KEY is used to generate hashes in Django.
DO NOT run the ./set_vars.sh command twice.
If you need to change the value of a variable, do so in the .env file.
Step 4: Start the AppSec Portal
To start the AppSec Portal, run the following command:
Step 5: Create a superuser account
To create an administrator account, execute the following command:
This username and password will allow you to log in to the installed AppSec Portal
or
Create users using Django admin panel
In order to access admin settings, follow the <your-domain>.com/admin URL and sign in using the superuser credentials, then select Users in the left panel. You can add users from there. Don't forget to assign the necessary permissions to the users.