Veeam v11: Hardened Repository (Immutability) add MFA - pt.3

veeam-v11-add-mfa-hardened-repository-01

If your corporate policies don't allow you to disable SSH logins to your Hardened Repository, you should add MFA to your system to enforce security.

This protection works only if Veeam Backup & Replications v11 is used since previous Veeam versions required SSH over port 22 breaking the functionality.

To add multi-factor authentication (MFA) to your Hardened Repositories, DUO offers a cost-effective solution that's fit for purpose.

veeam-v11-add-mfa-hardened-repository-02

 

Blog Series

Veeam v11: Hardened Repository (Immutability) installation - pt.1
Veeam v11: Hardened Repository (Immutability) configuration - pt.2
Veeam v11: Hardened Repository (Immutability) add MFA - pt.3

 

Generate application keys

Before proceeding with Hardened Repository MFA configuration, we need to generate the application keys in the DUO portal.

Using your preferred browser, login to DUO portal as admin.

veeam-v11-add-mfa-hardened-repository-03

Go to Applications area and click on Protect an Application button.

veeam-v11-add-mfa-hardened-repository-04

Scroll down the list until you find UNIX Application then click Protect.

veeam-v11-add-mfa-hardened-repository-05

Under Details you find the keys to configure duo_login application in your Linux server used as Hardened Repository.

veeam-v11-add-mfa-hardened-repository-06

 

Install login_duo

SSH your Hardened Repository and install the login_duo package. In the example, the Hardened Repository uses Linux Ubuntu OS.

# sudo apt-get install -y login-duo

veeam-v11-add-mfa-hardened-repository-07

Edit the /etc/security/login_duo.conf file to begin the configuration.

# sudo vi /etc/security/login_duo.conf

veeam-v11-add-mfa-hardened-repository-08

Enter the required keys to configure duo_login application. Additional settings can be found in the Duo Configuration Options table.

  • Integration key
  • Secret key
  • API hostname

veeam-v11-add-mfa-hardened-repository-09

The /etc/security/login_duo.conf file with the keys generated in the DUO portal.

veeam-v11-add-mfa-hardened-repository-10

 

Test duo_login

As normal user, run the following command to test duo_login. If everything works as expected, you should receive an enrollment link and prompted to enroll.

# /usr/sbin/login_duo

veeam-v11-add-mfa-hardened-repository-11

Copy the link to your preferred browser and start the enrollment procedure. Click Start Setup.

veeam-v11-add-mfa-hardened-repository-12

Specify the device (Phone recommended) to use and click Continue.

veeam-v11-add-mfa-hardened-repository-13

Enter your phone number and confirm. Click Continue.

veeam-v11-add-mfa-hardened-repository-14

Specify the phone type and click Continue.

veeam-v11-add-mfa-hardened-repository-15

Install DUO app in your phone then click I have Duo Mobile installed.

veeam-v11-add-mfa-hardened-repository-16

Using the DUO app installed on your phone, scan the QR code and click Continue when done.

veeam-v11-add-mfa-hardened-repository-17

Once the phone has been enrolled, run the login_duo command again. Enter the code displayed in the DUO app installed on your phone and press Enter. If you receive the message "Success. Loggin you in...", the authentication process works properly.

# /usr/sbin/login_duo

veeam-v11-add-mfa-hardened-repository-18

Now, to enable MFA for any SSH login on your Hardened Repository, edit the /etc/ssh/sshd_config file.

# sudo vi /etc/ssh/sshd_config

veeam-v11-add-mfa-hardened-repository-19

Add the following line (you need OpenSSH 4.4 or later) and save the file:

ForceCommand /usr/sbin/login_duo

veeam-v11-add-mfa-hardened-repository-20

To protect SSH logins, you should disable PermitTunnel and AllowTcpForwarding in your sshd_config. Add these two lines:

PermitTunnel no
AllowTcpForwarding no

veeam-v11-add-mfa-hardened-repository-21

Restart SSH service.

# sudo systemctl start ssh

veeam-v11-add-mfa-hardened-repository-22

When you try to SSH the Linux Server, you are now requested to enter the passcode generated by the DUO app installed in your phone.

veeam-v11-add-mfa-hardened-repository-23

If you want to receive push login request instead of entering the code, add the following line to the /etc/security/login_duo.conf file:

autopush = yes

veeam-v11-add-mfa-hardened-repository-24

Although is recommended to disable SSH login, adding the MFA to your Hardened Repository add an extra layer of security.

In addition to adding MFA to SSH logins, make sure there is not direct access to your repository from Internet and block any unwanted inbound traffic. Outbound Internet traffic should allow only DUO, Ubuntu (or the Linux distro you are using) and NTP services.

signature

3 Comments

  1. Ramon 10/03/2022
  2. Greg T 09/09/2022
    • Paolo Valsecchi 10/09/2022