Skip to content

Commit 41c1203

Browse files
committed
Update secure-platform.md
1 parent 01fb6d1 commit 41c1203

File tree

1 file changed

+101
-3
lines changed

1 file changed

+101
-3
lines changed

versioned_docs/version-24.04/administration/secure-platform.md

Lines changed: 101 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ Now that you have your self-signed certificate, you can perform the following pr
659659
<TabItem value="Alma / RHEL / Oracle Linux 8" label="Alma / RHEL / Oracle Linux 8">
660660

661661
```shell
662-
dnf install mod_ssl mod_security openssl
662+
dnf install mod_ssl openssl
663663
```
664664

665665
2. Install your certificates:
@@ -676,7 +676,7 @@ cp ca_demo.crt /etc/pki/tls/certs/
676676
<TabItem value="Alma / RHEL / Oracle Linux 9" label="Alma / RHEL / Oracle Linux 9">
677677

678678
```shell
679-
dnf install mod_ssl mod_security openssl
679+
dnf install mod_ssl openssl
680680
```
681681

682682
2. Install your certificates:
@@ -695,7 +695,6 @@ cp ca_demo.crt /etc/pki/tls/certs/
695695
```shell
696696
curl -sSL https://packages.sury.org/apache2/README.txt | sudo bash -x
697697
apt update
698-
apt install libapache2-mod-security2
699698
a2enmod ssl
700699
a2enmod security2
701700
systemctl restart apache2
@@ -1552,6 +1551,105 @@ systemctl restart apache2
15521551
</TabItem>
15531552
</Tabs>
15541553
1554+
## Activate mod_security
1555+
1556+
**mod_security** is a security module for Apache that acts as a web application firewall (WAF).
1557+
1558+
1. Install **mod_security** :
1559+
1560+
<Tabs groupId="sync">
1561+
<TabItem value="Alma / RHEL / Oracle Linux 8" label="Alma / RHEL / Oracle Linux 8">
1562+
1563+
```shell
1564+
dnf install mod_security
1565+
```
1566+
1567+
</TabItem>
1568+
<TabItem value="Alma / RHEL / Oracle Linux 9" label="Alma / RHEL / Oracle Linux 9">
1569+
1570+
```shell
1571+
dnf install mod_security
1572+
```
1573+
1574+
</TabItem>
1575+
<TabItem value="Debian 12" label="Debian 12">
1576+
1577+
```shell
1578+
apt install libapache2-mod-security2
1579+
```
1580+
1581+
</TabItem>
1582+
</Tabs>
1583+
1584+
2. Edit the following file and adjust the settings as you want:
1585+
1586+
<Tabs groupId="sync">
1587+
<TabItem value="Alma / RHEL / Oracle Linux 8" label="Alma / RHEL / Oracle Linux 8">
1588+
1589+
```shell
1590+
/etc/httpd/conf.d/mod_security.conf
1591+
```
1592+
1593+
</TabItem>
1594+
<TabItem value="Alma / RHEL / Oracle Linux 9" label="Alma / RHEL / Oracle Linux 9">
1595+
1596+
```shell
1597+
/etc/httpd/conf.d/mod_security.conf
1598+
```
1599+
1600+
</TabItem>
1601+
<TabItem value="Debian 12" label="Debian 12">
1602+
1603+
```shell
1604+
/etc/modsecurity/mod_security.conf
1605+
```
1606+
1607+
</TabItem>
1608+
</Tabs>
1609+
1610+
We recommend the following configuration:
1611+
1612+
```text
1613+
SecResponseBodyAccess Off
1614+
SecDebugLog /var/log/httpd/modsec_debug.log
1615+
SecDebugLogLevel 0
1616+
SecAuditEngine RelevantOnly
1617+
SecAuditLogRelevantStatus "^(?:5|4(?!01|4))"
1618+
SecAuditLogParts ABJDEFHZ
1619+
SecAuditLogType Serial
1620+
SecAuditLog /var/log/httpd/modsec_audit.log
1621+
SecArgumentSeparator &
1622+
SecCookieFormat 0
1623+
SecTmpDir /var/lib/mod_security
1624+
SecDataDir /var/lib/mod_security
1625+
```
1626+
1627+
3. Restart Apache :
1628+
1629+
<Tabs groupId="sync">
1630+
<TabItem value="Alma / RHEL / Oracle Linux 8" label="Alma / RHEL / Oracle Linux 8">
1631+
1632+
```shell
1633+
systemctl restart httpd
1634+
```
1635+
1636+
</TabItem>
1637+
<TabItem value="Alma / RHEL / Oracle Linux 9" label="Alma / RHEL / Oracle Linux 9">
1638+
1639+
```shell
1640+
systemctl restart httpd
1641+
```
1642+
1643+
</TabItem>
1644+
<TabItem value="Debian 12" label="Debian 12">
1645+
1646+
```shell
1647+
systemctl restart apache2
1648+
```
1649+
1650+
</TabItem>
1651+
</Tabs>
1652+
15551653
## Add your certificate to your browser
15561654
15571655
If you use a certificate that is not provided by a trusted authority, you must import the CA certificate into your browser.

0 commit comments

Comments
 (0)