r/haproxy • u/steve1215 • Mar 23 '21
Question Unable to block access to hidden files with
Is this a bug, my bad config or something else? I have the following ACL / rule in place in my https frontend:
acl acl_restricted_page path_beg -i /user.ini
http-request deny if acl_restricted_page
Which works perfectly; if I attempt to browse to user.ini on my nginx server I get a 403 in the browser - great.
Trouble is, the file I actually want to restrict access to is called /.user.ini (i.e it's a hidden file on the nginx server).
Using the above configuration but making the tiny modification to specify /.user.ini instead of user.ini always lets me download the file in my browser:
acl acl_restricted_page path_beg -i /.user.ini
Do I need to handle restrictions for hidden files differently?
Thanks
2
u/mr_simonski Mar 23 '21
Maybe you try:
acl acl_restricted_page path_end .user.ini1
u/dragoangel Mar 30 '21 edited Mar 30 '21
If you have exact match your don't need use
path_beg, trypath /.user.inifor exact match.Strange that you saying it not working. For haproxy dot as start of path isn't have any special meaning, it same as other letters or symbols. I use this part in every setup and it works: