Manual Chapter :
SSH Proxy Security
Applies To:
Show VersionsBIG-IP AFM
- 14.1.3, 14.1.2, 14.1.0
SSH Proxy Security
Securing SSH traffic with the SSH Proxy
Why use SSH proxy?
Network attacks are increasingly less visible, cloaked in SSL and SSH
channels. The SSH Proxy lets network administrators centrally manage the different uses of SSH,
determining who can do what on which servers. Additionally, as the feature is a full proxy,
terminating both the client and server sides of the connection, it is possible to inspect
traffic before passing it on. This prevents attackers from hiding their activities while still
providing legitimate users with secure communications.
Challenges and problems that SSH proxy addresses
- Gives administrators visibility into user command activity in the SSH channel
- Provides fine-grained control of SSH access commands on a per-user basis
- Allows segmentation of access control for different users, allowing, for example, one user to download (but not upload) with SCP, while another user can upload and download with SCP allowing SHELL access only to an administrator, and other examples
- Control over SSH keep-alives that keep a session open indefinitely
Features of SSH Proxy
- Policy based SSH control capability
- Fine-grained control of SSH access on a per-user basis
- Visibility and control of SSH connection
- By controlling the SSH commands and session, the datacenter administrator can prevent advanced attacks from compromising the datacenter
Current limits of SSH Proxy
- Supports SSH version 2.0 or above only
- SSH proxy is supported on a virtual server, not on a route domain or global context
- SSH proxy auth key size is limited to 4K
- Elliptical Curve cypher (ECDHE) SSH keys are not supported for authentication
Using SSH Proxy
You can use an SSH Proxy to secure SSH traffic on a virtual server, on a per-user basis. A
working SSH proxy implementation requires
- An SSH proxy profile that defines actions for SSH channel commands
- A virtual server for the SSH server, configured for SSH traffic, and including the SSH proxy profile
- Authentication information for the SSH proxy
SSH proxy permissions
In an SSH proxy profile, you can configure whether to Allow,
Disallow, or Terminate SSH proxy permissions. Non-default action rules include an Unspecified
option, which means use the Default Action. You can also choose to log the rule
actions.
Channel action | Description |
---|---|
Shell | Defines use of the shell command to establish an
interactive terminal (command line) session, or shell, on the remote host. It
determines whether the SSH proxy allows establishing interactive sessions.Note that
Shell depends on Other. If Other is disabled, users cannot obtain Shell
access. |
Sub System | Defines the use of the subsystem command, to invoke remote
commands that are defined on the server over the SSH tunnel. It allows SSH servers to
be configured to abstract certain commands and procedures. |
SFTP Up | Defines the use of Secure File Transfer Protocol ( sftp ) to upload (put ) files over the SSH tunnel. |
SFTP Down | Defines the use of Secure File Transfer Protocol ( sftp ) to download (get ) files over the SSH tunnel. |
SCP Up | Defines the use of Secure Copy ( scp ) to copy files from a local directory to a remote directory over the SSH tunnel. |
SCP Down | Defines the use of Secure Copy ( scp ) to copy files from a remote directory to a local directory over the SSH tunnel. |
Rexec | Defines the use of rexec remote execution commands over
the SSH tunnel. SSH can be configured to deny interactive sessions, while allowing
specific commands to execute on the remote host. |
Forward Local | Defines the use of the -L to do local port forwarding over
the SSH tunnel. That way, SSH can be used to set up an encrypted tunnel to a remote
host. |
Forward Remote | Defines the use of the -R to do remote port forwarding over
the SSH tunnel. That way, SSH can be used to set up an encrypted tunnel from a remote
host. |
Forward X11 | Defines the use of X11 forwarding over the SSH tunnel. |
Agent | Defines the use of ssh-agent over the SSH tunnel. Agent
forwarding specifies that the chain of SSH connections forwards key challenges back to
the original agent, removing the need for passwords or private keys on intermediate
machines. |
Other | Provides a catch-all category. Any channel type not
handled by another permission is handled here. If set to Disallow or Terminate, the
following channel types are also affected (Disallowed or Terminated): Shell, Agent,
X11, Local port forwarding, and Remote port forwarding.The Lang Env Tolerance setting
only takes effect when Other is set to Disallow or Terminate. |
Proxying SSH traffic with an SSH Proxy profile
Configure an SSH proxy security profile to allow or deny SSH channel actions to
specific users on a virtual server.
- On the Main tab, click.The Protocol Security: Security Profiles: SSH Proxy screen opens.
- ClickCreate.The New SSH Profile screen opens.
- In theProfile Namefield, type a unique name for the profile.
- From theLang Env Tolerancelist, select which connections with LANG environment variables set are allowed to pass through if the SSH Proxy profile has theOtherchannel type permission (in the SSH Proxy Permissions rules) set toDisalloworTerminate.AnyAllows connections with any LANG environment value set.CommonAllows only connections with the LANG environment value set toen_US.UTF-8to pass through the Other restrictions.NoneDisallows all connections with the LANG environment variable set.
- In theTimeoutfield, specify the idle timeout, in seconds, to maintain an SSH session if there is no activity.A setting of0means that the SSH session never times out.
- Edit an existing rule, or add a new rule.
- To edit an existing rule, click the name of the rule. For example, clickDefault Actionsto edit the default rule for a profile.
- To add a new rule, clickAdd New Rule. A new line is added to the list of rules. Add a name to the rule to begin editing.
- In the Users column, in theadd new userfield, type an SSH user name to which the rule applies, then clickAdd.You cannot add users to theDefault Actionsrule.
- Configure the settings for each SSH channel action.
- To allow the session to be set up for the SSH channel action, selectAllow.
- To deny an SSH channel action, and send acommand not acceptedmessage, selectDisallow. Note that many SSH clients disconnect when this occurs.
- To terminate an SSH connection by sending a reset message when a channel action is received, selectTerminate.
In non-default rules, SSH channels have anUnspecifiedoption, which means that for a specific user, if all the rules' actions (except default actions) are unspecified, then use theDefault Actionrule. - To enable logging for an SSH action, select theLogcheck box.Before events are logged, you need to set up a log publisher and logging profile.
- When you finish editing
- An existing rule, clickDone Editing.
- A new rule, clickAdd Rule.
- When you are finished adding and editing rules, clickCommit Changes to System.
The SSH proxy profile is saved to the system.
To use an SSH proxy profile with a virtual server,
attach the profile to a virtual server.
Creating an SSH virtual server with SSH proxy security
Create an SSH virtual server to protect SSH connections with the SSH proxy.
- On the Main tab, click.The Virtual Server List screen opens.
- ClickCreate.The New Virtual Server screen opens.
- In theNamefield, type a unique name for the virtual server.
- For theDestination Address/Masksetting, confirm that theHostbutton is selected, and type the IP address in CIDR format.The supported format is address/prefix, where the prefix length is in bits. For example, an IPv4 address/prefix is10.0.0.1or10.0.0.0/24, and an IPv6 address/prefix isffe1::0020/64or2001:ed8:77b5:2:10:10:100:42/64. When you use an IPv4 address without specifying a prefix, the BIG-IP system automatically uses a/32prefix.The IP address you type must be available and not in the loopback network.
- In theService Portfield, type22or selectSSHfrom the list.
- From theSSH Proxy Profilelist, select the SSH proxy profile to attach to the virtual server.
- For theDefault Poolsetting, either select an existing pool from the list, or click the Create (+) button and create a new pool.The pool you create or select should contain your backend SSH server.
- ClickFinished.
The SSH virtual server appears in the Virtual Servers list.
Attaching an SSH
proxy security profile to an existing virtual server
You can add SSH proxy security to your SSH virtual server with SSH
proxy profile.
- On the Main tab, click.The Virtual Server List screen opens.
- In theNamecolumn, click an SSH virtual server.The Properties screen for the virtual server opens.
- From theSSH Proxy Profilelist, select the SSH proxy profile to attach to the virtual server.
- ClickUpdateto save the changes.
You now have a virtual server configured so that the SSH proxy profile rules are
applied to SSH traffic.
Authenticating SSH proxy traffic
What SSH authentication methods are supported?
SSH security supports public
key authentication, password authentication, and keyboard-interactive authentication. Keyboard-interactive
authentication
Keyboard-interactive authentication is a more complex form of password
authentication, aimed specifically at the human operator as a client. During keyboard
authentication prompts or questions are presented to the user. The user answers each prompt or
question. The number and contents of the questions are virtually unlimited, so certain types of
automated logins are also possible.
SSH client components support keyboard authentication via the
OnAuthenticationKeyboard
event. The client
application should fill in the Responses
parameter of the mentioned event with replies to questions contained in
the Prompts
parameter. Use echo parameter
to specify whether the response
is displayed on the screen, or masked. The number of responses must match the number of prompts
or questions. Password
authentication
Password authentication is the simplest authentication method. The user
specifies a username and password. This authentication method requires only one set of
credentials for the user.
Public key authentication
Public key authentication requires that both the SSH client and the SSH server must implement
the security keys. With this method, each client must have a key pair generated using a
supported encryption algorithm. When authentication occurs, the client sends a public key to the
server. If the server finds the key in the list of allowed keys, the client encrypts data using
the private key and sends the packet to the server with the public key.
Defining SSH proxy password or keyboard interactive authentication
Generate public/private RSA key pairs, then
configure tunnel keys for password or keyboard interactive authentication to allow the
SSH proxy to view tunnel traffic.
- On the BIG-IP system, typessh-keygen.The system outputs:Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa):
- Hit theEnterkey to save the file.The system outputs:/root/.ssh/id_rsa already exists. Overwrite (y/n)?
- Typeyto save the file.The system prompts for a passphrase.Enter passphrase (empty for no passphrase):
- Leave the passphrase and confirm passphrase fields blank, and hitEnter.The system outputs something like the following example. The output will be different on your system:Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 08:02:33:1a:8e:45:73:c0:eb:dc:fb:da:87:c5:2c:bf root@localhost.localdomain The key's randomart image is: +--[ RSA 2048]----+ |=o=.. | |+*.o | |o.... | | .. . . | | o . .oS | | o . . + | | . = | | ... o | | .oo.E. | +-----------------+
- Copy the key fromid_rsaincluding the-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY-----headers and footers.This is your private key, which you will add to the SSH proxy configuration.
- On the Main tab, click.The Protocol Security: Security Profiles: SSH Proxy screen opens.
- Click the name of the SSH proxy profile to edit.The SSH Profile screen opens.
- Click theKey Managementtab.
- ClickAdd New Auth Info.
- In theEnter Auth Info Namefield, type a name for the authentication info settings.
- In theReal Server Auth Public Keyfield, paste the Host public key from your backend server.Make sure not to include the trailing comment.The Real Server Auth key must not be commented out in your SSHD configuration. To make sure, on your backend SSH server, locate the file/etc/ssh/sshd_config, and make sure the lineHostKey /etc/ssh/ssh_host_rsa_keyis not commented out.
- In theProxy Server Auth Private Keyfield, add the private key that was generated on the BIG-IP system.Include the-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY-----headers and footers.Leave theProxy Server Auth Public Keyfield blank because the SSH proxy generates the public key from the private key.
- ClickAdd.
- When you are finished adding and editing rules, clickCommit Changes to System.
The SSH proxy profile is saved to the system.
To use an SSH proxy profile with a virtual server,
attach the profile to a virtual server.
Defining SSH proxy
public key authentication
Before you can define public key authentication in the SSH proxy configuration, you
need to have password or keyboard authentication and the Real Server Auth Public Key
configured.
Generate a public/private key pair, then configure
tunnel keys for public key authentication to allow the SSH proxy to view tunnel traffic.
Start on the BIG-IP system, then continue the task on the SSH client system.
- On the BIG-IP system command line, typessh-keygen.The system outputs:Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa):
- Hit theEnterkey to save the file.The system outputs:/root/.ssh/id_rsa already exists. Overwrite (y/n)?
- Typeyto save the file.The system prompts for a passphrase.Enter passphrase (empty for no passphrase):
- Leave the passphrase and confirm passphrase fields blank, and hitEnter.The system outputs something like the following example. (The output will be different on your system.)Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 08:02:33:1a:8e:45:73:c0:eb:dc:fb:da:87:c5:2c:bf root@localhost.localdomain The key's randomart image is: +--[ RSA 2048]----+ |=o=.. | |+*.o | |o.... | | .. . . | | o . .oS | | o . . + | | . = | | ... o | | .oo.E. | +-----------------+
- Copy the key fromid_rsa.This is your private key, which you will add to the SSH proxy configuration.
- On the Main tab, click.The Protocol Security: Security Profiles: SSH Proxy screen opens.
- Click the name of the SSH proxy profile to edit.The SSH Profile screen opens.
- Click theKey Managementtab.
- ClickAdd New Auth Info.
- In theEnter Auth Info Namefield, type a name for the authentication info settings.
- In theProxy Client Auth Private Keyfield, paste the private key you have generated. For private keys, the-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY-----headers/footers are required.Proxy Client Auth Public Keyis an optional field that can be left blank because it is derived from the configured private keys.
- ClickAdd.
- ClickCommit Changes to System.
- Next, log in to the SSH client system.
- On the SSH client system, generate a private/public key pair with the commandssh-keygen.The system outputs:Generating public/private rsa key pair. Enter file in which to save the key (/home/user1/.ssh/id_rsa):
- ClickEnteror specify a different file location.
- Type and confirm a passphrase when prompted, or leave the fields blank to specify no passphrase.The system outputs something like the following example. This output will be different on your system:Your identification has been saved in /home/user1/.ssh/id_rsa. Your public key has been saved in /home/user1/.ssh/id_rsa.pub. The key fingerprint is: 25:26:7e:49:56:61:71:ca:23:ec:d1:49:6b:49:61:6b user1@Ubuntu-VM1 The key's randomart image is: +--[ RSA 2048]----+ | X+. | | . O B | | . O E | | . * O . | | . S | | . | | | | | | | +-----------------+
- On the backend SSH server, open the sshd configuration file (/etc/ssh/sshd_config) and set the public key authentication to yes as follows:PubkeyAuthentication yes
- Specify a central authorized keys file by editing the AuthorizedKeysFile line as follows:AuthorizedKeysFile %h/.ssh/authorized_keys /etc/ssh/authorized_keysYou can specify your own path and filename for the authorized keys file on the SSH server.Restart the SSH daemon on the SSH server.
- Copy the public key from the BIG-IP AFM system and paste it into the authorized keys file on the SSH server (for example,/etc/ssh/authorized_keys). On the SSH server, paste the public key using the following commands (the file location and name may differ, and the public key is an example only).user1@Ubuntu-VM3:~$ vi /etc/ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAkCmU13s2/LVfm/eJ+HGesb8WeZ3A00iNX4S6ZDa7bOwb+f jpr8rCwt4fWw8U7VwPaeqE35odBW7LhwQUXg5zL1KdxgguILVI2i/cDSkPKcaQKcUIvG+BrpYj wky4T9tTKo2br+XQ92eWMh+xrVUwY4h2crpZxdng+YV+hUbqgJ+PHO4t0ozAYpgIul5C+2MTcN zMuEYxbZqWdtNFtceAywu4CYZBwAZ3mCJbfW1wtFo6DG85tIo3LuaGXpA10jav1cC2szEo0OKT 0HUPJzYfSQiU/jHQv7Becwc9L8bOC6CxryTvx3Uq/Zf0ONQHhsyasIxg2wrVwzhbI1ctSyZgww== root@localhost.localdomain
- Copy the public key from the client to the SSH server in one of two ways:
- Copy the public key you created on the client system and paste it into the user authorized keys file (for example/.ssh/authorized_keys) using the following commands (the file location and name may differ, and the public key is an example only):user1@Ubuntu-VM3:~$ vi ~/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSMcf/wX3YZQAg+/RxbqXvXpIPVvnugCOYJm uapYIze7Etc+192CB/zakmT3pKDyHHiVP1PwpP3jr99tY95llYg3p+A8nfv7+1UcwJYlS2EfYy 8qenb3Q4Mdtzrxr0AEjU/a4WXmGYd5h/ju5yRxQUt//q09PbxsEAf0qY05Tpax7R3rGl+15tf6 AI1a+poNGidfAAS1Pqc453qIXM1cp/PnOaKKzveQWBM2IIPenVxwdyX06Tn2OYBh4Rq4qUrt38 PyiYmKOYqQ/M4hD0R6/VLvF24i936uKfvBdkZcvePLGMpswQAteFzJA0JJjbWUIfvCYFCOLiFO IATUGe9Nxl user1@Ubuntu-VM1
- Alternatively, on the client system, you can issue thessh-copy-idcommand to copy the public key generated on the client system to transparently copy it to the backend server by way of the BIG-IP system.For this to work, you need to have established a successful SSH connection from the client to the backend SSH server through the BIG-IP.ssh-copy-id -i ~/.ssh/id_rsa.pub user@<Virtual-Server-IP>For example,ssh-copy-id -i ~/.ssh/id_rsa.pub adminserver@10.2.2.140
When the SSH server is added to a pool on a virtual server, and the SSH profile is
attached to the virtual server, the client should now be able to make an SSH connection
to the SSH server using the virtual server address.
Authenticating SSH
Proxy with the server private key
This task is optional and only applies if the SSH virtual
server IP address to which you attach the SSH Proxy profile has the same IP
address as the backend SSH server. Clients connect directly to the backend SSH
server address via the SSH proxy in the middle.
- On the Main tab, click.The Protocol Security: Security Profiles: SSH Proxy screen opens.
- Click the name of the SSH proxy profile to edit, or create a new one.The SSH Profile screen opens.
- Click theKey Managementtab.
- ClickAdd New Auth Info.
- In theEdit Auth Info Namefield, type a name for the authentication info settings.
- To edit an existing rule, click the name of the rule. For example, clickDefault Actionsto edit the default rule for a profile.
- To add a new rule, clickAdd New Rule. A new line is added to the list of rules. Add a name to the rule to begin editing.
- In theReal Server Auth Public Keyfield paste the Host public key from your backend server.The real server auth key must not be commented out in your sshd configuration. To make sure, on your backend SSH server, locate the fileetc/ssh/sshd_config, and make sure the lineHostKey /etc/ssh/ssh_host_rsa_keyis not commented out.
- Get the private key from the backend SSH server.For example, on the SSH backend server, at the following prompt, the admin uses the specified command to get the SSH server private key:admin@Ubuntu-VM3:~$sudo cat /etc/ssh/ssh_host_rsa_keyThe output of this command is the private key:-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAs4kusmrz6RbkYyz/Yc0YhAXFYCw8p6FqjTLsAqzkRJEog6lq hUa8nRQhsumdVsMCbgzCMOYd7CLqrTqO/M3eqQWm16Y9EC1Mi7RsfNDnt7yJ6cMb xtv2F/Smho6H5GrGSfrTqqDnuULHJ1GK+yMOghLqNnQVSGci/6NSMk7w3y/Pslzu Lz82nZi9IL1dReen3kVbAhdB1K4VsHa0OgqSKV+mnLGNB2sq4Thj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xbeg45KD7ZkVVtiDQv fNZNssmFpfyt+5uySKYzBet0f6kAHC0wD0oNjpIe5atYLQObw4fjUw11F4c7cKqu U7TogQKBgFUu0Q5FLxaNNV1p9hNTCU+KDGN/kIe5K+8aJ08TpYhTSFSzgV2k47av xCzTcSufjcZIpjNiGuwmT+spiwoPYqP+AdXKWWcxNfC4ahBfi7ROP6xSriCkzsYv ZFhMHDfIjDAGDFmHI5v9Gcjxt+iFLdiDV9Pzv1XFDKd5yfJNfmGd -----END RSA PRIVATE KEY-----
- Paste the private key into theProxy Server Auth Private Keyfield.
- ClickAdd.
- When you are finished adding and editing rules, clickCommit Changes to System.
The SSH proxy profile is saved to the system.
To use an SSH proxy profile with a virtual server,
attach the profile to a virtual server on the Properties page, in the
Configuration (Basic)
settings.Logging SSH Proxy actions
You can use a local logging profile and Proxy to secure SSH traffic on a virtual server, on a
per-user basis. You do this by creating an SSH proxy profile and attaching it to a virtual
server. You must also provide the server public and private keys for the encrypted traffic.
Creating a publisher to send log messages to the local Syslog database
Create a publisher to specify that the BIG-IP system sends formatted log messages to
the local Syslog database, on the BIG-IP system.
- On the Main tab, click.The Log Publishers screen opens.
- ClickCreate.
- In theNamefield, type a unique, identifiable name for this publisher.
- For theDestinationssetting, select the previously created destination from theAvailablelist (which formats the logs in the Splunk format and forwards the logs to the local Syslog database) and move the destination to theSelectedlist.
- ClickFinished.
Create and
associate a logging profile for SSH proxy events
Create an SSH logging profile to specify the
events that are logged for SSH proxy. Use a unique name for the log profile, and specify
the log publisher you created for SSH Proxy events.
- On the Main tab, click.The Logging Profiles list screen opens.
- ClickCreate.The Create New Logging Profile screen opens.
- In theProfile Namefield, type a unique name for the profile.
- Select theProtocol Securitycheck box.
- In the SSH Proxy area, from thePublisherlist, select the log publisher you created.
- To log client authentication failures, forLog Client Auth Fail Event, clickEnabled.
- To log successful client authentications, forLog Client Auth Success Event, clickEnabled.
- To log partial client events, forLog Client Auth Partial Event, clickEnabled.
- To log server authentication failures, forLog Server Auth Fail Event, clickEnabled.
- To log successful server authentications, forLog Server Auth Success Event, clickEnabled.
- To log partial server events, forLog Server Auth Partial Event, clickEnabled.
- To log disallowed channel action, forLog Disallowed Channel Action, clickEnabled.
- To log allowed channel action, forLog Allowed Channel Action, clickEnabled.
- To log SSH timeouts, forLog SSH Timeout Event, clickEnabled.
- To log Non-SSH timeouts, forLog Non-SSH Timeout Event, clickEnabled.
- ClickFinishedto create the SSH logging profile.To create the SSH logging profile at the command line, create the log profile with the following command:tmsh create sec log profile <log_profile_name> ssh-proxy add { ssh-log { log-publisher <log_publisher_name> allowed-channel-action enabled disallowed-channel-action enabled ssh-timeout enabled non-ssh-traffic enabled successful-server-side-auth enabled unsuccessful-client-side-auth enabled unsuccessful-server-side-auth enabled }}
- To associate the logging profile with the SSH virtual server, click.
- Click the name of the SSH virtual server.
- From theSecuritymenu, choosePolicies.
- For theLog Profilesetting:
- Set it toEnabled.
- From theAvailablelist, move the SSH logging profile into theSelectedlist.
You can assign only one local logging profile to a virtual server, but it can have multiple remote logging profiles. - ClickUpdate.
A logging profile that includes the SSH proxy events is created and associated with the
SSH virtual server.
Example: Securing SSH traffic with the SSH Proxy
In this example, you create an SSH proxy configuration, create a virtual server for SSH
traffic, and apply the SSH proxy to the virtual server. This example contains IP addresses and
public and private keys that do not apply to your configuration, but are included for example
purposes only.
In this configuration, password or keyboard interactive authentication is used, and the SSH
proxy policy disallows SCP downloads and uploads, and terminates the tunnel connection on a REXEC
command.
Example: Proxying
SSH traffic with an SSH Proxy profile
Configure an SSH proxy security profile to allow or deny SSH channel actions to
specific users on a virtual server. In this example, the proxy profile disallows SCP
uploads and downloads, and terminates the channel on REXEC commands for the
root
user. All data entered in this screen is example data,
and may not work on your system.- On the Main tab, click.The Protocol Security: Security Profiles: SSH Proxy screen opens.
- ClickCreate.The New SSH Profile screen opens.
- In the Profile Name field, type the namessh_no_scp_terminate_rexec.
- ClickAdd New Ruleto add a rule for the profile.
- In the Enter Rule Name field, typeroot_rulesas the name for the rule.
- In the Users column, in theadd new userfield, typeroot, and clickAdd.
- From theSCP Uplist, selectDisallow.
- From theSCP Downlist, selectDisallow.
- From theREXEClist, selectTerminate.
- To enable logging for the SSH actions, select theLogcheck boxes.
- ClickAdd Rule.
- When you are finished adding and editing rules, clickCommit Changes to System.
The SSH proxy profile is saved to the system.
To use an SSH proxy profile with a virtual server, attach the profile to a virtual
server on the Properties page, in the
Configuration (Basic)
settings.Example: Defining
SSH tunnel authentication keys in an SSH Proxy profile
Working with the SSH proxy you defined earlier, add key management info to allow
authentication.
- In the same SSH proxy profile you previously created, click theKey Managementtab.
- ClickAdd New Auth Info.
- In theEdit Auth Info Namefield, typeroot_authfor the auth info name.
- In theReal Server Auth Public Keyfield paste the public key from your backend server.The real server auth key must not be commented out in your sshd configuration. To make sure, on your backend SSH server, locate the fileetc/ssh/sshd_config, and make sure the lineHostKey /etc/ssh/ssh_host_rsa_keyis not commented out.This is an example key.AAAAB3NzaC1yc2EAAAADAQABAAABAQCziS6yavPpFuRjLP9hzRiEBcVgLDynoW qNMuwCrOREkSiDqWqFRrydFCGy6Z1WwwJuDMIw5h3sIuqtOo78zd6pBabXpj0Q LUyLtGx80Oe3vInpwxvG2/YX9KaGjofkasZJ+tOqoOe5QscnUYr7Iw6CEuo2dB VIZyL/o1IyTvDfL8+yXO4vPzadmL0gvV1F56feRVsCF0HUrhWwdrQ6CpIpX6ac sY0HayrhOGPmVF4qRz7fLySHJ5XQz5IKXJRNHJEbXx2tiV1TuQlhz8gOMqMp2I iSqyKDcUTk2Oy0fPYkNAWPlifq7GplYkit85EL5UCgtHf595rqibOQJWFAAzHF
- In theProxy Server Auth Private Keyfield, add a private key.The proxy server auth private key can be a newly-generated key. The Proxy Server Auth Public Key field can be left blank, as the public key is generated from the private key by the SSH proxy.This is an example key.-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAuncfRQM+yzcJW32r9DPKCzDP6cDhHbeTUlBOERUp27De+Vax dojovwVi/tRiE/4tSbHViPF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Nh6/9b8jp4m23Bjm5qI5N5ANx9wCSkcC+bVAp7JHIrYHjWdNcDJc vtbxAW0lBPUiR86tl6/rAoGBAJqNJSH1CdmGpWAC4uG8BE1k7c5w94N8AbsCnd01 t2UE4Cm7dprAWIB3Yqkg/KemGyGoD3vbPOUgPNX7DIVb0Oa1f17CFKEE4r+rlQVq m7omqUmbN4FrGYu95NisKuIMNKpYAE6Ecb7Jk0OdzUF1Uw/bLOMWUfm2eMkiFB+L pzlTAoGAQRAi+l/GHR3W6p9ahetItzPWn2tBJQnQiuM0ZFXEct41USPL4Sok8G28 Pu0C9Gf4u+bEi3BDFZMg7N6cnUYKeQjxTNmNtwgopjrGutXOM8ieiWp8oLG0zev/ pavXWCxdecuoyLtNeyTPR/GPpBqN3c5KjKnfsoid8mK59xfhic4= -----END RSA PRIVATE KEY-----
- ClickAdd.
- When you are finished adding and editing rules, clickCommit Changes to System.
The SSH proxy profile is saved to the system.
To use an SSH proxy profile with a virtual server, attach the profile to a virtual
server on the Properties page, in the
Configuration (Basic)
settings.Example: Creating
an SSH virtual server with SSH proxy security
When you enable protocol security for an HTTP virtual server, the system scans any
incoming HTTP traffic for vulnerabilities before the traffic reaches the HTTP servers.
- On the Main tab, click.The Virtual Server List screen opens.
- ClickCreate.The New Virtual Server screen opens.
- In theNamefield, typessh_root.
- In theDestination Address/Maskfield, type the IP address in CIDR format.For example,10.1.1.20.
- In theService Portfield, type22or selectSSHfrom the list.
- From theSSH Proxy Profilelist, selectssh_no_scp_terminate_rexec.
- For theDefault Poolsetting, either select an existing pool from the list, or click the Create (+) button and create a new pool.The pool you create or select should contain your backend SSH server.
- ClickFinished.
The SSH virtual server appears in the Virtual Servers list.