-> only “localhost” and SRC IP x.x.x.x/y can access this URL. Rest will be blocked.-> Disadvantage. Container needs to be restartet if the Source Range gets modified!
we can do this better :)
Move to File
you may want to put your “IP Ranges” to a dedicated File and import it where needed.
Let’s assume you have a URL “https://whoami.your.domain.de/removeme" and you wanna get rid of the “removeme” before passing the Request to the Webserver. Stripprefix is your friend …
user@docker:~$ while true; do echo $(date); curl -s https://whoami.your.domain.de |grep "Too" ; sleep 0.1; doneWed Oct 12 18:43:57 CEST 2022Too Many Requests
Wed Oct 12 18:43:58 CEST 2022Too Many Requests
Wed Oct 12 18:43:58 CEST 2022Too Many Requests
Test Limit with hey, 10 Concurrent
100 Requests, 10 Concurrent, Wait 1 Second between Poll
You’re now exposing all your logfiles to the Internet on Port 8888. Apply some FW Rules on the Host, on the Cloud Provider or wherever it fit’s for you ….
If you have Docker running somehwere … bring up your Smoke Instance within Seconds ;)
Smokeping
docker run --name smoke --restart always -d -p 80:80 linuxserver/smokeping
Show Containers
docker ps
docker-test:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8f8b872ac1c3 linuxserver/smokeping "/init" 6 minutes ago Up 6 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp smoke
Shell into Docker
docker exec -it smoke /bin/sh
Check Netstat
root@8f8b872ac1c3:/# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 406670 s
unix 2 [ ACC ] STREAM LISTENING 406078 /run/apache2/fcgidsock/137.0