multicloud365
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud
No Result
View All Result
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud
No Result
View All Result
multicloud365
No Result
View All Result

Arrange CrowdSec to guard your WordPress web site

admin by admin
June 19, 2025
in Cloud Networking
0
Arrange CrowdSec to guard your WordPress web site
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


Let’s discover out how one can shield your Docker WordPress web site utilizing CrowdSec. Now you can shield your WordPress web site like a professional in a couple of easy steps! This information assumes that you’re working a WordPress Docker container that exists behind a reverse proxy. It’s good to skip one step if you’re not utilizing a reverse proxy.

About CrowdSec

CrowdSec Brand

CrowdSec is an open-source, collaborative IP safety answer that analyses behaviors and shares alerts throughout the neighborhood. It’s like Fail2Ban, however you’ll be able to share your ban with different customers. Sharing bans helps you preemptively block malicious hosts earlier than they trigger any harm.

About Reverse Proxy

A reverse proxy is a server that sits in entrance of a number of internet servers, intercepting consumer requests. The reverse proxy then forwards the request from the entrance to the again and specifies the unique IP within the X-Forwarded-For (or XFF) header. The XFF request header is a de-facto customary header for figuring out the originating IP deal with of a consumer connecting to an internet server by means of a proxy server. Fortunately, CrowdSec has a built-in characteristic that means that you can use a reverse proxy and test the XFF headers with out challenge.

What You Will Want

This information assumes that you’ve got some working information of reverse proxy and Docker. Thus, you need to have already got a working Docker setup, reverse proxy, and working WordPress web site.

Let’s get began!

Setup the CrowdSec Agent in your Docker WordPress

First, we have to arrange the native API and Agent. Each co-exist within the official container:

model: "2.1"
providers:
  crowdsec:
    picture: docker.io/crowdsecurity/crowdsec:newest
    container_name: crowdsec
    ports:
      - 49155:8080
    setting:
      - GID=1000
      - COLLECTIONS=crowdsecurity/wordpress crowdsecurity/http-cve crowdsecurity/whitelist-good-actors  
    volumes:
      - /mnt/containers/crowdsec/config:/and so forth/crowdsec:rw
      - /mnt/containers/crowdsec/knowledge:/var/lib/crowdsec/knowledge:rw
      - /var/log:/var/log/host:ro      
    restart: unless-stopped

So, what have we simply finished?

  • First, you created a container known as “crowdsec”.
  • Subsequent, you uncovered port “49155” to this container. Change this if this port isn’t obtainable to you.
  • And at last, you persevered the CrowdSec storage to “/mnt/containers/crowdsec/”.

Notice, nonetheless, that CrowdSec will learn the logs of the WordPress Docker container from “/var/log”. Due to this fact, it’s good to regulate your WordPress Docker container to log this folder into the Syslog.

Right here is an instance of set the logging driver to attain this:

providers:
  weblog:
    container_name: "my-blog"
    picture: "wordpress:newest"
    ports:
      - 49154:80
    restart: "at all times"
    volumes:
      - /mnt/containers/my-blog:/var/www/html
    logging:
      driver: "syslog"

Subsequent, to make life simpler working with CrowdSec CLI contained in the container, we’re going to create an alias in our shell profile:

alias cscli="docker exec -t crowdsec cscli"

Lastly, you need to get the IP deal with of the container as a result of we’ll use it later:

docker examine -f '{{vary.NetworkSettings.Networks}}{{.IPAddress}}{{finish}}' crowdsec

Set up the CrowdSec WordPress Plugin

Now that you’ve got the CrowdSec agent and API Docker container working, it’s good to set up the CrowdSec WordPress Bouncer.

You’ll be able to set up it similar to every other WordPress plugin:

  • Discover the CrowdSec plugin within the WordPress market
  • Then set up and activate the plugin.
Instance of the CrowdSec plugin in WordPress {the marketplace}.

Configure the CrowdSec WordPress Plugin

Now you’ll be able to navigate to the CrowdSec plugin in WordPress and configure your CrowdSec Bouncer.

To do that, you have to to know the IP deal with of the CrowdSec container. See the earlier instructions to see how to do that. Subsequent, you have to an API key to permit the Bouncer to hook up with the Agent.

You will get an API key by working the next command:

cscli bouncers add my-wp-bouncer

For instance, this command will output one thing like this:

Api key for 'my-wp-bouncer':

   fccdbc6012314a4edd58da033cc46dbf1

