In Apache 2.4, When using both mod_autoindex
and mod_auth_basic
on a directory, the indexing of that directory causes mod_auth_basic
to perform a password hash and lookup from scratch once for every single file/subdirectory in the directory.
If using a string password storage hash like high-cost bcrypy, this can cause huge delays. Moreover, this behavior is unnecessary, since all files are under the same authentication settings, and so the user and groups need only be confirmed once. Confirming multiple times dramatically and artificially increases the local cost of strong password hashing with no security benifit, greatly reducing overall security by forcing the use of lower cost algorithms.
My question is: How can I inhibit this behavior?
How can I make mod_autoindex
make only a single call to the password authentication library?
Here's an example which has the problem:
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/mycert.crt
SSLCertificateKeyFile /etc/apache2/ssl/mykey.key
<Directory "/webdata/doc">
AuthType basic
AuthName "Safe Documents"
AuthBasicProvider file
AuthUserFile passwd/docuemnts_users.passwd
require valid-user
Options +Indexes
</Directory>
</VirtualHost>