Refresh HA1 SSH Keys and Configure Key Options

If you enable encryption over the HA1 control link, you can refresh the SSH host keys, change various key options, and re-establish HA1 sessions between HA peers without restarting the peers.
When you configure active/passive or active/active high availability (HA), you can enable encryption for the HA1 (control link) connection between HA firewalls. You may want to secure the HA1 traffic between HA peers with encryption if the firewalls aren’t located in the same site.
All Palo Alto Networks firewalls come with Secure Shell (SSH) pre-configured, and the HA firewalls can act as both SSH server and SSH client simultaneously. If you enable encryption on the HA1 control link, you can use the CLI commands that follow to secure the connection between the HA firewalls. You can change the
default host key type
, generate a new pair of public and private SSH host keys for the HA1 control link, and configure other HA1 encryption settings. You can enable the firewalls to use the new host keys and the following settings without restarting the HA peers, thus avoiding your firewalls going offline. The firewall reestablishes HA1 sessions with its peer to synchronize the new SSH key and other settings and also generates system logs (subtype is
ha
) for re-establishing HA1 and HA1-backup sessions.
The following examples show how to refresh (regenerate) your HA1 SSH keys and change and display various SSH settings for the HA1 control link after you enable encryption and Access the CLI.
You must enable encryption and it must be functioning properly on an HA pair before you can perform the following tasks.
If you are configuring the HA1 control link with encryption in FIPS-CC mode, you must set automatic rekeying parameters for session keys.
  • (
    Optional
    ) Set the default host key type.
    If you enable encryption on the HA1 control link, the firewall uses a default host key type of RSA 2048 unless you change it. The HA1 SSH connection uses only the
    default host key type
    to authenticate the HA peers (before an encrypted session is established between them). You can change the default host key type; the choices are ECDSA 256, 384, or 521, or RSA 2048, 3072, or 4096. Change the default host key type if you prefer a longer RSA key length or if you prefer ECDSA rather than RSA. This example sets the default host key type to an ECDSA key of 256 bits. It also re-establishes the HA1 connection using the new host key without restarting the HA peers.
    1. admin@PA-3250>
      configure
    2. admin@PA-3250#
      set deviceconfig system ssh default-hostkey ha key-type ECDSA key-length 256
    3. admin@PA-3250#
      commit
    4. admin@PA-3250#
      exit
    5. admin@PA-3250>
      request high-availability sync-to-remote ssh-key
      An HA connection must already be established between the HA firewalls. If the firewalls have not yet established an HA connection, you must enable encryption on the control link connection, export the HA key to a network location and import the HA key on the peer. See Configure Active/Passive HA or Configure Active/Active HA.
    6. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    7. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the two HA peers. (Using the
      force
      option when an HA1 backup is configured has no effect.)
    8. admin@PA-3250>
      configure
    9. admin@PA-3250#
      show deviceconfig system ssh default-hostkey
  • Establish when automatic rekeying of the session keys occurs for SSH over the HA1 control link by setting parameters.
    The session keys are used for encrypting the traffic between the HA peers. After any one rekeying parameter reaches its configured value, SSH uses the new session encryption keys. The parameters are data, interval (seconds), and packet count. If you set more than one parameter, rekeying occurs when the first parameter reaches its configured value and then the firewall resets all rekeying parameters. You can set a second or third parameter if you aren’t sure that one parameter you configured will reach its specified value as soon as you want rekeying to occur.
    1. admin@PA-3250>
      configure
    2. admin@PA-3250#
      set deviceconfig system ssh session-rekey ha data 32
      Rekeying occurs after the volume of data (in megabytes) is transmitted following the previous rekeying. The default is based on the type of cipher you use and ranges from 1GB to 4GB; the range is 10MB to 4,000MB. Alternatively, you can use the
      set deviceconfig system ssh session-rekey ha data default
      command, which sets the data parameter to the default value of the individual cipher you are using.
      If you are configuring the HA1 control link with encryption in FIPS-CC mode, you must set a data value (you cannot let it default) and the value must be no greater than 1000MB.
    3. admin@PA-3250#
      set deviceconfig system ssh session-rekey ha interval 3600
      Rekeying occurs after the specified time interval (in seconds) passes following the previous rekeying. By default, time-based rekeying is disabled (set to
      none
      ); the range is 10 to 3,600.
      If you are configuring the HA1 control link with encryption in FIPS-CC mode, you must set a time interval within the range; you cannot leave it disabled.
    4. admin@PA-3250#
      set deviceconfig system ssh session-rekey ha packets 27
      Rekeying occurs after the defined number of packets (2
      n
      ) are transmitted following the previous rekeying. Enter the exponent to which 2 is raised; for example, 14 configures that a maximum of 2
      14
      packets are transmitted before a rekeying occurs. The default is 2
      28
      ; the range is 12 to 27 (2
      12
      to 2
      27
      ). Alternatively, you can use the
      set deviceconfig system ssh session-rekey ha packets default
      command, which sets the value to 2
      28
      .
      Choose rekeying parameters based on your type of traffic and network speeds (in addition to FIPS-CC requirements if they apply to you). Don’t set the parameters so low that they affect SSH performance.
    5. admin@PA-3250#
      commit
    6. admin@PA-3250#
      exit
    7. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    8. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the two HA peers. (Using the
      force
      option when an HA1 backup is configured has no effect.)
    9. admin@PA-3250>
      configure
    10. admin@PA-3250#
      show deviceconfig system ssh session-rekey ha
  • (
    Optional
    ) Set the SSH server to use the specified encryption ciphers for the HA1 sessions.
    HA1 SSH allows all supported ciphers by default. When you set one or more ciphers, the SSH server advertises only those ciphers while connecting, and if the SSH client (HA peer) tries to connect using a different cipher, the server terminates the connection.
    1. admin@PA-3250>
      configure
    2. admin@PA-3250#
      set deviceconfig system ssh ciphers ha
      cipher
      aes128-cbc
      —AES 128-bit cipher with Cipher Block Chaining
      aes128-ctr
      —AES 128-bit cipher with Counter Mode
      aes128-gcm
      —AES 128-bit cipher with GCM (Galois/Counter Mode)
      aes192-cbc
      —AES 192-bit cipher with Cipher Block Chaining
      aes192-ctr
      —AES 192-bit cipher with Counter Mode
      aes256-cbc
      —AES 256-bit cipher with Cipher Block Chaining
      aes256-ctr
      —AES 256-bit cipher with Counter Mode
      aes256-gcm
      —AES 256-bit cipher with GCM
    3. admin@PA-3250#
      commit
    4. admin@PA-3250#
      exit
    5. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    6. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the HA peers. (Using the
      force
      option when an HA1 backup is configured has no effect.)
    7. admin@PA-3250>
      configure
    8. admin@PA-3250#
      show deviceconfig system ssh ciphers ha
  • (
    Optional
    ) Delete a cipher from the set of ciphers you selected for SSH over the HA1 control link.
    This example deletes the AES CBC cipher with 128-bit key.
    1. admin@PA-3250PA-3250>
      configure
    2. admin@PA-3250PA-3250#
      delete deviceconfig system ssh ciphers ha aes128-cbc
    3. admin@PA-3250#
      commit
    4. admin@PA-3250#
      exit
    5. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    6. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the two HA peers. (Using the
      force
      option when an HA1 backup is configured has no effect.
    7. admin@PA-3250>
      configure
    8. admin@PA-3250#
      show deviceconfig system ssh ciphers ha
  • (
    Optional
    ) Set the session key exchange algorithm for HA1 SSH.
    By default, the SSH server (HA firewall) advertises all the key exchange algorithms to the SSH client (HA peer firewall).
    If you are using an ECDSA default key type, the best practice is to use an ECDH key algorithm.
    1. admin@PA-3250>
      configure
    2. admin@PA-3250#
      set deviceconfig system ssh kex ha
      value
      diffie-hellman-group14-sha1
      —Diffie-Hellman group 14 with SHA1 hash
      ecdh-sha2-nistp256
      —Elliptic-Curve Diffie-Hellman over National Institute of Standards and Technology (NIST) P-256 with SHA2-256 hash
      ecdh-sha2-nistp384
      —Elliptic-Curve Diffie-Hellman over NIST P-384 with SHA2-384 hash
      ecdh-sha2-nistp521
      —Elliptic-Curve Diffie-Hellman over NIST P-521 with SHA2-521 hash
    3. admin@PA-3250#
      commit
    4. admin@PA-3250#
      exit
    5. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    6. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the two HA peers. (Using the
      force
      option when an HA1 backup is configured has no effect.
  • (
    Optional
    ) Set the message authentication code (MAC) for HA1 SSH.
    By default, the server advertises all of the MAC algorithms to the client.
    1. admin@PA-3250>
      configure
    2. admin@PA-3250#
      set deviceconfig system ssh mac ha
      value
      hmac-sha1
      —MAC with SHA1 cryptographic hash
      hmac-sha2-256
      —MAC with SHA2-256 cryptographic hash
      hmac-sha2-512
      —MAC with SHA2-512 cryptographic hash
    3. admin@PA-3250#
      commit
    4. admin@PA-3250#
      exit
    5. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    6. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the two HA peers. (Using the
      force
      option has no effect when an HA1 backup is configured
  • Regenerate ECDSA or RSA host keys for HA1 SSH to replace the existing keys, and re-establish HA1 sessions between HA peers using the new keys without restarting the HA peers.
    The HA peers use the host keys to authenticate each other. This example regenerates the ECDSA 256 default host key.
    Regenerating a host key does not change your default host key type. To regenerate the default host key you are using, you must specify your default host key type and length when you regenerate. Regenerating a host key that isn’t your default host key type simply regenerates a key that you aren’t using and therefore has no effect.
    1. admin@PA-3250>
      configure
    2. admin@PA-3250#
      set deviceconfig system ssh regenerate-hostkeys ha key-type ECDSA key-length 256
    3. admin@PA-3250#
      commit
    4. admin@PA-3250#
      exit
    5. admin@PA-3250>
      request high-availability sync-to-remote ssh-key
      An HA connection must already be established between the HA firewalls. If the firewalls have not yet established an HA connection, you must enable encryption on the control link connection, export the HA key to a network location, and import the HA key on the peer. See Configure Active/Passive HA or Configure Active/Active HA.
    6. (
      HA1 Backup is configured
      ) admin@PA-3250>
      request high-availability session-reestablish
    7. (
      No HA1 Backup is configured or HA1 Backup link is down
      ) admin@PA-3250>
      request high-availability session-reestablish force
      You can force the firewall to reestablish HA1 sessions if there is no HA1 backup, which causes a brief split-brain condition between the two HA peers. (Using the
      force
      option when an HA1 backup is configured has no effect.)

Recommended For You