Web Design & Development

How to Secure My Websites? Step by Step Website Security

There are roughly one billion active websites online, or one for every seven people alive right now. Every single second, a couple new websites are born into this world. That’s a lot of websites, so how are they being created, and how do you make one? And also, how do you keep it secure from all the cyber threats out there?

Why Website Security Is Important

If you run a website whether business or personal then ensuring that it is secure is important for a number of reasons, as shown below:

  • To prevent Malware (viruses) being uploaded to your site
  • To prevent Phishing emails being sent via your website
  • To reassure your website visitors that your website is safe
  • To get a better ranking in the search engines like Google
  • To protect your business from getting hacked and to protect against losing vital data

What Happens If Your Website Is Not Secure?

If your website is not secure then hackers and criminals can target your website and exploit any weaknesses.

They have a range of hacking tools at their disposal but the main ones are:

  • Man In The Middle (MITM) Attack – this is where details are accessed between your website and the person’s browser
  • Malware Uploads – Malware is injected to your website through vulnerabilities in the code

6 Steps to Creating a Secure Website

01. Keep software up to date

Keep software up to date

If you are using a managed hosting solution then you don’t need to worry so much about applying security updates for the operating system as the hosting company should take care of this.

If you are using third-party software on your website such as a CMS or forum, you should ensure you are quick to apply any security patches. Most vendors have a mailing list or RSS feed detailing any website security issues. WordPress, Umbraco and many other CMSes notify you of available system updates when you log in.

02. Watch out for SQL injection

Watch out for SQL injection

SQL injection attacks are when an attacker uses a web form field or URL parameter to gain access to or manipulate your database. When you use standard Transact SQL it is easy to unknowingly insert rogue code into your query that could be used to change tables, get information and delete data. You can easily prevent this by always using parameterised queries, most web languages have this feature and it is easy to implement.

Consider this query:

"SELECT * FROM table WHERE column = '" + parameter + "';"

If an attacker changed the URL parameter to pass in ‘ or ‘1’=’1 this will cause the query to look like this:

"SELECT * FROM table WHERE column = '' OR '1'='1';"

Since ‘1’ is equal to ‘1’ this will allow the attacker to add an additional query to the end of the SQL statement which will also be executed.

You could fix this query by explicitly parameterising it. For example, if you’re using MySQLi in PHP this should become:

$stmt = $pdo->prepare('SELECT * FROM table WHERE column = :value');
$stmt->execute(array('value' => $parameter));

03. Apply a Web Application Firewall (WAF) to Protect Your Site

As soon as your website is online, it is exposed to a rogue’s gallery of cyber threats. Automated bots are out there scanning for vulnerable websites, and newly created sites are an especially tempting target. Adding a web application firewall (WAF) such as CloudbricIncapsula, or Cloudflare, will secure your website before the attacks start.

04. Beware of error messages

Be careful with how much information you give away in your error messages. Provide only minimal errors to your users, to ensure they don’t leak secrets present on your server (e.g. API keys or database passwords). Don’t provide full exception details either, as these can make complex attacks like SQL injection far easier. Keep detailed errors in your server logs, and show users only the information they need.

5. Do Business Online Secured by Secure Sockets Layer (SSL)

If you’re going to have users registering on your website, and especially if there will be any kind of transaction, you need to encrypt that connection. Using SSL certificates creates a secure handshake between your website and clients’ devices, ensuring that no third party can covertly slip in between and monitor, hijack, or shut down any transactions taking place. GlobalSign is one good example of a widely available SSL certificate that pairs well with almost every website.

Secured by Secure Sockets Layer (SSL)
SSL is the handshake between your website and your user’s browser that ensures a trusted connection.

06. Check your passwords

Everyone knows they should use complex passwords, but that doesn’t mean they always do. It is crucial to use strong passwords to your server and website admin area, but equally also important to insist on good password practices for your users to protect the security of their accounts.

As much as users may not like it, enforcing password requirements such as a minimum of around eight characters, including an uppercase letter and number will help to protect their information in the long run.

Tags

Maksud Masum

Professional Web Developer, Andorid Appplication Developer with App Inventor.

Leave a Reply

Adblock Detected

Please consider supporting us by disabling your ad blocker