Security Tips

Security Tips For The Websites

  • Feb 28, 2020
  • by Lovepreet Singh
  • Web Development

  1. Server-related security
    1. Setting under network security or firewall rules
      • Block the port to connect from any IP to the server using the private key file.
      • Allowed only known IPs to connect with the server.
    2. File/Folder permissions changes
      • Change file and directory permissions to 644 and 755 respectively. Follow below commands from root directory:
        find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \;
  2. CMS or Framework related security ( Code level )
    1. Avoid Direct access to internal files
      • Use index or htaccess file to avoid direct access to the files inside the directory
      • Allowed only known IPs to connect with the server.
    2. Use CSRF (Cross-site request forgery)
      • Enable CSRF token implementation to handle any type of request to avoid forgery
    3. Use index.php of pub directory rather than the root directory.
      • This feature exist in most of CMS and Frameworks like Magento and Laravel. This feature will avoid direct access to the root directory and keep our site safe from hackers.