HostiServer
2026-06-03 19:12
Website Security in 2026: HTTPS, 2FA, WAF, 3-2-1 Backups — Complete Guide
How to protect your website from hackers: 7 steps that actually work
In our view, it's safe to say that an unprotected website in 2026 lives exactly until the first automated scanner finds it. And it finds everyone — because bots crawl the entire internet looking for two things: open admin panels and outdated CMSes. A large portal with an in-house engineering team and a small WordPress blog are equal targets, because the attack is mass and impersonal.
The paradox is that 90% of real incidents aren't sophisticated targeted attacks but elementary things: a weak admin password, a plugin that hasn't been updated in eighteen months, or port 22 left open with root login enabled. Hackers don't "break into" a site — they walk in through what the owner left open themselves.
Below we've put together 7 steps that actually work. No fluff about "threats of the digital age" — concrete settings we apply to clients after incidents, and that should have been applied before.
ℹ️ Who this article is for: owners of WordPress / Joomla / Drupal sites, developers who admin VPSes for their clients, and CTOs who want a quick audit without 200-page OWASP documents.
What a business actually loses after a hack
Most people think in terms of "data will be stolen" or "files will be encrypted." The real consequences are more complex, and financial losses often come not from the attack itself but from what happens afterward.
1. Dropping out of Google search
If Google Safe Browsing detects malicious code on a site, the resource gets the "This site may harm your computer" label in search results, and visitors see a red screen instead of content. Getting back into the index after cleanup takes anywhere from a few days to several weeks — and during that entire time organic traffic is effectively zero.
2. Browser-level blocking
Chrome, Safari, and Firefox sync with malicious-site lists. So even if someone has a direct link, the browser simply won't let them in without an extra "Visit anyway" click. The conversion of such "traffic" is close to zero.
3. Legal consequences
A leak of personal data (emails, phone numbers, order history) falls under GDPR in Europe or the corresponding data-protection law in the relevant jurisdiction. Fines are calculated as a percentage of company turnover, and notifying affected customers is a legal requirement — which is a separate reputational crisis on its own.
4. Mining and spam in your name
A hacked site rarely sits idle, because most often it gets pulled into a botnet — it starts sending spam, mining cryptocurrency, attacking other sites. The owner finds out about it from the traffic bill or from the hosting provider, who blocks the server for abuse.
⚠️ From tech support experience: in the vast majority of cases, restoring a site after a hack takes between 4 and 48 hours. Prevention is a few hours of one-off work. The math is simple.
Step 1. HTTPS + HSTS — the bare minimum
HTTPS in 2026 isn't even a security question anymore, it's technical hygiene. Without it, modern browsers show warnings, login forms get marked as unsafe, and Google demotes the site in search results. Any Wi-Fi in a café is a potential traffic interception point if the site runs over plain HTTP.
Which certificate to choose
| Scenario | Certificate type | Comment |
|---|---|---|
| Blog, landing page, info site | Let's Encrypt (free) | Automatic renewal via Certbot, 45-day validity |
| E-commerce, user accounts | OV from Sectigo / DigiCert | Organization verification, financial guarantee |
| Banks, fintech, insurance | EV with extended validation | Maximum trust level for critical domains |
HSTS — the second layer on top of HTTPS
HTTPS alone won't save you from a downgrade attack, where an adversary forces the browser to open the site over HTTP on the first connection. The HSTS header tells the browser: "for this domain, only HTTPS, no exceptions."
For Nginx, it's added with a single line in the server block:
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
ℹ️ What the parameters mean: max-age=31536000 — a year in seconds, the browser will remember the rule. includeSubDomains — applies to all subdomains. preload — a submission to the browser's built-in list (via hstspreload.org).
Step 2. Updating CMS, plugins, and libraries
Outdated software is the leading cause of breaches in CVE statistics. WordPress, which powers about 43% of all sites in the world, leads not because it's insecure by design but because it's ubiquitous. The CMS itself updates quickly — the problems start on the plugin and theme side.
What to do with the CMS core
- Enable automatic minor updates — these are security patches that don't break compatibility.
- Major updates (5.x → 6.x) should be installed manually after testing on a staging copy of the site.
- Subscribe to the CMS developer's security mailing list — critical holes are often closed with emergency patches.
What to do with plugins and themes
- Run a monthly audit: delete everything you don't use. Less code means a smaller attack surface.
- Check the date of the plugin's last update. If the developer hasn't shipped fixes in over 12 months — that's a red flag, the plugin is effectively abandoned.
- Never install "nulled" paid themes from torrents. In 99% of cases there's a backdoor baked in that will work quietly until the site gets used for spam.
🚨 A typical support scenario: a client lost access to the admin panel through a hole in an old gallery plugin. Through the uploader, the attacker uploaded a PHP shell, gained privileges, and set up a redirect to a phishing site. Restoring from backup took about 2 hours — but without a backup the loss would have been total.
The rule before updates
Back up before any major update. Before updating a large e-commerce plugin (WooCommerce, Magento modules) — back up and run a staging test. A backup made "after the fact" won't help with anything.
Step 3. Passwords and two-factor authentication
Most serious admin-panel breaches aren't "hacking" but plain brute-force or credential stuffing (trying passwords leaked from other places). Bots try 24/7, and if the password is admin / 123456 / qwerty — it's a matter of minutes.
What a proper password looks like in 2026
- Length — 16 characters or more. Complexity matters less than length:
correct horse battery stapleis harder to crack thanP@ss1! - Unique to each service. If one password covers 10 accounts — after the first leak all 10 are at risk.
- Generated, not invented by hand. Random 20–30 character strings are impossible to memorize — and you don't need to, that's what managers are for.
- Not stored in a text file, in the browser without a master password, or in a messenger. Only in a dedicated manager: Bitwarden, 1Password, KeePassXC (which have built-in generators anyway).
2FA — what stops 99% of automated attacks
Two-factor authentication adds a second layer on top of the password: a one-time code from a mobile app. Even if the password gets fully leaked, without access to the phone the attacker isn't getting in. This isn't marketing — it's a baseline standard that should be enabled anywhere there's even slightly sensitive data.
| 2FA method | Strength | Comment |
|---|---|---|
| SMS / email code | Weak | SMS is vulnerable to SIM-swap attacks, email — to mailbox compromise. Better than nothing, but not for critical accounts. |
| TOTP (Google Authenticator, Authy) | Strong | Code is generated locally on the phone, never transmitted over the network. The default standard. |
| Hardware key (YubiKey) | Maximum | A physical key that can't be stolen remotely. For admins of critical infrastructure. |
💡 Where to enable 2FA first: the hosting provider's control panel, the domain registrar, the admin's email account (it's used to reset passwords everywhere), GitHub/GitLab with the project code, the CMS admin panel.
Step 4. Server-level protection
Hosting is the foundation. If the server is poorly configured, even a perfectly secured site will be vulnerable: attackers go after the operating system, the network layer, or neighboring sites on the same server. So the key question to ask a provider is not "how much CPU" but "how do you isolate projects and what's the network protection."
Baseline server protection stack
1. Web Application Firewall (WAF)
A WAF analyzes HTTP traffic before it reaches the site and blocks typical attack patterns: SQL injection, XSS, path traversal attempts, exploits for specific CVEs. At the server level it can be ModSecurity with OWASP CRS rules; at the CMS level — Wordfence or Sucuri.
2. DDoS protection
Volumetric attacks (heavy floods of garbage traffic) in 2026 are measured in tens and hundreds of Gbit/s. You can't defend against them from a single server alone — you need infrastructure with filters at the data-center level. Application-layer attacks (slow requests that look legitimate) are caught at the WAF level.
3. Project isolation
On a quality VPS host, each client sits in their own KVM container with dedicated resources — an attack on a neighbor physically cannot touch your server because isolation is enforced at the hypervisor level. You have your own OS kernel, your own firewall, your own logs — none of it "leaks" between clients. If someone on the same hardware gets compromised, yours stays untouched.
4. Fail2ban against brute-force
A utility that monitors logs (auth.log, nginx access.log) and automatically bans IP addresses after N failed attempts. Baseline config for SSH:
[sshd]
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
findtime = 600
bantime = 3600
3 failed attempts in 10 minutes — banned for an hour. For CMS admin panels you'd write a separate filter targeting /wp-login.php or /administrator.
💡 A simple extra trick: change the default SSH port from 22 to something non-standard (49152+, for example). It won't stop a targeted attack — if someone is going after your server specifically, a port scanner will find the new one anyway. But the vast majority of automated brute-force only hits port 22, so this change instantly cuts the bulk of noise from the logs.
5. Restricting admin-panel access by IP
If you log in to the admin panel from a few stable locations (office, home, VPN), it makes sense to lock it down entirely at the nginx level:
location /wp-admin {
allow 198.51.100.42; # office
allow 203.0.113.0/24; # work VPN
deny all;
}
ℹ️ The IPs in the example are RFC 5737 documentation blocks, reserved for examples. In a real config, substitute your actual IPs.
6. Security Headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self'; img-src 'self' https:; script-src 'self'" always;
CSP is the trickiest one — it has to be tuned for the specific site, otherwise it breaks analytics and third-party scripts. You can check your site's protection level at securityheaders.com.
Step 5. Regular malware scanning
Even with a perfect configuration, a site can pick up malware through a different vector: a virus on the admin's workstation stole FTP credentials, or one of the developers accidentally committed production keys to the repository. So the "trust but verify" rule isn't a cliché but a working principle.
What to scan and with what
- Filesystem: ClamAV, maldet (Linux Malware Detect), Imunify360. Run via cron at least once a day for active projects.
- CMS system file integrity: Wordfence for WordPress compares files against reference versions from the official repository — any change triggers an alert.
- External scanning: Sucuri SiteCheck, VirusTotal — they check the site from a visitor's perspective and catch phishing redirects and injected JS.
- Database: in WordPress, attackers often add fake admins or inject spam into wp_options. Once a month it's worth going through the users table and looking at post_content for stray <script> tags.
What to do when you find something
| Finding | Action |
|---|---|
| A single infected file | Delete it, check the access logs for it, replace with a clean version from the official source. |
| PHP shell in /uploads | Delete it, block PHP execution in the uploads directory (location block with deny on .php). |
| Fake admin in the DB | Delete it, change passwords for all real admins, analyze when and from where the account was created. |
| Mass infection, unclear cause | Roll back to a clean backup, full audit, rotate all keys and passwords. |
Step 6. The principle of least privilege
Site owners often hand out access with a "let them have everything, just in case" mindset. That's the worst possible approach from a security standpoint. The more people have Admin rights — the more attack vectors there are against those accounts, and the harder it is to investigate an incident.
Role distribution in the CMS
- Administrator — the minimum number of people, ideally 1–2. Access to plugins, users, settings.
- Editor — for content managers. Can publish anything but doesn't touch plugins.
- Author — for external copywriters. Publishes only their own material.
- SEO / analytics — a separate role via a plugin like User Role Editor, with access only to the relevant sections.
Access for developers and contractors
- A separate SSH key per developer. No root access for anyone — for specific commands, write rules in
sudoers. - SSH by keys only, password authentication disabled (
PasswordAuthentication noin sshd_config). - Freelancer access — create accounts with a built-in expiry date from the start (e.g., via
chage -Eon Linux). Then you don't have to remember to remove them after the project ends — the account expires on its own. - For ad-hoc tasks — sudo with logging instead of direct root.
⚠️ A common slip-up: a developer who delivered the project a month ago still has the SSH key and FTP login. If their laptop gets stolen or compromised, that's automatically a vector into your infrastructure. Review the list of active keys and users once a quarter.
Step 7. Backups by the 3-2-1 rule
This is the last line of defense. If ransomware encrypted the files, or a developer accidentally dropped the production database — without a backup the loss can be total and irreversible. The 3-2-1 rule is an industry standard that was formulated before the cloud era, and it's still relevant.
What "3-2-1" means
- 3 copies of the data — the original plus two backups. Not one, not "we'll get to it someday."
- 2 different types of media or systems — for example, a backup on the same server plus a backup in remote storage. If both copies live on the same disk — those aren't two copies.
- 1 copy fully separated — in the cloud, on another continent, offline. If ransomware reaches the server and wipes the local backups, this copy is what saves the business.
How often to back up
| Project type | Frequency | Retention |
|---|---|---|
| Personal blog, landing page | Once a week | 30 days |
| Corporate site | Every 3–5 days | 30–60 days |
| Online store | Daily (DB — several times a day) | 90 days |
| News portal, forum | Several times a day | 30–60 days |
| SaaS, financial services | Continuous replication + daily snapshots | 1 year+ |
| Staging / dev | Before changes | Team's discretion |
🚨 The biggest mistake with backups: they get made but never tested. A backup only exists when it has been successfully restored. Once a quarter, spin up a fresh copy on a test domain and verify that the site starts and the database reads cleanly. Otherwise, at the critical moment, it may turn out that the archive is corrupted or missing half the tables.
Top 5 mistakes almost everyone makes
- "My site is too small, who would care." Bots don't pick victims by business size. They scan /16 and /24 subnets in sequence, looking for known holes. A small site is interesting precisely because nobody is guarding it.
- One password for hosting, domain, and email. If that password leaks from any of the three, the attacker gets control over everything — including the ability to transfer the domain to another registrar.
- "The host has backups, why would I need my own." Backups on the same server where the site lives aren't backups, they're an illusion. In a server compromise or ransomware case, they go down with production.
- Logging into the admin panel from public Wi-Fi without a VPN. Even with HTTPS there are vectors that work at the DNS and ARP-spoofing level. Either use a VPN, or don't log in to critical services from a café.
- Ignoring logs. An attack can often be seen in access.log and auth.log a day or two before it succeeds. But nobody looks there until the site goes down. Basic monitoring (Fail2ban + alerts to Telegram or email) is an hour of setup and months of peace of mind.
🚀 Reliable hosting = baseline security out of the box
Most of the steps in this article aren't complex work, but they require time and experience. On Hostiserver hosting, some of these things are configured by default, and the rest is helped along by tech support.
💻 Cloud (VPS) Hosting
- From $19.95/mo — KVM isolation per client at the hypervisor level
- WAF and DDoS protection — traffic filtering at the data-center network level
- Automatic backups — daily snapshots stored in remote storage
- Free Let's Encrypt SSL with auto-renewal and HSTS configured
- Help with Fail2ban, security headers, hardening — from tech support engineers
- 24/7 support — <10 min response, real engineers, no call center
🖥️ Dedicated Servers
- From $90/mo — full isolation, no neighbors on the hardware
- DDoS protection included in the plan, no surcharge for "premium"
- OS hardening setup during migration — sshd, fail2ban, firewall
- 99.9% uptime SLA and free migration from another provider
- Flexible configuration of CPU, RAM, disks for your project
💬 Not sure which option fits you?
💬 Drop us a line and we'll help you figure it out!
Frequently asked questions
- Is a single WordPress security plugin enough so I don't have to think about protection?
No. A plugin like Wordfence or Sucuri covers part of the vectors at the CMS level — file scanning, request filtering, 2FA. But it won't protect against network-level attacks (DDoS), it won't encrypt traffic (HTTPS), it won't save you from ransomware (backups), and it won't update plugins for you. It's one layer of defense, not the whole wall.
- How can you tell that a site has already been hacked?
Typical signs: a sudden drop in Google rankings with no visible cause, a "This site may be hacked" warning in search results, unusual redirects on mobile devices (since malicious code often targets only mobile UA), unknown files in /uploads or /tmp directories, new admins in the database you didn't create, and an abnormal spike in server load. If any of these is present, it's time to run a full scan and check the logs.
- What to do right now if the site has already been hacked?
Step by step: 1) put the site into maintenance mode or temporarily close access; 2) change all passwords — admin panel, FTP, SSH, DB, hosting panel, domain registrar, email; 3) take a fresh backup of the current state (for investigation); 4) restore the site from the last clean backup made before the infection; 5) update the CMS and all plugins; 6) figure out how they got in — otherwise the reinfection will come through the same vector. If it's too hard to do alone, contact the hosting tech support; decent providers offer cleanup as a service.
- How much does comprehensive site protection actually cost?
Most things in this article are free: HTTPS via Let's Encrypt, fail2ban, security headers, 2FA, CMS updates. The paid pieces are typically: a premium security plugin (~$100–200/year), remote storage for backups (a few dollars a month), quality hosting with built-in WAF and DDoS protection. So the annual security budget for a small or medium site comfortably fits in $300–500. For comparison, recovery from a single serious incident costs from $500 to several thousand, plus reputational damage.
- Do I need SSL/HTTPS if the site has no forms or payments?
Yes. First, since 2018 Google marks sites without HTTPS as "Not secure" in Chrome — this affects user trust. Second, without HTTPS there's no HTTP/2 or HTTP/3 support, so the site will be noticeably slower. Third, HTTPS protects against injection attacks at the ISP level (yes, ISPs sometimes inject their own ads into HTTP traffic). A Let's Encrypt certificate is free and takes 5 minutes to set up — there's simply no reason not to.
- Will Cloudflare replace everything else?
Cloudflare covers part of the job: CDN, baseline DDoS protection, WAF on the free plan — limited; on paid plans — full-featured. But it's not a replacement for local hygiene: updates, passwords, backups, security headers, fail2ban. If someone logs into the admin panel with a stolen password, Cloudflare won't stop them. It's an extra layer that works well alongside everything described above, not instead of it.