Git Product home page Git Product logo

Comments (20)

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Hi @weizhuangzhi, if you look at the Modsecurity logs you'll see that it doesn't like that you put an ip address as a SERVER_NAME. it is linked to this rule specifically ->

# Check that the host header is not an IP address
# This is not an HTTP RFC violation but it is indicative of automated client access.
# Many web-based worms propagate by scanning IP address blocks.
#
# -=[ Rule Logic ]=-
# This rule triggers if the Host header contains all digits (and possible port)
#
# -=[ References ]=-
# https://technet.microsoft.com/en-us/magazine/2005.01.hackerbasher.aspx
#
SecRule REQUEST_HEADERS:Host "@rx ^[\d.:]+$" \
"id:920350,\
phase:2,\
block,\
t:none,\
msg:'Host header is a numeric IP address',\
logdata:'%{MATCHED_VAR}',\
tag:'application-multi',\
tag:'language-multi',\
tag:'platform-multi',\
tag:'attack-protocol',\
tag:'paranoia-level/1',\
tag:'OWASP_CRS',\
tag:'capec/1000/210/272',\
tag:'PCI/6.5.10',\
ver:'OWASP_CRS/3.3.4',\
severity:'WARNING',\
setvar:'tx.anomaly_score_pl1=+%{tx.warning_anomaly_score}'"
.

This is not a much of bug but more a misconfiguration. If you want to allow IP addresses as server names you should add an override to ignore this rule -> id:920350

SecRuleRemoveById 920350

PS: Here's the documentation part for custom configs (the type you're looking for is modsec-crs) -> https://docs.bunkerweb.io/testing/quickstart-guide/#custom-configurations

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

@TheophileDiot thank you for your reply!

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Anytime !

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

I changed IP access to domain name access, but files still cannot be added to SERVICE MANAGER. The page returns a 500 error, and no information is recorded in /var/log/bunkerweb/error.log.
Are there any other reasons for this problem?

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Interesting. Do you have logs with the UI maybe ? Else I'll check what could be the issue and let you know.

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

@weizhuangzhi are you using Fedora Sever 38 like in the other issues as well ?

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

Yes, they were all tested in the same environment
I don't know much about python. Is there a way to display the detailed error message of 500? I can continue to test it, or do I need to provide other information?

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Don't worry @weizhuangzhi, I'll test it myself and let you know
If you want more logs with the UI you'll need to use the dev environment instead of the prod one by editing this line in the file /usr/share/bunkerweb/scripts/bunkerweb-ui.sh -->

python3 -m gunicorn --config /usr/share/bunkerweb/ui/gunicorn.conf.py --user nginx --group nginx --bind 127.0.0.1:7000 &

And replacing it with this one --> python3 -m flask --app main:app run --host=127.0.0.1 --port=7000 &
MPORTANT: ⚠️ Do not use it in production as it will return the errors to the clients ⚠️

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

OK,thanks
I just removed 500 in /etc/bunkerweb/variables.env config
bunker6.tt_INTERCEPTED_ERROR_CODES=400 404 405 413 429 501 502 503 504

I got a "Redirecting..." page
Redirecting...
You should be redirected automatically to the target URL: /manage/loading?next=/manage/configs. If not, click the link.

I cleared all five files in the /var/log/bunkerweb directory. After adding the files, there are only two access logs in the access.log and ui-access.log files, and there are no records in other files.

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

@weizhuangzhi, does the command journalctl -u bunkerweb-ui --no-pager gives you anything ?

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024
9月 08 14:21:27 fedora38 bunkerweb-ui.sh[4052]: [2023-09-08 14:21:27] - main - ℹ️  - Database connection established
9月 08 14:21:27 fedora38 bunkerweb-ui.sh[4052]: [2023-09-08 14:21:27] - main - ℹ️  - Database is ready
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Save config started ...
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Settings : /usr/share/bunkerweb/settings.json
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Core : /usr/share/bunkerweb/core
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Plugins : /etc/bunkerweb/plugins
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Init : False
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Checking arguments ...
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Variables : /tmp/1b230bfd-14bf-4ceb-aa18-503725121faa.env
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Computing config ...
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Database connection established
9月 08 14:28:20 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:20] - GENERATOR - ℹ️  - Database is already initialized, skipping ...
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Config successfully saved to database
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4219]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Config saver successfully executed !
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Save config started ...
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Settings : /usr/share/bunkerweb/settings.json
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Core : /usr/share/bunkerweb/core
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Plugins : /etc/bunkerweb/plugins
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Init : False
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Checking arguments ...
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Variables : /tmp/e4e1d96a-36c4-462f-b87a-1785073f453b.env
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Computing config ...
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Database connection established
9月 08 14:28:21 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:21] - GENERATOR - ℹ️  - Database is already initialized, skipping ...
9月 08 14:28:22 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:22] - GENERATOR - ℹ️  - Config successfully saved to database
9月 08 14:28:22 fedora38 bunkerweb-ui.sh[4252]: [2023-09-08 14:28:22] - GENERATOR - ℹ️  - Config saver successfully executed !

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Interesting, and you managed to reproduce your error ?

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

Tried it again, still the same error.
There are no new entries in the journalctl log.

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Weird, I'm currently building a .deb file to test it myself, thank you for the help 😁

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

I'm missing something:
When the 500 page appears, return to the previous page on the browser and you will see a message in the Messages of the Web UI:

Error
/etc/bunkerweb/configs/http/ doesn't exist

This directory does not exist. The /etc/bunkerweb/configs directory is empty after default installation. I hope this will help you.

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Thank you 🙏

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

I think it's a mix between permissions issues and missing folders, try creating the folders manually and executing the commands :

sudo chown -R nginx:nginx /etc/bunkerweb/
sudo chmod -R 770 /etc/bunkerweb/```

from bunkerweb.

TheophileDiot avatar TheophileDiot commented on May 30, 2024

Just tested it and that did the trick, it'll be automatically fixed in the next version, thanks again for this issue.

from bunkerweb.

weizhuangzhi avatar weizhuangzhi commented on May 30, 2024

There has been some progress on this issue.
sudo chown -R nginx:nginx /etc/bunkerweb/
sudo chmod -R 770 /etc/bunkerweb/
Still the same error after performing the operation
I manually created the /etc/bunkerweb/configs/http/bunker6.tt/ folder and granted permissions again, and finally I can write files!

from bunkerweb.

fl0ppy-d1sk avatar fl0ppy-d1sk commented on May 30, 2024

Hey @weizhuangzhi,

It should be fixed in the last 1.5.2 version. Feel free to open a new issue if needed.

from bunkerweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.