DEV Community

Carrie
Carrie

Posted on

2 1 1 1 1

How to Configure and Get Source IP in SafeLine WAF

Step1 Add the site first
Please refer to the official documentation for quick configuration of SafeLine.

Step2 Send a test attack request to the site: http://IP-or-hostname-or-domain:port/webshell.php

Step3 Open the SafeLine console and navigate to Logs -> Attacks -> Logs in the top left corner. Click Detail of the test request just made:

Image description

Step4 Look at the Request information to find the correct source IP

Image description

For most small websites, 99% of cases will fall into these two scenarios:

Scenario 1: The correct source IP is in the X-Forwarded-For header, usually in the 1st to 3rd position from the right:

Image description
The correct IP is the third one from the right.

Scenario 2: The correct source IP is in another header, and this header contains only the IP:

Image description

Step5 Click Web Services -> Global Settings -> Get Attack IP From, and select the corresponding option based on the location of the source IP

Image description

Step6 Repeat steps 2 and 3, and ensure the source IP in the logs is obtained correctly Done!

Notes:

  • If there are no logs in step 3, it means the site is not set up properly. Please go back to step 1.
  • If there is no source IP in the logs in step 4, it means the previous device did not pass the source IP to SafeLine, and you need to configure the previous device.

If you want to understand the underlying principles, you can refer to this: How to Configure SafeLine WAF to Correctly Obtain the Source IP.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay