DEV Community

Sharon
Sharon

Posted on

3 4 2 4 2

Part 3: Mastering SafeLine WAF – Testing, Docker Setup & Troubleshooting

Welcome to the final part of our SafeLine WAF series!

So far, you have set up SafeLine and configured it for your environment. Now, it’s time to test your protection, finalize your Docker installation if necessary, and troubleshoot any issues that may arise. This will help you maintain a robust and reliable WAF deployment.

Image description

🔍 Test Protection

You can test the protection effectiveness either manually or automatically.

Confirm Website Accessibility

Access your website using the parameters configured in SafeLine WAF:

  • Open your browser and visit: http://<IP or domain>:<port>/
  • The default protocol is HTTP; check the SSL option to use HTTPS.
  • The hostname can be either the SafeLine IP or your website domain (make sure the domain resolves to SafeLine).
  • The port is the one you configured in SafeLine for the site.

If your website is not accessible, please refer to the Configuration Issues section.
Overall Monitoring Flow Reference:

Image description

Manual Attack Simulation

Try these URLs to simulate attacks and confirm SafeLine blocks them:

  • SQL Injection: http://<IP or domain>:<port>/?id=1%20AND%201=1
  • XSS Attack: http://<IP or domain>:<port>/?html=<script>alert(1)</script>

If SafeLine blocks these, you’ll see the attack prevented in your browser and logged in the dashboard. ✅

Image description


🐳 Docker Installation on CentOS

Update yum packages

sudo yum update
Enter fullscreen mode Exit fullscreen mode

If you get errors like “Could not resolve host” or mirrorlist failures, add Alibaba Cloud repo:

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Enter fullscreen mode Exit fullscreen mode

Setup Docker repository (use Alibaba Cloud repo to avoid errors)

sudo yum install -y yum-utils

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Enter fullscreen mode Exit fullscreen mode

Install Docker engine

sudo yum -y install docker-ce docker-ce-cli containerd.io
Enter fullscreen mode Exit fullscreen mode

Start Docker service

sudo systemctl start docker
Enter fullscreen mode Exit fullscreen mode

⚠️ Troubleshooting

If you get x509 certificate errors when pulling images, it’s likely a system time or certificate issue.

Check your system time:

date
Enter fullscreen mode Exit fullscreen mode

If it’s wrong, sync time with:

sudo yum -y install ntpdate

sudo ntpdate cn.pool.ntp.org
Enter fullscreen mode Exit fullscreen mode

Conclusion 🎉

Congratulations on completing the SafeLine WAF deployment series! You have now:

  • Prepared your environment and installed SafeLine with Docker 🛠️
  • Explored multiple deployment scenarios and enabled advanced protection features 🛡️
  • Tested your WAF’s effectiveness and learned how to troubleshoot common issues 🔍

With these skills, you’re well-equipped to protect your web applications against a wide range of threats. Remember to keep your system and SafeLine updated, monitor your traffic regularly, and fine-tune your rules as needed.

Thank you for following along! If you have any questions or want to share your experience, feel free to join our community or leave a comment. 💬


🤝 Join Our Community

For any technical support, you can post the question directly on our forum: https://safepoint.cloud/discussion (Our technicians will receive a notification and reply shortly).
Or you can also post it in our Discord community: https://discord.gg/dy3JT7dkmY (We’ll check messages there every day)


📢 Notes

This article is originally written by the author and follows CC 4.0 BY-SA license. Please keep the original link and this statement when sharing.

Original link: https://blog.csdn.net/m0_74375496/article/details/140550745

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (4)

Collapse
 
nevodavid profile image
Nevo David

Pretty cool seeing all the steps here, tbh getting Docker to play nice always takes me a minute too

Collapse
 
sharon_42e16b8da44dabde6d profile image
Sharon

I'm so glad to see my article helps you a lot!

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

love seeing real step-by-step stuff like this, way easier for me to follow - makes me wonder, you think the biggest blocker is setup headaches or people just not taking time to test their security?

Collapse
 
carrie_luo1 profile image
Carrie

The setup of SafeLine is super easy and very friendly to beginners. The biggest blockers might be realize the importance of web security and they don't know such an easy security tool

Image of Datadog

Get the real story behind DevSecOps

Explore data from thousands of apps to uncover how container image size, deployment frequency, and runtime context affect real-world security. Discover seven key insights that can help you build and ship more secure software.

Read the Report

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay