Repository navigation
Document and check ssl file permissions for non-root misp-nginx - #491
Merged
Merged
Conversation
misp-nginx runs as uid/gid 101 with ./ssl mounted read-only, so a key.pem owned by root with mode 600 cannot be read and HTTPS does not work. Refs MISP#488.
04-ssl.sh only checked that cert.pem and key.pem exist (-f). If they exist but are not readable by the nginx user, the SSL config was generated anyway and nginx failed later on. Check readability (-r) and exit with an explicit error message instead. Refs MISP#488.
The hint always suggested fixing ssl/key.pem, even when cert.pem was the unreadable file. Use the name of the file that failed the check. Refs MISP#488.
ostefano
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #488
Since #430,
misp-nginxruns as uid/gid 101 with./sslmounted read-only. Akey.pemowned byrootwith mode600is therefore not readable by nginx and HTTPS does not work.Changes
cert.pemandkey.pemmust be readable by uid/gid 101, withchgrp/chmodandsetfaclexamples (gid 101 may map to an unrelated group on the host, e.g.ssh_keyson RHEL).nginx/files/04-ssl.sh: the script only checked that the certificate files exist (-f). It now also checks that they are readable (-r) and, if not, exits with an explicit error message instead of generating an SSL config that nginx cannot load.Testing
Ran a copy of
04-ssl.sh(with the certs path pointed to a temporary directory) as a non-root user:sh -n: no syntax errorscert.pemnot readable: error message referencingcert.pem, exit code1key.pemnot readable: error message referencingkey.pem, exit code1ssl.confgenerated as before, exit code0The check stops at the first unreadable file, so if both are unreadable only
cert.pemis reported; the second one shows up after fixing the first and restarting.Not tested inside a built
misp-nginximage.