Repository navigation
fix: install drop-in ahead of other sshd_config.d files - #1
Merged
Merged
Conversation
sshd keeps the first value it reads for most keywords, and Include expands sshd_config.d/*.conf in lexical order. A 99- drop-in therefore loses to files such as Ubuntu's 50-cloud-init.conf, and apply rolls itself back. Name it 00-dispersal-wolves.conf so it is read first.
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.
Before:
ssh-guard applyinstalledsshd_config.d/99-dispersal-wolves.conf. sshd keeps the first value it reads, andInclude sshd_config.d/*.confexpands in lexical order, so any earlier drop-in won. On Ubuntu cloud images50-cloud-init.confsetsPasswordAuthentication yes, so the post-install audit failed andapplyrolled itself back.After: the default destination is
00-dispersal-wolves.conf, which is read before other drop-ins, so the hardened values take effect.How: renamed the default drop-in path and added a test where a
50-cloud-init.confsetsPasswordAuthentication yesalongside the default drop-in; the parser now reportsno. Hosts that already have the old99-file keep it; it is harmless but can be removed.Tests:
python -m unittest discover -s tests -v(new test fails onmain, passes here).