Zen Cart Logo
Forums / General Questions / Securing my site...

Securing my site...

Locked

Views: 1,551

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
4 Oct 2006, 7:52 PM
#1
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Securing my site...

Ok, I've read the security info in the docs folder, but I has a couple of questions regarding the best secutiry practices.

1 - When creating the default .htaccess file (that blocks direct access to .txt and .php files) is there a reason we do not simply block direct access to . (all files)?

2 - How can I prevent people from stealing my images from my images folder? Use a similar .htaccess method - like the above?

3 - I understand the use of "blank" .html files in certain folders. Would setting up a redirect (to my homepage) in these files be silly (security-wise)?

Anyone able to help with this?

4 Oct 2006, 8:06 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Securing my site...

  1. You still need to be able to access the .css and .jpg/.gif etc files

  2. You can use a .htaccess method, but it can't be simply a *.xxx sort of mask. You need to check where they're coming from. There are published .htaccess methods to prevent image theft. I haven't seen one that works 100% reliably. If not done properly, even your customers will not be able to see your images.

  3. Yes, you can do that if you like. It might be more advised to use an index.php that has a header() redirect that sends a 404-not-found or a 301-moved header so that folks don't keep attempting access to it

4 Oct 2006, 10:11 PM
#3
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Securing my site...

Thanks for the info.

Do you think you could explain how to create the index.php with the header a little more. I'm sure I can implement this fairly easiler... with a little help from the doc!

Thanks. :)

4 Oct 2006, 11:05 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Securing my site...

<?php
    session_write_close();
    header("HTTP/1.1 404 Page Not Found"); 
    header('Location: ' . 'http://' . $_SERVER['HTTP_HOST']);
    exit();
?>
5 Oct 2006, 8:03 PM
#5
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Securing my site...

Thanks for this.

I tried replacing all index.html files with the php code below and something strange happened... When accessing my site root the php code was being called, which meant that I couldn't progress through the site.

Do you know any reason why this is happening?

5 Oct 2006, 8:21 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Securing my site...

if you had an index.html in the root of your site, you should not have touched it, as it is called before anything else is.

5 Oct 2006, 8:53 PM
#7
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Securing my site...

I don't recall touching this file. However, I did rush this so I better try it again.

Will post 2nd results soon.

5 Oct 2006, 10:37 PM
#8
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Securing my site...

Ok, I found the problem.

When adding the index.php file to the following dirs my site would forward to the root of my web server.

admin\includes\extra_configures

and

includes\functions\extra_functions

So I didn't put the files there!

I really like the way these files work, however, since they are php access is not granted to them (due to some .htaccess files). I would like to keep the .htaccess files there (for obvious security reasons), but is there a way I can bypass the restriction on .php files for inde.php only?

7 Oct 2006, 1:30 PM
#10
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Securing my site...

I was thinking of using a metatag-redirect in the index.html files and probably will do now.

Thanks for the help. :)