Post by Matt Horton » Fri Aug 18, 2023 8:56 pm

Reading though the 'Security Practices' in the documentation - how important is all of this?

I've deleted the install directory.

I've not renamed the admin folder because this seems like it would cause issues, and it doesn't seem like it would fool a determined hacker.

Are the .htaccess and .htpasswd recommendations worth doing - considering that my IP address changes on a regular basis?

I also have the file permissions set as recommended.

Please share your thoughts
Last edited by Matt Horton on Tue Oct 03, 2023 4:27 am, edited 2 times in total.

Apache Server
OC 3.0.3.8
No theme installed


New member

Posts

Joined
Mon Jun 06, 2022 4:32 am

Post by halfhope » Sat Aug 19, 2023 3:06 am

General recommendations:
  • Don't use warez modules;
  • Use complex passwords. Don't invent them yourself, use generators;
  • Don't use the default names like admin, rename them;
  • Create separate accounts (FTP / admin panel) for contractors (freelancers), disable them upon completion of work;
  • Watch for changes in files;
  • Use backup;
2FA it's a good solution. I have free module for this purposes.

My FREE extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego

Post by Matt Horton » Mon Aug 21, 2023 8:38 pm

Thanks for the recommendations. Do you have any preferred software for checking for changes in files?

Apache Server
OC 3.0.3.8
No theme installed


New member

Posts

Joined
Mon Jun 06, 2022 4:32 am

Post by johnp » Mon Aug 21, 2023 8:54 pm

I always use a firewall on my OC sites. Personally I think it's good practice now to have one. I use Ninja Firewall which has a file guard feature:

Ninja Firewall
https://nintechnet.com/ninjafirewall/pro-edition

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by paulfeakins » Mon Aug 21, 2023 9:55 pm

Matt Horton wrote:
Fri Aug 18, 2023 8:56 pm
Reading though the 'Security Practices' in the documentation - how important is all of this?
All good things to do.

A lot of hacks are caused by bots that try adding /admin to random domains so changing that is a good thing usually.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by halfhope » Tue Aug 22, 2023 4:50 am

Matt Horton wrote:
Mon Aug 21, 2023 8:38 pm
Thanks for the recommendations. Do you have any preferred software for checking for changes in files?
Yes, this extension named FSMonitor. You can find it here.

My FREE extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego

Post by paulfeakins » Tue Aug 22, 2023 5:54 pm

halfhope wrote:
Tue Aug 22, 2023 4:50 am
Matt Horton wrote:
Mon Aug 21, 2023 8:38 pm
Thanks for the recommendations. Do you have any preferred software for checking for changes in files?
Yes, this extension named FSMonitor. You can find it here.
That looks pretty interesting.

Also our OpenCart Technical Audit checks all core files against the correct version of OpenCart:
https://www.antropy.co.uk/services/technical-audit/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Matt Horton » Tue Aug 29, 2023 9:01 pm

For the System folder, the documentation recommends:

Code: Select all

<Files *.*>
Order Deny,Allow
Deny from all
Allow from "your ip address"
</Files>

However, for the Catalog, it only recommends:

Code: Select all

<FilesMatch "\.(php|twig|txt)$">
Order Deny,Allow
Deny from all
Allow from "your ip address"
</FilesMatch>
Why not just deny access to all files in the Catalog folder?

Should I use the code that is recommended for the System folder in the Admin folder too?

Apache Server
OC 3.0.3.8
No theme installed


New member

Posts

Joined
Mon Jun 06, 2022 4:32 am

Post by ADD Creative » Tue Aug 29, 2023 10:30 pm

Matt Horton wrote:
Tue Aug 29, 2023 9:01 pm
Why not just deny access to all files in the Catalog folder?

Should I use the code that is recommended for the System folder in the Admin folder too?
Some of the theme assets will be in the catalog/view directory.

It's a good idea if you only access from a fixed IP address to limit access to the admin from your own IP addresses.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Matt Horton » Sat Sep 30, 2023 5:10 am

I've done everything suggested in 'Basic Security Practices' except I don't quite understand this:

"The system folder contains two files that need to be protected: logs/error.txt and start_up.php. The logs/error.txt can be renamed if necessary."

Is the .htaccess that blocks every IP address apart from mine enough to protect these files?

Is it a security recommendation to rename logs/error.txt, or would it be renamed for another reason?

Apache Server
OC 3.0.3.8
No theme installed


New member

Posts

Joined
Mon Jun 06, 2022 4:32 am

Post by paulfeakins » Mon Oct 02, 2023 7:02 pm

Matt Horton wrote:
Sat Sep 30, 2023 5:10 am
Is it a security recommendation to rename logs/error.txt, or would it be renamed for another reason?
No, you can't just rename those. You just need to make sure they can't be browsed by the general public which is the case by default anyway.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Matt Horton » Tue Oct 03, 2023 4:20 am

Thanks for the reassurance and help, everyone! I'm pretty happy with all that now. I'll mark this one as solved.

Apache Server
OC 3.0.3.8
No theme installed


New member

Posts

Joined
Mon Jun 06, 2022 4:32 am

Post by Joe1234 » Tue Oct 03, 2023 10:46 am

@halfhope, the FSMonitor, is it checking for modified date, or file size change? Because if it's checking for date, if I'm monitoring the modification directory, doesn't every file in the directory get an new date when a mod is refreshed, so I wouldn't be able to see which file someone actually changed? Vs if it compares file size.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by halfhope » Tue Oct 03, 2023 12:30 pm

Joe1234 wrote:
Tue Oct 03, 2023 10:46 am
@halfhope, the FSMonitor, is it checking for modified date, or file size change? Because if it's checking for date, if I'm monitoring the modification directory, doesn't every file in the directory get an new date when a mod is refreshed, so I wouldn't be able to see which file someone actually changed? Vs if it compares file size.
FSMonitor checks the CRC32 of file content, creation/modification time, file size, and permissions at the same time. So in any case, FSMonitor would react to any changes. What exactly was changed will be highlighted in a table. Also, you can always exclude storage/modification from scanning.

P.S. todo: add modification and database structure monitoring. 

My FREE extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego

Post by Joe1234 » Wed Oct 04, 2023 12:56 am

Ok, so when all the files in the modification dir get flagged because of a refresh date change, I can go to this table and look for the one that hade a change in the size or content and that would be the file that actually got "tampered" with? If so ounds good and I've been wanting something exactly like this (minus searching through all the modification files for the particular one with the size/content change lol but i guess thats understandable by the nature of this). I'll put this on my "to get" list.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by halfhope » Wed Oct 04, 2023 3:51 am

Joe1234 wrote:
Wed Oct 04, 2023 12:56 am
I can go to this table and look for the one that hade a change in the size or content and that would be the file that actually got "tampered" with?
Yes.

My FREE extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego
Who is online

Users browsing this forum: Majestic-12 [Bot], paola_84, paulfeakins and 62 guests