How to Manually Install SafeLine WAF
Carrie

Carrie @carrie_luo1

About: Cybersecurity Engineer | Follow Me and Learn Web Application Security Step by Step

Joined:
Sep 10, 2024

How to Manually Install SafeLine WAF

Publish Date: Jun 6
6 1

If you're unable to automatically install SafeLine via the following command:

bash -c "$(curl -fsSLk https://waf.chaitin.com/release/latest/manager.sh)" -- --en
Enter fullscreen mode Exit fullscreen mode

Please refer to this guide.

Manually Deployment for SafeLine WAF

Install Docker

Install the latest version of Docker.

If you already have Docker installed, please skip this step.

curl -sSL "https://get.docker.com/" | bash
Enter fullscreen mode Exit fullscreen mode

Create SafeLine Directory

Create a directory for SafeLine to use, SafeLine will write its configuration and data to this directory. (You need to have at least 5GB of disk space)

mkdir -p "/data/safeline"
Enter fullscreen mode Exit fullscreen mode

Docker Compose Script

Download the latest docker compose script by using the following command.

cd "/data/safeline"
wget "https://waf.chaitin.com/release/latest/compose.yaml"
Enter fullscreen mode Exit fullscreen mode

‼️Important:
If you cannot connect to waf.chaitin.com, please download the docker compose script here:
https://github.com/chaitin/SafeLine/blob/main/compose.yaml

Write Environment variables

cd "/data/safeline"
touch ".env"
Enter fullscreen mode Exit fullscreen mode

Write the following content in the ".env" file

SAFELINE_DIR=/data/safeline
IMAGE_TAG=latest
MGT_PORT=9443
POSTGRES_PASSWORD={postgres-password}
SUBNET_PREFIX=172.22.222
IMAGE_PREFIX=chaitin
ARCH_SUFFIX=
RELEASE=
REGION=-g
Enter fullscreen mode Exit fullscreen mode

If deploying to an ARM server, change ARCH_SUFFIX to -arm

ARCH_SUFFIX=-arm
Enter fullscreen mode Exit fullscreen mode

If you want to install the LTS version

RELEASE=-lts
Enter fullscreen mode Exit fullscreen mode
  • SAFELINE_DIR: 123
  • IMAGE_TAG: SafeLine version to be used
  • MGT_PORT: Web console port to be used
  • POSTGRES_PASSWORD: Postgres db initialization password
  • SUBNET_PREFIX: SafeLine internal network communication address prefix
  • IMAGE_PREFIX: Mirror repository prefix
  • ARCH_SUFFIX: Set to -arm for ARM servers.
  • RELEASE: Set to -lts for use LTS version.

Launch SafeLine

Everything is ready to start the SafeLine service.

This process may take several minutes, so don't worry.

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Use Web UI

Open the web console page https://<safeline-ip>:9443/ in the browser, then you will see below.

Image description

Get Administrator Account

docker exec safeline-mgt resetadmin
Enter fullscreen mode Exit fullscreen mode

After the command is successfully executed, you will see the following content

Please must remember this content
{.is-warning}

[SafeLine] Initial username:admin
[SafeLine] Initial password:**********
[SafeLine] Done
Enter fullscreen mode Exit fullscreen mode

Login

Enter the password in the previous step and you will successfully logged into SafeLine.

Image description

Uninstallation

If you are sure no longer want to use SafeLine, please follow the steps below to completely uninstall it.

  1. Enter SafeLine directory
cd <safeline-directory>
Enter fullscreen mode Exit fullscreen mode
  1. Execute the follow command to stop SafeLine
docker compose down
Enter fullscreen mode Exit fullscreen mode
  1. Execute the follow command to remove SafeLine data
rm -rf <safeline-directory>
Enter fullscreen mode Exit fullscreen mode

Comments 1 total

Add comment