MySQL Backup e Veeam Backup & Replication – Parte 1

Il presente articolo illustrerà come implementare una strategia di protezione dei dati in ambienti MySQL.

Partiamo da una considerazione.

Per realizzare backup consistenti da un punto di vista applicativo, è necessario che prima che sia avviato  il processo di copia, l’applicazione abbia scritto su disco tutti i dati in memoria (flush).

Ad esempio, le applicazioni Microsoft® utilizzano una tecnologia denominata Shadow Copy che attraverso il coordinamento di driver VSS realizza la consistenza applicativa.

Una tecnologia simile non è disponibile su Linux ed in più MySQL non la supporta in ambiente Microsoft®.

Come ovviare?

Attraverso la creazione di script che automatizzino la consistenza applicativa prima di avviare la creazione della Snapshot.

Compreso questo aspetto, torniamo all’ambito dell’articolo, introducendo le opzioni disponibili per MySQL.

Nota 1: La consistenza applicativa avviene prima della creazione della snapshot.

  • 1. Backup Logico: Lo script crea un file con l’estensione .sql che in caso di ripristino permette la ricreazione del database e dei suoi dati.

Il file .sql è creato attraverso il comando nativo MySQL “mysqldump”.

I vantaggi del backup logico possono essere riassunti in:

  • Non vi sono dipendenze con software di terze parti.
  • I backup possono essere ripristinati su altri server.
  • 2. Backup Fisico/Cold: Sono create copie a freddo dei file del DB (ad esempio: ibdata, .ibd, .frm, ib_logfile, my.cnf).

Per essere certi che i backup siano realizzati in modalità “consistenza applicativa“, prima di effettuare la snapshot, è      indispensabile fermare i servizi MySQL.

E’ una strategia di backup di norma implementata in ambienti che non richiedano operatività 24×7.

Nota 2: Il servizio viene fermato solo per il tempo necessario alla creazione della snapshot e non per l’intera durata del backup.

  • 3. Backup Fisico/Hot: Se è in esecuzione il motore InnoDB, lo script permette la realizzazione di copie consistenti senza fermare i servizi (utilizzando ad esempio il comando mysqlbackup componente della suite Enterprise di MySQL (MySQL Product)).

Ora che conosciamo le opzioni di scripting disponibili, vediamo come le soluzioni Veeam possano integrarsi nativamente con gli  ambienti MySQL.

La prima opzione disponibile è il Veeam Agent for Linux (VAL) che automatizza le seguenti quattro fasi:

  1. Flush dei dati dalla memoria al disco (consistenza applicativa).
  2. Creazione della snasphot.
  3. Rilascio delle tabelle.
  4. Avvio del processo di Backup.

Nota 3: Come indicato nella prima parte dell’articolo, se il DB è del tipo MyISAM è possibile effettuare il backup con il blocco di tutte le tabelle.

I pre-requisti del VAL sono:

  • Versione di MySQL maggiore o uguale alla 5.8.
  • Sistema operativo sia Linux.

Domanda: E’ possibile effettuare il backup in ambienti Windows e dove la versione di MySQL è inferiore alla versione 5.8?

La risposta è si e gli scenari disponibili sono:

Backup Logico -> Hot-Backup Database Online Dump -> Comando mysqldump.

Backup Fisico/Cold -> Cold-Backup Database Shutdown -> Fermo temporaneo dei Servizi.

Backup Fisico/Hot -> Hot-Backup Database Freeze -> Comandi nativi mysql.

Nota4: Esiste anche la possibilità di effettuare Backup Parziali. In questo scenario si effettua il backup di specifiche tabelle e database. E’ utile quando si devono realizzare strategie di protezione differenti sullo stesso Server.

Nel prossimo articolo scopriremo come creare gli script e come integrarli in Veeam Backup & Replication.

Veeam & Google Cloud Platform – Parte 2

Nel precedente articolo, è stato illustrato come utilizzare VBR (Veeam Backup & Replication) come framework per proteggere le istanze (VM) presenti nella Piattaforma Google Cloud (GCP).

Il componente integrato di VBR che automatizza i processi di backup e restore, è il VBGP (Veeam Backup for Google Platform), giunto ad oggi (gennaio 2022) alla sua seconda versione.

Il VBGP permette di salvare a livello di immagine le istanze Google, ma ad oggi non è in grado di ripristanre in modalità granulare le applicazioni.

