Background
I have multiple websites. However, the servers were not equipped with adequate security configurations. Only Nginx was used to intercept irregular requests, prevent hotlinking, and restrict IP access, with the restriction rules added after being attacked. Since we are not specialized in security, our understanding of attack behaviors is limited. Without automation, it is imperative to use security tools for protection.
Research
After comprehensively comparing various WAF tools, we found that SafeLine's ecosystem is relatively complete, offering both free and commercial versions, and is continuously maintained and updated (which is crucial). (There are many open-source WAFs that have not been updated in recent years.)
Introduction of SafeLine
Installation
Automatic Deploy
Recommended
Use the following command to start the automated installation of SafeLine. (This process requires root privileges)
bash -c "$(curl -fsSLk https://waf.chaitin.com/release/latest/setup.sh)"
After the command is executed, it means the installation is successfully. Please go to Use Web UI directly.
Mannually Deploy
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
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"
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"
Write Environment variables
cd "/data/safeline"
touch ".env"
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
NOTE: Replace the placeholders in the file
- 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
### Launch SafeLine
Everything is ready to start the SafeLine service.
This process may take several minutes, so don't worry.
docker compose up -d
Use Web UI
Open the web console page https://:9443/ in the browser, then you will see below.
SOCIAL SHARE CARD GENERATOR