-
Notifications
You must be signed in to change notification settings - Fork 563
feat: Add a section to enforce stronger ciphers for SSH as -b param #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ OPTIONS (install BigBlueButton): | |
|
|
||
| -d Skip SSL certificates request (use provided certificates from mounted volume) in /local/certs/ | ||
| -w Install UFW firewall (recommended) | ||
| -b Harden SSH access by specifying which ciphers to be used (recommended) | ||
|
|
||
| -j Allows the installation of BigBlueButton to proceed even if not all requirements [for production use] are met. | ||
| Note that not all requirements can be ignored. This is useful in development / testing / ci scenarios. | ||
|
|
@@ -133,7 +134,7 @@ main() { | |
|
|
||
| need_x64 | ||
|
|
||
| while builtin getopts "hs:r:c:v:e:p:m:t:xgadwjik" opt "${@}"; do | ||
| while builtin getopts "hs:r:c:v:e:p:m:t:xgadwjikb" opt "${@}"; do | ||
|
|
||
| case $opt in | ||
| h) | ||
|
|
@@ -227,6 +228,9 @@ main() { | |
| i) | ||
| SKIP_APACHE_INSTALLED_CHECK=true | ||
| ;; | ||
| b) | ||
| HARDEN_SSH=true | ||
| ;; | ||
| :) | ||
| err "Missing option argument for -$OPTARG" | ||
| ;; | ||
|
|
@@ -374,6 +378,10 @@ main() { | |
| setup_ufw | ||
| fi | ||
|
|
||
| if [ "$HARDEN_SSH" = true ]; then | ||
| harden_ssh | ||
| fi | ||
|
|
||
| if [ -n "$HOST" ]; then | ||
| bbb-conf --setip "$HOST" | ||
| else | ||
|
|
@@ -1974,4 +1982,35 @@ HERE | |
| fi | ||
| } | ||
|
|
||
| harden_ssh() { | ||
| say "Hardening SSH configuration..." | ||
|
|
||
| local SSH_HARDENING_FILE="/etc/ssh/sshd_config.d/99-hardened-ciphers.conf" | ||
|
|
||
| # Check if sshd_config includes the .d directory (Ubuntu 22.04 does by default) | ||
| if ! grep -q "^Include.*/etc/ssh/sshd_config.d/" /etc/ssh/sshd_config; then | ||
| say "Warning: /etc/ssh/sshd_config doesn't include sshd_config.d - adding include directive" | ||
| echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/sshd_config | ||
| fi | ||
|
|
||
| cat > "$SSH_HARDENING_FILE" <<HERE | ||
| # SSH Hardening - Applied by bbb-install.sh | ||
| # Modern ciphers, key exchange, and MACs only | ||
|
|
||
| Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr | ||
| KexAlgorithms curve25519-sha256,[email protected],diffie-hellman-group16-sha512,diffie-hellman-group18-sha512 | ||
| MACs [email protected],[email protected],[email protected] | ||
| HERE | ||
|
|
||
| # Validate before applying | ||
| if sshd -t; then | ||
| systemctl restart sshd | ||
| say "SSH hardening applied successfully" | ||
| else | ||
| say "SSH config validation failed - removing hardening file" | ||
| rm -f "$SSH_HARDENING_FILE" | ||
| err "SSH hardening failed - sshd config invalid" | ||
| fi | ||
| } | ||
|
|
||
| main "$@" || exit 1 | ||
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.
Uh oh!
There was an error while loading. Please reload this page.