Koozali.org: home of the SME Server

Disable index listing of Apache "icons" folder

Offline pizzaco

  • ***
  • 53
  • +0/-0
Disable index listing of Apache "icons" folder
« on: October 24, 2011, 05:00:10 PM »
The nature of our business requires a quarterly security scan. Our scanning vendor discovered that mydomain.com/icons/ is returning an index listing. Although indexing this folder probably isn't a volunerablity, I want to shut it off.

I think I can do this by creating a custom template to modify the Apache config file, but I only want to do that as a last resort.  Does anyone know of a "built-in" way to shut this off?

Thanks


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Disable index listing of Apache "icons" folder
« Reply #1 on: October 24, 2011, 06:43:17 PM »
I think I can do this by creating a custom template to modify the Apache config file, but I only want to do that as a last resort.  Does anyone know of a "built-in" way to shut this off?
There is no built-in way to shut this off. The custom-template route is the way to go, here is a simple way to set the "Options Indexes" to "Options -Indexes in a custom-template.

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
sed -e 's/Indexes/\-Indexes/' \
< /etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess10icons \
> /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess10icons
expand-template /etc/httpd/conf/httpd.conf
sv t httpd-e-smith
« Last Edit: October 24, 2011, 10:15:44 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline pizzaco

  • ***
  • 53
  • +0/-0
Re: Disable index listing of Apache "icons" folder
« Reply #2 on: October 24, 2011, 09:47:49 PM »
Thanks, cactus.  That did the trick.  I did have to add an single-quote to the sed command and also collapse it back to one line.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Disable index listing of Apache "icons" folder
« Reply #3 on: October 24, 2011, 10:17:47 PM »
I did have to add an single-quote to the sed command and also collapse it back to one line.
Oops, it was missing a quote indeed, I fixed that. The multiline command should not be an issue normally, the trailing backslashes should allow the command to brake over multiple lines. Are you sure the backslashes are the last token on the line?
« Last Edit: October 24, 2011, 10:19:53 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline pizzaco

  • ***
  • 53
  • +0/-0
Re: Disable index listing of Apache "icons" folder
« Reply #4 on: October 24, 2011, 10:23:51 PM »
There was an extra trailing space after the first back slash. Didn't know to check for something like that. Thanks for the tip.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Disable index listing of Apache "icons" folder
« Reply #5 on: October 24, 2011, 10:24:41 PM »
There was an extra trailing space after the first back slash. Didn't know to check for something like that. Thanks for the tip.
You're welcome, I have ran into that in the past scratching my head as well... :-D
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Disable index listing of Apache "icons" folder
« Reply #6 on: October 24, 2011, 10:28:20 PM »
Does anyone know of a "built-in" way to shut this off?

Yes, raise the issue via the bug tracker, and wait for the issue to be addressed via an update in the distribution.

The other way is a custom template. You should do both.

Offline pizzaco

  • ***
  • 53
  • +0/-0
Re: Disable index listing of Apache "icons" folder
« Reply #7 on: October 24, 2011, 10:45:37 PM »