Nota 1: Il VBGP permette di realizzare backup “Application Consistency” delle istanze attraverso:

  • le VSS (Windows Volume Snapshot Copy Services) per i sistemi operativi Microsoft-Windows.
  • Script personalizzabili per i sistemi operativi Linux.

Nei casi in cui sia richiesto il backup dei transaction log o il ripristino granulare di oggetti applicativi, è necessario utilizzare il Veeam Agent (VA).

Nota 2: Nel sito www.gable.it troverete molti articoli che dettagliano come implementare i Veeam Agent.

Nota 3: Il Backup Server VBR può essere installato sia in cloud (ad esempio come istanza in GCP) che on-premises. In tutti gli scenari è necessario garantire la corretta connettività tra i componenti.

Nota 4: La versione 12 di VBR (in uscita nel 2022) aggiungerà una serie di miglioramenti in ambito Cloud. Ad esempio la possibilità di gestire il deploy e i componenti Veeam Agent, senza dover creare a priori una VPN tra il VBR on-premises e le istanze da proteggere.

Vediamo ora le due fasi principali per realizzare il Backup dell’istanza:

La prima fase ha lo scopo di realizzare discovery e il deploy dell’Agent sull’istanza (vedi immagine 1) (menù Inventory, Create a Protection Group).

Immagine 1

Nella seconda fase, la creazione del job di Backup selezionando la voce Veeam Agent for Windows (Immagine 2)

Immagine 2

Durante il Wizard selezioniamo alla voce Backup Mode,  Entire Computer (immagine 3) e alla voce Storage il Repostitory di Backup (immagine 4).

Immagine 3

Immagine 4

Il punto focale del presente articolo è la gestione della protezione delle applicazioni (in questo scenario MS-SQL).

Dopo aver abilitato l’application aware processing (immagine 5), è possibile operare a livello di Transaction Log, selezionando se cancellarli dopo ogni operazione di Backup (Trunking) oppure ancora se effettuare il backup dei soli T-Log. (immagini 6-8).

Immagine 5

Immagine 6

Immagine 7

Immagine 8

Dopo aver avviato il job, controlliamo che alla voce Disk sia presente almeno un punto di ripristino (vedi immagine 9).

Immagine 9

Concludiamo il presente articolo illustrando le opzioni di ripristino del Veeam Agent for Windows: (immagine 10)

  • Verso architetture virtuali VMware & Hyper-V
    • Instant Recovery
    • Ripristino di Volumi
    • Esportazione dei Dischi (VMDK, VHD, VHDX)
  • Verso architetture Public Cloud
    • AWS
    • Azure
    • GCP
  • La creazione di  un Recovery Media per realizzare un Bare Metal Restore
  • Il ripristino di File e Cartelle (immagine 10, disponibile anche con il VBGP)
  • Il ripristino di oggetti applicativi (immagine 11 & 12, disponibile unicamente via VA)

Immagine 10

Immagine 11

Immagine 12

Tutte le opzioni di ripristino utilizzando il Veeam Explorer per SQL sono disponibili al seguente sito.

Nota 5: Nell’ esempio è stato scelto uno Scale Out Backup Repository che ha il vantaggio di copiare i dati verso l’Object Storage di Google (vedi immagine 13). La versione 12 di VBR permetterà la scrittura diretta verso l’Object Storage

Immagine 13

A presto

Veeam & Google Cloud Platform – Parte 1

Il primo articolo del 2022 è dedicato a come proteggere le istanze Google (GCP).

Il flusso e l’architettura di protezione è riportato nell’immagine 1 dove sono presenti due componenti Veeam.

  1. L’ istanza Veeam Backup for Google Platform (VBGP) ha il compito di realizzare backup e ripristini delle istanze GCP.
  2. Veeam Backup & Replication (VBR) ha l’onere di gestire centralmente la movimentazione dei dati di Backup da e per il cloud (Data Mobility).

Immagine 1

  • Nota 1: VBGP può essere installato in modalità stand alone oppure utilizzando il wizard di VBR.
  • Nota 2: Il presente articolo mostrerà come agganciare da VBR un istanza VBGP già presente in GCP.

Vediamo in modalità dettagliata i passaggi:

Dalla console di VBR scegliamo la voce Backup Infrastructure.

Cliccando con il tasto destro del mouse, selezioniamo la voce add server e successivamente Google Cloud Platform (vedi immagine 2)

Immagine 2

