BunkerWeb is a security-focused reverse proxy and Web Application
Firewall (WAF) built on top of OpenResty (nginx with Lua support).
It integrates ModSecurity CRS, Lua-based request filtering,
rate limiting, automated TLS handling, an API service,
and a web management interface.
BunkerWeb supports both HTTP and stream-based reverse proxying
and can operate in standalone, containerized, or clustered
deployments.
BunkerWeb has been installed.
BunkerWeb runs on OpenResty. Its settings are stored in the database
and are managed through the web interface on port 7000 or the API on
port 8888.
Enable the services at boot time with:
sysrc bunkerweb_scheduler_enable=YES
sysrc bunkerweb_api_enable=YES
sysrc bunkerweb_ui_enable=YES
sysrc bunkerweb_enable=YES
Start the services in this order:
service bunkerweb_scheduler start
service bunkerweb_api start
service bunkerweb_ui start
service bunkerweb start
The nginx configuration in /usr/local/etc/nginx/ is generated from the
templates in /usr/local/share/bunkerweb/common/confs/ and is rewritten
on every scheduler run, changes made there are lost.
Put your own nginx directives into the matching subdirectory of
/usr/local/etc/bunkerweb/configs/ instead. The scheduler imports them
into the database and includes them in the generated configuration.
www/bunkerweb: Update to 1.6.17
This release fixes several access control issues, among them a URI
rewrite in a custom configuration that skipped the bans, lists, rate
limit, antibot, authentication and ModSecurity checks.
Changelog: https://github.com/bunkerity/bunkerweb/releases/tag/v1.6.17
Sponsored by: Netzkommune GmbH
www/bunkerweb: Update to 1.6.16
The web UI now compresses its responses, which adds py-brotli and
py-flask-compress to the run dependencies.
Replace the LUA_VER substitutions makeplist left in pkg-plist: they
stand for parts of bundled version numbers, not for the Lua version.
Changes: https://github.com/bunkerity/bunkerweb/releases/tag/v1.6.16
Sponsored by: Netzkommune GmbH
www/bunkerweb: Add missing py-maxminddb dependency
The mmdb-country and mmdb-asn jobs validate the downloaded GeoIP
databases with the maxminddb Python module. Without it they abort with
"maxminddb is not installed", the databases are never installed, and
country and ASN stay unknown in the metrics, the web UI and the
country-based access rules.
Sponsored by: Netzkommune GmbH
www/bunkerweb: Fix Let's Encrypt, multisite and the profile page
- Let's Encrypt: BunkerWeb runs certbot from its own Linux layout. Add
security/py-certbot to RUN_DEPENDS, point CERTBOT_BIN, DEPS_PATH and
the plugin path to the installed locations, and install the certbot
hook scripts executable since certbot runs them directly.
- Multisite: the Templator patch forced NGINX_PREFIX to the global
directory for every server. With MULTISITE=yes each server then
included /usr/local/etc/nginx/set-lua.conf, which only exists without
multisite, and nginx -t failed. Only set the prefix when the server
configuration does not provide one.
- Profile page: devel/py-user_agents is still at 1.0.1 and lacks
get_browser(), get_os() and get_device(), so /profile failed with an
AttributeError and two-factor setup was unreachable. Build the same
strings from the attributes 1.0.1 provides.
Sponsored by: Netzkommune GmbH
www/bunkerweb: Make the scheduler and the API work together
The scheduler registered the instance with HTTP_PORT instead of
API_HTTP_PORT, so it never reached it and ran no jobs at all.
Run it as the worker user and share the directories with the API,
which replaces those files on a push. Point the remaining Linux paths
in the API and the config saver at their FreeBSD locations, teach the
reload path about the openresty binary, and let the worker reload
through the rc script, the fallback upstream already uses.
Sponsored by: Netzkommune GmbH
www/bunkerweb: Enable ModSecurity when the module is available
Render the ModSecurity directives only if
ngx_http_modsecurity_module.so is installed, like upstream does for
the stream module. Build www/openresty with the MODSECURITY option to
get it.
Point the remaining paths at their FreeBSD locations, error pages,
assets and rule files were read from /usr/share/bunkerweb.
Sponsored by: Netzkommune GmbH
www/bunkerweb: Update to 1.6.15
Fixes an unauthenticated RCE in the worker API (GHSA-xcv3-gjwr-rwxw),
a WAF filename bypass via RFC 2231 encoding (GHSA-cvfx-2ffg-cqmj) and
three API permission flaws.
1.6.15 imports Configurator in the scheduler and the web UI, so add
common/gen to their PYTHONPATH. Run the Alembic migration before the
scheduler starts, upstream does this in its systemd wrapper, without
it the scheduler dies on the new is_draft column.
Ship a sample api.yml, the API refused to start without that file, and
bind it to localhost by default. Drop the ModSecurity directives from
the reverse proxy and web UI templates too, OpenResty has no such
module.
Changelog: https://github.com/bunkerity/bunkerweb/releases/tag/v1.6.15
Sponsored by: Netzkommune GmbH
www/bunkerweb: Fix antibot plugin and improve pkg-message
The antibot core plugin does require("base64"), but lbase64 is not in
the lua_package_path, so the module cannot be resolved. Add it.
The nginx configuration is generated by the scheduler at runtime, the
port does not install it. Describe that in the message, along with the
directory for own directives, and let the rc script bail out with a
clear message as long as the configuration has not been generated.
Reported by: netchild via private email
Sponsored by: Netzkommune GmbH
security/py-biscuit-auth: Convert build to use PEP 517 and rename to PyPI name
* Rename port to PyPI name according to Python policy
* Move build completely to PEP 517
* Bump consumers: www/bunkerweb/Makefile
* Simplify Python discovery; the build frontend will pass the interpreter
New name: security/py-biscuit-python
Co-authored-by: Jochen Neumeister <joneum@FreeBSD.org>
PR: 297823
Approved by: joneum (maintainer)
Differential Revision: https://reviews.freebsd.org/D59133
www/bunkerweb: Fix rc scripts for non-3.11 Python versions
The rc scripts hardcoded /usr/local/bin/python3.11, which only worked
while the tree default happened to be 3.11. With the default at 3.12
none of the three Python services could start. Substitute the
interpreter through %%PYTHON_VERSION%% instead.
While here, create /var/run/bunkerweb in the scheduler precmd. The
scheduler writes its own pid file below that directory and died with
FileNotFoundError on a fresh boot because nothing created it.
Sponsored by: Netzkommune GmbH
www/bunkerweb: Add missing setuptools run dependency
passlib/pwd.py imports pkg_resources at module level, and that module
lives in setuptools. Nothing in the dependency chain requested it, so
the import only succeeded as long as something else happened to pull
setuptools in. Upstream pins setuptools<81 in the scheduler
requirements for the same reason: pkg_resources is gone in 81.
While here, pin the py-biscuit-auth dependency to ${PY_FLAVOR} now
that the port has flavors.
Sponsored by: Netzkommune GmbH
www/bunkerweb: Update to 1.6.13
This covers the 1.6.12 and 1.6.13 releases.
Security: session fixation on login and an open redirect via the
post-login "next" parameter in the web UI, a second open redirect in
the antibot post-challenge flow, and cache deletion routes that
bypassed authorization. Biscuit token generation now binds the Host
header, client IP and username as typed terms, and adds an optional
API_ALLOWED_HOSTS allowlist. Reverse DNS results are forward-confirmed
before an IGNORE_RDNS or GREYLIST_RDNS suffix match is honored, so a
self-configured PTR record no longer bypasses blocking. ACME challenge
tokens are validated against the base64url character set, closing a
path traversal through the internal API. TOTP verification is enforced
on the exact validation endpoint instead of any path containing /totp.
(Only the first 15 lines of the commit message are shown above )
www/bunkerweb: add new port
BunkerWeb is an open-source next-generation web application firewall
(WAF) and security platform designed to protect and manage web services.
It provides integrated security features such as request filtering,
rate limiting, TLS management, GeoIP support and a web management
interface.
As this is a newly introduced port, users are encouraged to validate
their deployment before using it in production environments.
WWW: https://github.com/bunkerity/bunkerweb
Sponsored by: Netzkommune GmbH