-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from coreruleset/error-low-port
chore: error if port or ssl_port are lower than 1024
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# vim:sw=2:ts=2:sts=2:et | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
ME=$( basename "$0" ) | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
/usr/local/bin/check-low-port | ||
|
||
exit 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
if [ "${PORT}" -lt 1024 ] || [ "${SSL_PORT}" -lt 1024 ]; then | ||
echo<<EOF | ||
ERROR: you are using PORT=${PORT} and SSL_PORT=${SSL_PORT} | ||
Both nginx and httpd containers now run with an unprivileged user. | ||
This means that we cannot bind to ports below 1024, so you might need to correct your PORT and SSL_PORT settings. | ||
Now the defaults for both nginx and httpd are 8080 and 8443. | ||
FIX: | ||
if you have a port mapping like | ||
ports: | ||
- "80:80" | ||
then update it to use a port higher than 1024. Example: | ||
- "80:8080" | ||
The same should be done for the SSL ports. | ||
EOF | ||
exit 1 | ||
fi |