fix: disable Apache directory indexing on /install and /tftpboot#33
Merged
Merged
Conversation
The default xCAT Apache configuration shipped with Options Indexes enabled for the /install and /tftpboot directories. This allowed unauthenticated users to browse directory listings, disclosing the full tree of postscripts, boot files, and (in production deployments) potentially kickstart files with password hashes, custom scripts with embedded credentials, and cluster topology details. Replace Options Indexes with -Indexes in all four shipped Apache config files (MN and SN, Apache 2.2 and 2.4 variants). Direct file access by known path continues to work, so all provisioning workflows are unaffected. Directory browsing for /xcat-doc is preserved as it contains only public documentation. Additionally, add an Apache hardening guide documenting recommended permissions for sensitive directories under /install, network binding best practices, and IP-based access control options. Addresses xcat2#7450
Member
Author
Provisioning Validation (xCAT 2.18.0, Ubuntu 24.04 MN)Tested on a lab xCAT 2.18.0 management node with Ubuntu 24.04 compute nodes (KVM VMs). Apache behavior with patched configRecursive wget simulation (what xcatdsklspost does)All postscripts downloaded successfully — provisioning path unbroken. ConclusionThe patched Apache config correctly blocks directory browsing on |
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.
Summary
Disable Apache directory indexing (autoindex) on
/installand/tftpbootto prevent unauthenticated information disclosure. Provisioning-critical directories that require recursivewgetaccess retain explicitIndexesexceptions.Problem: The default xCAT Apache config ships with
Options Indexeson/installand/tftpboot, allowing anyone with network access to browse the full directory tree — including postscripts, CA certificates, SSH authorized_keys, and (in production) kickstart files with password hashes.Fix:
Indexesfrom parent/installand/tftpbootdirectory blocksIndexesexceptions for/install/postscriptsand/install/post(required byxcatdsklspostandotherpkgsrecursive wget)Optionsdirectives to prevent inheriting unsafe parent settingsWhat remains indexed (required for provisioning)
/install/postscripts/xcatdsklspost,post.xcat,cumulusztpuse recursive wget/install/post/otherpkgsuses recursive wget for package directories/opt/xcat/share/doc/What is now blocked (403 on directory listing)
/install//install/custom//install/autoinst//tftpboot/Direct file access by known path continues to work for all paths.
Test plan
apachectl configtest— Syntax OK/install/returns 403 (directory listing blocked)/tftpboot/returns 403 (directory listing blocked)/install/postscripts/returns 200 with full listing (recursive wget works)syslog,ca-cert.pem,getcredentials.awk) returns 200/xcat-doc/returns 200 (preserved)rpowerand xCAT daemon unaffectedgit diff --checkcleanAddresses xcat2#7450