---
title: Charmhub | Deploy WordPress using Charmhub - The Open Operator Collection
description: Deploy the latest version of WordPress as a Kubernetes Operator on any
  cloud.
url: https://charmhub.io/wordpress-k8s/docs/how-to-enable-waf
---

# WordPress

[Canonical IS DevOps](https://charmhub.io/publisher/canonical-is-devops "View all packages from Canonical IS DevOps")

* [Canonical IS DevOps](https://charmhub.io/publisher/canonical-is-devops "View all packages from Canonical IS DevOps")

Platform:

stable 15

```
juju deploy wordpress-k8s
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Contacts

##### Maintainers

+ [Launchpad Team](https://launchpad.net/~canonical-is-devops)

* [Submit a bug](https://github.com/canonical/wordpress-k8s-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# How to enable WAF

This step will walk you through making your WordPress application secure using Modsecurity 3.0
Web Application Firewall.

### [Prerequisites](https://charmhub.io/wordpress-k8s/docs/how-to-enable-waf#p-23546-prerequisites)

Deploy and relate the [nginx-ingress-integrator](https://charmhub.io/nginx-ingress-integrator) charm.

```
juju deploy nginx-ingress-integrator
juju integrate wordpress-k8s nginx-ingress-integrator
```

### [Enable Modsecurity 3.0 WAF](https://charmhub.io/wordpress-k8s/docs/how-to-enable-waf#p-23546-enable-modsecurity-30-waf)

This feature is only available for
[nginx-ingress-integrator](https://charmhub.io/nginx-ingress-integrator) charm.

The modsecurity WAF is enabled by default.

To check if WAF is enabled, run `kubectl describe wordpress-k8s-ingress -m <juju-model-name>`
where `<juju-model-name>` is the name of the model that your WordPress app is deployed on. For the
model name `wordpress-tutorial`, this command should output something like:

```
Name:             wordpress-k8s-ingress
Labels:           app.juju.is/created-by=nginx-ingress-integrator
Namespace:        wordpress-tutorial
Address:
Ingress Class:    <none>
Default backend:  <default>
Rules:
  Host           Path  Backends
  ----           ----  --------
  wordpress-k8s
                 /   wordpress-k8s-service:80
Annotations:     nginx.ingress.kubernetes.io/enable-modsecurity: true
                 nginx.ingress.kubernetes.io/enable-owasp-modsecurity-crs: true
                 nginx.ingress.kubernetes.io/modsecurity-snippet:
                   SecRuleEngine On
                   SecAction "id:900130,phase:1,nolog,pass,t:none,setvar:tx.crs_exclusions_wordpress=1"

                   Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
                 nginx.ingress.kubernetes.io/proxy-body-size: 20m
                 nginx.ingress.kubernetes.io/rewrite-target: /
                 nginx.ingress.kubernetes.io/ssl-redirect: false
Events:          <none>
```

Note the `nginx.ingress.kubernetes.io/enable-modsecurity: true` annotation.

---