Il prossimo passaggio è quello di inserire le credenziali di accesso al Service Account di Google (immagine 3)

Immagine 3

Il wizard prosegue chiedendovi di inserire il nome del server VBGP già creato (immagine 4)

Immagine 4

Dopo aver selezionato la tipologia di rete presente (immagine 5) il passaggio successivo è quello di inserire le credenziali di accesso al Repository (immagine 6).

Ricordo che la best practice di protezione è quella di effettuare il backup dell’istanza come snapshot, successivamente riversare la snapshot verso il Cloud Object Storage di Google.

Si rispetta così la regola del 3-2-1, avere cioè 3 copie dei dati (Produzione + Snapshot + Object Storage) su due differenti media (Storage primario + Object Storage) con una copia offsite (Object storage dovrebbe afferire ad un’altra region).

Immagine 5

Immagine 6

Concluso il wizard, sempre dalla console di VBR possiamo collegarci alla console al server VBGP (immagine 7) per iniziare a creare policy di protezione.

Immagine 7

Dopo aver inserito le credenziali di accesso (immagine 8)

Immagine 8

è possibile monitorare l’ambiente attraverso un overview delle istanze presenti, di quelle protette (immagine 9 & 10)

Immagine 9

Immagine 10

Gestire le politiche di protezione attraverso:

La creazione delle policy di Backup, indicando nome (immagine 12), selezionando il progetto (immagine 13), la region (immagine 14), le risorse (immagine 15), il target di Backup (immagine 16), la schedulazione e la tipologia di backup (immagini da 17 a 19)

Immagine 11

Immagine 12

Immagine 13

Immagine 14

Immagine 15

Immagine 16

Immagine 17

Immagine 18

Immagine 19

Le ultime due voci indicano la stima dei costi mensili per realizzare la policy di backup (immagine 20) e l’impostazione dei retry e delle notifiche (immagine 21)

Immagine 20

Immagine 21

Terminata la configurazione e dal monitoraggio verificato che la policy si è completata con successo, è possible procedere al ripristino (immagine 22).

Immagine 22

Le opzioni disponibili sono:

  • Intera Istanza
  • File e Cartelle

Le prossime immagini  (23-24-25) mostrano i passaggi chiave per ripristinare l’ìntera istanza.

Immagine 23

Immagine 24

Immagine 25

Nel prossimo articolo vedremo come poter proteggere e rispristinare un DB Sql presente in un’istanza GCP

A presto

VBR – Mac Backup

Veeam Backup & Replication (VBR) version 11 has a new feature and Mac users will fall in love with it.

It is now available for the backup and restores of your MACOS files.

It supports the last Operating Systems starting from High-Sierra (Big Sur 11.X.X / Catalina 10.15.X / Mojave 10.14.X / High Sierra 10.13.6).

Note 1: The Veeam Agent for Mac (VAM) version 1 supports the M1 processor via Rosetta.

Note 2: The VAM supports consistent data backup with snapshots for the APFS file system.

In the other file systems, the backup is created via a snapshot-less approach.

Note 3: At the moment it’s possible to perform the backup of user data (with a custom scope too). The image of the entire machine and a Bare Metal Restore are not available yet.

The configuration steps are quite easy as shown in the official guide:

To recap, the procedure consists of:

  1. From the VBR console create a resource group using a flexible scope
  2. Copy the files generated from VBR to the MAC to protect
  3. Install the package to your machine and import the created configuration. (It allows the communication between VBR and the Mac)
  4. From the VBR console creating the backup policy and apply it

The following video shows how it works in a managed VBR architecture.

Take care and see you soon.

A flexible file backup Strategy – Part 3

This article’s topic is how to set up and work VBR when it is combined with the NDMP protocol.

This type of configuration is part of the category “file to tape” I treated in my last article “A flexible file backup Strategy – Part 2”.

One more note before starting: VBR requires NDMP version 4 and later.

  • How does it work?

Picture 1

The architecture is quite easy.

Files are gathered from the File Server through the data mover present on the Gateway server. Then they are sent to the Tape Server that performs the write on Tape.

The Datamover installed on Tape Server has the ownership of managing the data traffic to Tape Device.

VBR has the task of enumerating the Volumes and launch the command to Tape Devices.

Point-1: VBR works with a 3 layer backup architecture. It means there is no direct connection between File Servers and Tape Devices. All Data have to pass through the tape Sever.

In this article, I’m not covering the procedure to set up the NAS correctly. Please ask your storage vendor specialist to get all details needed.

