This document summarizes the primary security controls implemented in the GigHive stack and how to configure them per environment.
LocationMatch
for protected areas./db
, /src
, /vendor
, /audio
, /video
, and /app/
(excluding /app/cache
).ansible/roles/docker/templates/default-ssl.conf.j2
under the LocationMatch
block.{{ gighive_htpasswd_path }}
(defaults to /etc/apache2/gighive.htpasswd
).default-ssl.conf.j2
(TLS params); default-ssl.conf.j2
HSTS header; additional cache headers in apache2.conf.j2
.apache2.conf.j2
(includes modsecurity), templates/security2.conf.j2
, and templates/crs-setup.conf.j2
..htaccess
is disabled (centralized config, faster and safer).composer.json
, composer.lock
, config.php
, dotfiles) are denied.default-ssl.conf.j2
<Directory "/var/www/html"> AllowOverride None, Options -Indexes
, <FilesMatch>
deny blocks.UPLOAD_MAX_BYTES
.fileinfo
(finfo
), checksum SHA-256, and sanitized filenames with per-type storage under /audio
or /video
.ansible/roles/docker/files/apache/webroot/src/Validation/UploadValidator.php
, ansible/roles/docker/files/apache/webroot/src/Services/UploadService.php
.Auth is enforced by Apache for the following URI prefixes:
/db
/src
/vendor
/audio
/video
/app/
(excluding /app/cache
)To protect an additional path (e.g., /upload
), add a block to default-ssl.conf.j2
:
<LocationMatch "^/upload(?:/|$)">
AuthType Basic
AuthName "GigHive Protected"
AuthBasicProvider file
AuthUserFile {{ gighive_htpasswd_path }}
Require valid-user
</LocationMatch>
.env
variables are rendered from ansible/roles/docker/templates/.env.j2
and populated via group vars in ansible/inventories/group_vars/gighive.yml
.UPLOAD_MAX_BYTES
: Application max upload size (bytes).FILENAME_SEQ_PAD
: Filename sequence padding (default 5).Example in group_vars/gighive.yml
:
filename_seq_pad: 5
upload_max_bytes: 1500000000
.env.j2
wires them through to the container environment.
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"
for *.php
.SetEnvIfNoCase Authorization
in default-ssl.conf.j2
.security2.conf.j2
/ CRS setup.composer.lock
to ensure reproducible builds.composer install --no-dev --optimize-autoloader --classmap-authoritative
inside the image.group_vars
(production only):
gighive_hsts_enabled: true
gighive.htpasswd
):
/etc/apache2/gighive.htpasswd
.upload_max_bytes
(app), and align PHP/nginx/Apache body limits if changed./db
).ansible/roles/docker/templates/apache2.conf.j2
ansible/roles/docker/templates/default-ssl.conf.j2
ansible/roles/docker/templates/security2.conf.j2
ansible/roles/docker/templates/crs-setup.conf.j2
ansible/roles/docker/files/apache/webroot/src/Validation/UploadValidator.php
ansible/roles/docker/files/apache/webroot/src/Services/UploadService.php
ansible/roles/docker/templates/.env.j2
ansible/inventories/group_vars/gighive.yml
Please report suspected vulnerabilities privately to the repository owner/maintainers. Provide:
We will acknowledge receipt and work on a fix with an appropriate disclosure timeline.