Please hold this key because you won't be able to retrieve it!

Subsequent, add the API URL utilizing the recognized IP deal with and the API key to the WordPress Bouncer plugin:

Set CrowdSec native API URL

Subsequent, we have to configure our reverse proxy. You have to to know the IP deal with of your reverse proxy for this step. Click on on the CrowdSec Superior Settings possibility and enter your trusted IPs within the “Belief these CDN IPs (or Load Balancer, HTTP Proxy)” setting.

Set trusted proxy for CrowdSec

Check your CrowdSec WordPress Blocker

Now you can take a look at if all the pieces is working as anticipated. First, use one other gadget reminiscent of your telephone, and be sure to hook up with the web with a distinct IP deal with. Then attempt to hook up with your WordPress web site. Once more, all the pieces ought to work as anticipated.

Subsequent, get the IP deal with of your completely different gadget with one other IP and run the next command:

cscli choices add -i 49.179.65.10

It is best to see a consequence like this:

INFO[07-05-2022 08:19:01 AM] Choice efficiently added   

Visiting the identical web site ought to provoke a show of a message like this:

Instance CrowdSec WordPress ban.

This message signifies that your WordPress Docker container is utilizing CrowdSec accurately. Properly finished!

You’ll be able to undo the IP ban utilizing the next command:

cscli choices delete -i 49.179.65.10

Helpful CrowdSec instructions

Checklist Bouncers

To see an inventory of all of the related bouncers:

Instance output:

Checklist Alerts

To see an inventory of all of the alerts:

Instance output:

Examine An Alert

To examine a selected alert:

Instance output:

Wrapping Up

You’ve realized arrange CrowdSec to guard your WordPress web site behind a reverse proxy on Docker. CrowdSec makes it simple to assist hold your WordPress web site safe.

You Could Additionally Be In

Sources:

Tags: CrowdSecProtectSetsiteWordPress
Previous Post

The Newest Stats & Developments 2025

Next Post

Gemini 2.5: Updates to our household of pondering fashions

Next Post
Gemini 2.5: Updates to our household of pondering fashions

Gemini 2.5: Updates to our household of pondering fashions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending

The Komprise Information Expertise | Unlock Unstructured Information Potential

The Komprise Information Expertise | Unlock Unstructured Information Potential

May 27, 2025
AWS re:Invent 2024 – Day 1 Recap | Weblog

AWS re:Invent 2024 – Day 1 Recap | Weblog

January 30, 2025
High 7 Extremely-Excessive Molecular Weight Polyethylene Producers

High 7 Extremely-Excessive Molecular Weight Polyethylene Producers

May 9, 2025
Chemical Sensors Market Set to Attain USD 40.1 Billion by 2031, Registering 6.8% CAGR – TMR Evaluation

Chemical Sensors Market Set to Attain USD 40.1 Billion by 2031, Registering 6.8% CAGR – TMR Evaluation

June 4, 2025
15 Greatest HR Software program for HR managers & HR groups [2025]

15 Greatest HR Software program for HR managers & HR groups [2025]

January 23, 2025
Elevate advertising intelligence with Amazon Bedrock and LLMs for content material creation, sentiment evaluation, and marketing campaign efficiency analysis

Elevate advertising intelligence with Amazon Bedrock and LLMs for content material creation, sentiment evaluation, and marketing campaign efficiency analysis

May 10, 2025

MultiCloud365

Welcome to MultiCloud365 — your go-to resource for all things cloud! Our mission is to empower IT professionals, developers, and businesses with the knowledge and tools to navigate the ever-evolving landscape of cloud technology.

Category

  • AI and Machine Learning in the Cloud
  • AWS
  • Azure
  • Case Studies and Industry Insights
  • Cloud Architecture
  • Cloud Networking
  • Cloud Platforms
  • Cloud Security
  • Cloud Trends and Innovations
  • Data Management
  • DevOps and Automation
  • GCP
  • IAC
  • OCI

Recent News

The Economics of Zero Belief: Why the ‘Straightforward’ Path Prices Extra

The Economics of Zero Belief: Why the ‘Straightforward’ Path Prices Extra

July 20, 2025
Maximize Financial savings with Automated Cloud Price Optimization

Serverless vs Serverful: Smarter Azure Decisions

July 20, 2025
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact

© 2025- https://multicloud365.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud

© 2025- https://multicloud365.com/ - All Rights Reserved