bunkerity / bunkerweb

🛡️ Open-source and next-generation Web Application Firewall (WAF)
https://www.bunkerweb.io
GNU Affero General Public License v3.0
6.35k stars 359 forks source link

[BUG] code defined in CUSTOM_CONF_SERVER_HTTP disappears after 60 minutes #294

Closed istvano closed 1 year ago

istvano commented 2 years ago

Description The custom provided in a bunkerweb.CUSTOM_CONF_SERVER_HTTP tag disappears after 60 minutes.

How to reproduce

Logs [2022-08-31 11:43:43] GENERATOR - ?? - Generator successfully executed ! [2022-08-31 11:43:43] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/confs [2022-08-31 11:43:50] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/data [2022-08-31 11:43:51] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/reload [2022-08-31 11:43:51] DOCKER-CONTROLLER - ?? - Successfully deployed new configuration

At this point everything is good and working as expected. In 60 minutes

[2022-08-31 12:43:43] SCHEDULER - ?? - Executing job bunkernet-register from plugin bunkernet ... [2022-08-31 12:43:43] BUNKERNET - ?? - BunkerNet is not activated, skipping registration... [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job bunkernet-register from plugin bunkernet [2022-08-31 12:43:43] SCHEDULER - ?? - Executing job realip-download from plugin realip ... [2022-08-31 12:43:43] REALIP - ?? - RealIP is not activated, skipping download... [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job realip-download from plugin realip [2022-08-31 12:43:43] SCHEDULER - ?? - Executing job blacklist-download from plugin blacklist ... [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for IP is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for RDNS is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for ASN is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for USER_AGENT is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for URI is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Downloading blacklist data from https://www.dan.me.uk/torlist/?exit ... [2022-08-31 12:43:43] BLACKLIST - ?? - Downloaded 2184 bad IP [2022-08-31 12:43:43] BLACKLIST - ?? - New file IP.list is different than cache file, reload is needed [2022-08-31 12:43:43] BLACKLIST - ?? - Downloading blacklist data from https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list ... [2022-08-31 12:43:43] BLACKLIST - ?? - Downloaded 637 bad USER_AGENT [2022-08-31 12:43:43] BLACKLIST - ?? - New file USER_AGENT.list is identical to cache file, reload is not needed [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job blacklist-download from plugin blacklist [2022-08-31 12:43:43] SCHEDULER - ?? - Executing job whitelist-download from plugin whitelist ... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for IP is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for RDNS is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for ASN is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for USER_AGENT is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for URI is not cached, processing downloads... [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job whitelist-download from plugin whitelist [2022-08-31 12:43:43] SCHEDULER - ?? - Sending /data folder ... [2022-08-31 12:43:50] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/data [2022-08-31 12:43:50] SCHEDULER - ?? - Successfuly sent /data folder [2022-08-31 12:43:50] SCHEDULER - ?? - Reloading nginx ... [2022-08-31 12:43:51] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/reload [2022-08-31 12:43:51] SCHEDULER - ?? - Successfuly reloaded nginx

At this point the custom config file is no longer generated and present in nginx.

It looks as if Successfully sent API request to http://bunkerweb-mybunker-1:5000/confs is missing at this point but this is just a guess.

fl0ppy-d1sk commented 1 year ago

Hello @istvano,

It should be fixed in the last v1.4.4 release.

istvano commented 1 year ago

Great thanks!

istvano commented 1 year ago

Hi, this is still open. I can still reproduce the issue.

TheophileDiot commented 1 year ago

@istvano could you please give us your config so we can find the reason easier ? Thank you (you can use this link)

istvano commented 1 year ago

This is my setup https://paste.techbag.app/?956e16777d1a5825#A61g8krBwz7KG35K28C5DooNuXx3EiiwzrrySTTM4U2s

As you can see a have two custom location where I need to send the traffic to a different endpoint.

When I run docker-compose up everything works but in 1h the custom file generated by CUSTOM_CONF_SERVER_HTTP_example disappears.

At this point if I restart the service it works again.