Sicurezza su WordPress

Post on 06-Aug-2015

345 views 0 download

Transcript of Sicurezza su WordPress

Sicurezza su WordPressTutto ciò che normalmente non viene fatto su un sito WordPress

RelatoreAntonino Scarfì

Roma - 13/14 Giugno 2015

antoscarface antonino.scarfi@gmail.com antoninoscarfi

MI PRESENTO“Coach” & Senior Developer @YIThemes

COME LIMITARE I DANNIQuesta non è una guida per rendere un sito totalmente immune.Lo scopo del talk è mettere in evidenza gli errori più comuni.

TIENI WORDPRESS

SEMPRE AGGIORNATO

TIENI PLUGIN E TEMI

SEMPRE AGGIORNATI

LA SCELTA DELL’HOSTING•Effettua backup giornalieri di tutti i dati

delle sue macchine?

•Questi backup sono accessibili, oppure sono utilizzabili solo in caso di guasti al server?

•Consente l’accesso in SSH e SFTP?

UTILIZZA PASSWORD COMPLESSE•Maiuscole, minuscole, numeri e

caratteri speciali

•Per ricordarle più facilmente, puoi tenere in considerazione software per la memorizzazione delle password

NO!•07121985

•antoninos

•anto89

•qwerty

•password

•0000

• lucky (il nome del proprio cane)

SI!•=bX*4jHjPZ

•<C9SO5K`gU

• Imgèni13g! (Il mio gatto è nato il 13 gennaio!)

• IsNi28D8919[]yeah (Io sono Nato il 28 Dicembre 1989, YEAH!)

• In Sicilia ho mangiato 2 granite con la brioche.

PRIMO UTENTE WP1. Cambiare username e non

lasciare “admin”

2. Cambiare ID dell’utente 1

Alternativa:

• Impostare permessi di sottoscrittore

LIMITA L’ACCESSO PRINCIPIO DEL MINIMO PRIVILEGIO: ogni utente deve avere i privilegi necessari per svolgere il suo lavoro e nulla più.

PERMESSI FILE •755 -> a tutte le cartelle

•644 -> tutti i file

•600 -> wp-config.php

•604 -> .htaccess

SPOSTARE WP-CONFIG.PHP /home/username/public_html/wp-config.php

/home/username/wp-config.phpGià automaticamente gestito da WordPress

ATTIVARE MODULO SSL

PREFISSO TABELLE

Non lasciare il prefisso predefinito “wp_”

PREFISSO TABELLEper un sito già in funzione

Plugin utili: Change Table Prefix, Change DB Prefix

Rinominare le tabelle Rinominare opzioni

DISABILITA EDITOR DA ADMIN

BLOCCARE NAVIGAZIONE CARTELLE

Aggiungere in .htaccessOptions All -Indexes

NASCONDI WP-LOGIN.PHP

E WP-ADMIN

NASCONDERE WP-LOGIN.PHP

1. Cambiare link a wp-login.php e aggiungere controllo

PER I PIÙ SMANETTONI

NASCONDERE WP-LOGIN.PHP

2. Aggiungere regola rewrite

RewriteRule ^new-login$ wp-login.php

PER I PIÙ SMANETTONI

PROTEGGERE WP-ADMIN1. Aggiungere in .htaccess

2. Aggiungere in .htpasswd (esempio)

AuthType BasicAuthName “restricted area”AuthUserFile /path/to/protected/dir/.htpasswdrequire valid-user

letmein:E5Dj7cUaQVcN.

PER I PIÙ SMANETTONI

(via autenticazione)

PROTEGGERE WP-ADMINPermettere uno/più IP Bloccare uno/più IPorder deny,allowallow from 127.0.0.1 deny from all

order allow,denydeny from 127.0.0.1allow from all

PER I PIÙ SMANETTONI

(via autenticazione)

1. Aggiungere questo codice su functions.php del tema

2. Rimuovere i file LEGGIMI.txt, license.txt, licenza.html, readme.html dalla root di WordPress e ricordarsi di farlo ad ogni aggiornamento.

TOGLI VERSIONE DI WP

TIENI SEMPRE UN BACKUP DI FILE E DATABASE

NASCONDERE MESSAGGI AL LOGIN

PLUGIN• iThemes Security (ex WP Better Security)

•All in One WP Security

•Limit login attempts

•Sucuri Security

•Wordfence Security

You could stop the rest of your IT and pull all your resources into security for a year, and still not be 100% secure

Owen O’Connor, Presidente dell’ISSA (Information Systems Security Association) irlandese.