How to add the NDMP server to VBR and set up a backup job?

The next video will answer the question.

Video 1

After the backup is completed how to perform a restore?

NDMP backup files are available to perform restores from the FILE menu at the voice Tape and then NDMP as shown in picture 2

Picture 2

 

Please have a look at the next short video (video 2) to see the easy step to perform a restore.

Video 2

Point-2: The backup chain stored on tapes will consist of 10 restore points maximum. On the 11th run, VBR will force an active full.

  • Common scenarios

One of the main characteristics of NDMP backup is that it allows to perform backup and restore of entire volumes.

The most common scenario is the Disaster Recovery of the entire Filer. Imagine the case in which the customer NAS filer is completely out of order and the only way to restart the file sharing service is formatting all the disks and then restoring the volumes (or the worst case is getting a new NAS).

In this case, NDMP volume restores from tape is an excellent low-cost solution.

Main Pro:

NDMP servers backup to tape is available in the Enterprise Plus Edition of VBR.

It means that there is no limit on the amount of data that can be saved. Could be 1 TB or 100 PB it doesn’t matter.

Veeam Universal License (VUL) has the Enterprise Plus Edition available. Is it time to move your old sockets license to the subscription model (VUL)?

Cons:

The granular restore (files and folders) it’s not an available option with VBR and NDMP backup.

Please note that NAS backup is now completely supported by VBR (please refer to article 1 of this series) and it’s the fastest way to perform the granular restores.

Point-3: Even if the NAS device supporting NDMP protocol is already added to VBR, you need to add the NDMP server as a separate procedure. Otherwise, you will not be able to perform file backup to tape.

The next article will cover a recap of the different techniques and show a hidden gem of VBR.

See you next week and take care

Ransomware defense part 2: Hardening

There are many documents on the internet that describe how to address this common request.

In this article, I’ll give you a track to move easier around this topic pointing out the most interesting articles.

Before starting let me thank Edwin Weijdema who created an  exhaustive guide to answer the common question (please click here to get it)

Are you ready? Let’s start

1- The first magic point for starting is Wikipedia where I got a good definition:

In computinghardening is usually the process of securing a system by reducing its surface of vulnerability, which is larger when a system performs more functions; in principle, a single-function system is more secure than a multipurpose one. Reducing available ways of attack typically includes changing default passwords, the removal of unnecessary software, unnecessary usernames or logins, and the disabling or removal of unnecessary services.

2- The second point is to understand the concept of Perimeter security:

It is natural barriers or artificially built fortifications that have the goal of keeping intruders out of the area . The strategies can be listed as:

  • Use rack-mount servers
  • Keep intruders from opening the case
  • Disable the drives
  • Lock up the server room
  • Set up surveillance

A complete article is available by clicking here

3- The third point is  Network segmentation:

It is the division of an organization network into smaller and, consequently, a more manageable grouping of interfaces called zones. These zones consist of IP ranges, subnets, or security groups designed typically to boost performance and security.

In the event of a cyberattack, effective network segmentation will confine the attack to a specific network zone and contain its impact by blocking lateral movement across the network via logical isolation through access controls.

Designating zones allows organizations to consistently track the location of sensitive data and assess the relevance of an access request based on the nature of that data.  Designating where sensitive data reside permits network and security operations to assign resources for more aggressive patch management and proactive system hardening.

A complete article is available by clicking here

4- Hardening your Backup Repositories

The next good rules involve your backup architecture and in specific the Backup Repositories:

Windows:

a. Use the built-in local administrator account

b. Set permissions on the repository directory

c. Modify the Firewall

d. Disable remote RDP services

Linux:

e. Create a Dedicated Repository Account

f. Set Permissions on the Repository Directory

g. Configure the Linux Repository in VeeamModify the Firewall

h. Use Veeam Encryption

Do you want to know more about security? If so the Veeam Best Practices are for sure the answer.

The next article will cover monitoring and automatic actions using Veeam-ONE.

5- Prevent injection of shady boot code​

Code injection, also called Remote Code Execution (RCE), occurs when an attacker exploits an input validation flaw in software to introduce and execute malicious code.

To prevent the attack please follow the following rules:

a. Run with UEFI Native Mode​
b. Use UEFI with Secure Boot Standard Mode​
c. Combine Secure Boot with TPM
d. Equip critical servers with a TPM 2.0

Stay tuned and see you soon