started work on moving variables from .lua to nginx
This commit is contained in:
@@ -3,7 +3,7 @@ version: '3'
|
||||
services:
|
||||
|
||||
mywww:
|
||||
image: debug
|
||||
image: bunkerity/bunkerized-nginx
|
||||
restart: always
|
||||
# mandatory for crowdsec :
|
||||
# you need to redirect Docker logs to the syslog server
|
||||
|
||||
42
examples/hardened/docker-compose.yml
Normal file
42
examples/hardened/docker-compose.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
mywww:
|
||||
image: bunkerity/bunkerized-nginx
|
||||
# dropping all capabilities
|
||||
cap_drop:
|
||||
- ALL
|
||||
# root fs as RO
|
||||
read_only: true
|
||||
# mandatory directories as RW
|
||||
tmpfs:
|
||||
- /tmp:mode=770,uid=0,gid=101
|
||||
restart: always
|
||||
ports:
|
||||
- 80:8080
|
||||
- 443:8443
|
||||
# bunkerized-nginx runs as an unprivileged user with UID/GID 101
|
||||
# don't forget to edit the permissions of the files and folders accordingly
|
||||
volumes:
|
||||
- nginx_conf:/etc/nginx
|
||||
- ./web-files:/www:ro
|
||||
- ./letsencrypt:/etc/letsencrypt
|
||||
environment:
|
||||
- SERVER_NAME=www.website.com # replace with your domain
|
||||
- AUTO_LETS_ENCRYPT=yes
|
||||
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||
- DISABLE_DEFAULT_SERVER=yes
|
||||
- USE_CLIENT_CACHE=yes
|
||||
- USE_GZIP=yes
|
||||
- REMOTE_PHP=myphp
|
||||
- REMOTE_PHP_PATH=/app
|
||||
|
||||
myphp:
|
||||
image: php:fpm
|
||||
restart: always
|
||||
volumes:
|
||||
- ./web-files:/app
|
||||
|
||||
volumes:
|
||||
nginx_conf:
|
||||
5
examples/hardened/web-files/index.php
Normal file
5
examples/hardened/web-files/index.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
echo "Hello World!";
|
||||
|
||||
?>
|
||||
80
examples/syslog/docker-compose.yml
Normal file
80
examples/syslog/docker-compose.yml
Normal file
@@ -0,0 +1,80 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
mywww:
|
||||
image: bunkerity/bunkerized-nginx
|
||||
restart: always
|
||||
logging:
|
||||
driver: syslog
|
||||
options:
|
||||
syslog-address: "udp://10.10.10.254:514"
|
||||
depends_on:
|
||||
- mysyslog
|
||||
- myapp1
|
||||
- myapp2
|
||||
ports:
|
||||
- 80:8080
|
||||
- 443:8443
|
||||
# bunkerized-nginx runs as an unprivileged user with UID/GID 101
|
||||
# don't forget to edit the permissions of the files and folders accordingly
|
||||
volumes:
|
||||
- ./web-files:/www:ro
|
||||
- ./letsencrypt:/etc/letsencrypt
|
||||
environment:
|
||||
- SERVER_NAME=app1.website.com app2.website.com # replace with your domains
|
||||
- MULTISITE=yes
|
||||
- AUTO_LETS_ENCRYPT=yes
|
||||
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||
- DISABLE_DEFAULT_SERVER=yes
|
||||
- USE_CLIENT_CACHE=yes
|
||||
- USE_GZIP=yes
|
||||
- USE_CROWDSEC=yes
|
||||
- CROWDSEC_HOST=http://mycrowdsec:8080
|
||||
- CROWDSEC_KEY= # you need to generate it (see bouncer_key.sh)
|
||||
- app1.website.com_REMOTE_PHP=myapp1
|
||||
- app1.website.com_REMOTE_PHP_PATH=/app
|
||||
- app2.website.com_REMOTE_PHP=myapp2
|
||||
- app2.website.com_REMOTE_PHP_PATH=/app
|
||||
networks:
|
||||
net0:
|
||||
net1:
|
||||
net2:
|
||||
|
||||
mysyslog:
|
||||
image: balabit/syslog-ng
|
||||
restart: always
|
||||
volumes:
|
||||
- ./syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf
|
||||
- ./log:/var/log
|
||||
networks:
|
||||
net0:
|
||||
ipv4_address: 10.10.10.254
|
||||
|
||||
myapp1:
|
||||
image: php:fpm
|
||||
restart: always
|
||||
volumes:
|
||||
- ./web-files/app1.website.com:/app
|
||||
networks:
|
||||
- net1
|
||||
|
||||
myapp2:
|
||||
image: php:fpm
|
||||
restart: always
|
||||
volumes:
|
||||
- ./web-files/app2.website.com:/app
|
||||
networks:
|
||||
- net2
|
||||
|
||||
networks:
|
||||
net0:
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: 10.10.10.0/24
|
||||
net1:
|
||||
net2:
|
||||
|
||||
volumes:
|
||||
nginx_logs:
|
||||
18
examples/syslog/syslog-ng.conf
Normal file
18
examples/syslog/syslog-ng.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
@version: 3.31
|
||||
|
||||
source s_net {
|
||||
udp(
|
||||
ip("0.0.0.0")
|
||||
);
|
||||
};
|
||||
|
||||
template t_imp {
|
||||
template("$MSG\n");
|
||||
template_escape(no);
|
||||
};
|
||||
|
||||
destination d_file {
|
||||
file("/var/log/nginx.log" template(t_imp));
|
||||
};
|
||||
|
||||
log { source(s_net); destination(d_file); };
|
||||
5
examples/syslog/web-files/app1.website.com/index.php
Normal file
5
examples/syslog/web-files/app1.website.com/index.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
echo "hello from app1 !";
|
||||
|
||||
?>
|
||||
5
examples/syslog/web-files/app2.website.com/index.php
Normal file
5
examples/syslog/web-files/app2.website.com/index.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
echo "hello from app2 !";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user