bunkerity / bunkerweb

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

[BUG] False Positive with pgrep in start.sh Script #1475

Open xabru opened 1 month ago

xabru commented 1 month ago

What happened?

The start.sh script uses pgrep to find the PID of nginx to determine its status. Unfortunately, pgrep sometimes detects nginx processes running on virtual machines or different operating systems, leading to incorrect assumptions about nginx's status on the target system.

How to reproduce?

# On a system where nginx is correctly running
./usr/share/bunkerweb/scripts/start.sh start
pgrep nginx
# Output: PID(s) of nginx if running on the target system

# On a different OS, running a separate nginx instance
pgrep nginx
# Output: PID(s) of nginx from a different OS, not relevant to our target system

Configuration file(s) (yaml or .env)

No response

Relevant log output

No response

BunkerWeb version

1.5.9

What integration are you using?

Docker

Linux distribution (if applicable)

No response

Removed private data

Code of Conduct

fl0ppy-d1sk commented 1 month ago

Hello @xabru,

Thanks for the issue.

Can you give us some practical examples so we can reproduce the problem and find a fix ?

Best regards,