Secure Shell (SSH) is a ubiquitous protocol for secure remote login, command execution, and file transfer. However, its encrypted nature can be exploited by malicious actors to create covert channels for command-and-control (C2) communication, data exfiltration, or tunneling other protocols, bypassing traditional security controls. Palo Alto Networks Next-Generation Firewalls (NGFWs) address this challenge with the SSH Proxy feature.
SSH Proxy in PAN-OS enables the firewall to act as a "man-in-the-middle" (MITM) for SSH sessions. It decrypts SSH traffic, allowing for inspection by App-ID and enforcement through Security policies. This capability is crucial for identifying and blocking unauthorized SSH tunneling (e.g., X11 forwarding, TCP port forwarding) and detecting applications or threats attempting to hide within SSH encryption.
When SSH Proxy is configured for specific traffic via a Decryption policy:
session
,
X11
,
forwarded-tcpip
,
direct-tcpip
), and applies Security policies.
Automatic Key Generation: The Palo Alto Networks firewall automatically generates a unique RSA key pair specifically for its SSH Proxy functionality during boot-up. This key is used when the firewall presents itself as an SSH server to the client. There is no need to manually manage or upload SSH certificates for this feature, unlike SSL Forward Proxy.
Impact on SSH Host Key Verification: Because the firewall is intercepting the SSH session, the client will see the firewall's SSH proxy host key instead of the actual server's host key. This will likely trigger a host key mismatch warning on the SSH client if the client has previously connected to the server directly. Users may need to be educated about this, or accept the new host key.
SSH Proxy functionality is available on all Palo Alto Networks PA-Series, VM-Series, and CN-Series firewalls running supported PAN-OS versions (e.g., PAN-OS 9.1, 10.0, 10.1, 10.2, 11.0 and later). Always refer to the specific PAN-OS release notes for the most current information on features and capabilities.
The Decryption Policy is the cornerstone for enabling SSH Proxy in PAN-OS. A Decryption Policy rule identifies the specific SSH traffic that the Palo Alto Networks firewall should decrypt. Key parameters for an SSH Proxy Decryption rule:
service-ssh
or a custom service object for TCP port 22. Can also use the
ssh
application if you want to ensure it's actually SSH traffic before attempting decryption, though service-based matching is common here.
Decrypt
.
SSH Proxy
. This distinguishes it from SSL/TLS decryption types in PAN-OS.
A
Decryption Profile
can be attached to an SSH Proxy Decryption rule in PAN-OS to control various parameters of the SSH handshake and protocol. This allows for granular control over the security aspects of the proxied SSH connections.
Navigate to
Objects > Decryption > Decryption Profile
in the PAN-OS GUI, add a new profile, and select the "SSH" tab.
Key settings within a Palo Alto Networks SSH Decryption Profile:
If no Decryption Profile is attached to the SSH Proxy rule, the Palo Alto Networks firewall uses default SSH proxy settings which are generally secure but may not align with specific organizational compliance requirements.
Once SSH traffic is decrypted by the Palo Alto Networks SSH Proxy, the firewall's App-ID technology inspects the decrypted flow. App-ID can identify the specific type of SSH channel being used, such as:
ssh
: Standard interactive shell sessions, SFTP, SCP.
ssh-tunnel
: Indicates generic SSH tunneling, which often encapsulates X11 forwarding, local port forwarding (
direct-tcpip
App-ID function), or remote port forwarding (
forwarded-tcpip
App-ID function). App-ID will often classify these as
ssh-tunnel
.
This identification by App-ID is crucial for creating targeted Security policies on the Palo Alto Networks firewall.
After decryption and App-ID classification by the Palo Alto Networks firewall, Security Policies are evaluated to determine whether to allow or deny the traffic. This is where the actual enforcement happens based on the identified application. For example, you might have:
ssh
application from trusted sources to specific servers.
ssh-tunnel
application network-wide or for specific user groups to prevent unauthorized tunneling.
ssh-tunnel
or other unwanted applications within the SSH flow.
Configuring SSH Proxy on a Palo Alto Networks firewall involves creating a Decryption Profile (optional but recommended), a Decryption Policy rule, and appropriate Security Policy rules. These steps are based on PAN-OS 11.0, but are generally applicable to recent PAN-OS versions.
Network > Interfaces
in the PAN-OS GUI. Ensure the interfaces that will carry the SSH traffic are configured as Virtual Wire, Layer 2, or Layer 3.
Network > Zones
. Ensure these interfaces are assigned to appropriate Security Zones.
Objects > Decryption > Decryption Profile
.
SSH-Proxy-Strict-Profile
).
Policies > Decryption
.
Decrypt-Outbound-SSH
).
trust
).
any
or specific subnets/IPs).
untrust
).
any
or specific server IPs).
service-ssh
(or a custom service object for TCP/22). You can also specify the application
ssh
here.
Decrypt
.
SSH Proxy
.
SSH-Proxy-Strict-Profile
). If no profile is selected, default PAN-OS SSH Proxy settings apply.
After SSH traffic is decrypted by the Palo Alto Networks firewall, it's subject to Security Policy. You need rules to allow legitimate SSH and block unwanted tunneling.
Policies > Security
.
Allow-SSH-App
.
ssh
. You might also add
sftp
and
scp
if you want to be explicit, though these are often identified within the base
ssh
App-ID post-decryption by the Palo Alto Networks firewall.
application-default
(recommended) or
service-ssh
.
Allow
.
ssh-tunnel
by default.
Block-SSH-Tunnel
.
ssh-tunnel
.
application-default
or
any
(as the port might not be standard if tunneled).
Deny
or
Drop
.
Configuring Exclusions for PKA systems on a Palo Alto Networks firewall:
Policies > Decryption
.
service-ssh
.
No Decrypt
.
ssh-tunnel
) is allowed by Security Policy, the traffic *within* that tunnel remains encrypted from the Palo Alto Networks firewall's perspective as it passes through. The benefit is gained by identifying and blocking the tunnel itself if unauthorized.
show running resource-monitor
CLI command) after enabling SSH Proxy.
Effective monitoring of SSH Proxy on Palo Alto Networks firewalls relies on analyzing various logs in PAN-OS:
Monitor > Logs > Traffic
):
ssh
,
sftp
,
ssh-tunnel
).
(app eq ssh) or (app eq ssh-tunnel)
and
(decrypted eq yes)
.
Monitor > Logs > Decryption
):
(proxy_type eq ssh)
.
Monitor > Logs > System
):
sshrd
daemon) itself, such as startup issues or critical errors, though less common for session-specific troubleshooting.
The PAN-OS CLI provides powerful tools for deeper inspection of SSH Proxy operations:
show session all filter application ssh destination-port 22
show session id <session_id>Look for flags indicating decryption (e.g., 'decrypted: True', 'proxy: True', 'type: PROXY'). The 'application' field will show the identified App-ID.
show counter global filter delta yes name ssh_proxy_stats
show counter global | match sshproxy(The exact counter names might vary slightly across PAN-OS versions. Use `show counter global | match ssh` to find relevant counters like `sshrd_stats`, `ssh_proxy_sess_created`, `ssh_proxy_sess_failed`). This can show proxied sessions, errors, etc.
debug dataplane packet-diag set filter match destination-port 22 source-ip <client_ip> destination-ip <server_ip> debug dataplane packet-diag set filter on debug dataplane packet-diag show settings debug dataplane packet-diag clear filter debug dataplane packet-diag clear all less mp-log Pkt_diag.logThis allows you to see packet flow through the dataplane stages. For SSH proxy, you'd see packets related to both client-to-firewall and firewall-to-server legs.
debug ssh-proxy status
less mp-log sshd.log
less mp-log sshrd.logThis can show specific errors from the SSH proxy daemon (sshrd).
Issue | Potential Palo Alto Networks Cause(s) | Troubleshooting Steps & Resolution (Palo Alto Networks Context) |
---|---|---|
SSH connections fail entirely for proxied traffic. |
- Palo Alto Networks firewall cannot connect to the backend SSH server (routing, Security Policy blocking firewall-initiated session).
- SSH Decryption Profile blocks essential algorithms/versions used by client/server. - Client attempting Public Key Authentication (PKA). |
- Check firewall's connectivity to the server (ping from firewall CLI using correct source interface, check Traffic logs for firewall-to-server leg potentially being denied by policy).
- Review Decryption logs for errors (e.g., "Unsupported cipher," "Protocol mismatch"). Adjust SSH Decryption Profile on the firewall if necessary. - Confirm client is using username/password. If PKA is required, create a "No Decrypt" rule for that specific traffic flow. |
Clients receive SSH host key warnings (e.g., "REMOTE HOST IDENTIFICATION HAS CHANGED!"). | Expected behavior: Client sees Palo Alto Networks firewall's proxy host key. |
- Educate users to accept the new key after initial setup (this is the firewall's key).
- For internal environments, advanced users could potentially add the firewall's SSH proxy public key to their `known_hosts` file, but this is rarely done for SSH proxy and requires distributing the key. |
SSH tunneling (e.g., port forwarding via `ssh-tunnel` App-ID) is still possible. |
No PAN-OS Security Policy rule to block
ssh-tunnel
, or the rule is misconfigured/misordered (e.g., an "allow any" rule is hit first).
|
- Verify a Security Policy rule exists with application
ssh-tunnel
and action
Deny
.
- Ensure this deny rule is placed correctly in the Security Policy rulebase (typically before broader allow rules for `ssh`). - Check Traffic logs to see which Security Policy rule is matching the
ssh-tunnel
traffic.
|
Legitimate SSH (interactive shell, identified as `ssh` App-ID) is blocked. |
PAN-OS Security Policy rule for
ssh
application is missing, misconfigured, or a deny rule (e.g., an overly broad `ssh-tunnel` deny, or default deny) is taking precedence.
|
- Verify a Security Policy rule allows
ssh
application for the relevant zones/IPs.
- Check Traffic logs for the specific session to see which rule is blocking it and why (e.g., "rule: default-deny"). |
High CPU utilization on the Palo Alto Networks firewall. | Large volume of SSH traffic being decrypted by SSH Proxy. |
- Monitor CPU with
show running resource-monitor
on the firewall CLI.
- Review if all SSH traffic being decrypted is necessary. Consider "No Decrypt" exclusions for high-volume, trusted internal SSH flows not requiring tunnel inspection or where PKA is used. - Evaluate firewall sizing if SSH decryption is a critical and heavy workload. Consult Palo Alto Networks performance datasheets. |
ssh
(App-ID) for developers but deny
ssh-tunnel
(App-ID) for all users except specific network administrators.
This diagram illustrates the detailed Man-in-the-Middle (MITM) process employed by the Palo Alto Networks firewall when SSH Proxy is active. It shows the two separate SSH sessions (Client-to-Firewall and Firewall-to-Server) and the points of decryption by the firewall, inspection (App-ID, Security Policy), and re-encryption for forwarding.
This decision tree outlines how Palo Alto Networks firewalls process SSH traffic. It highlights when SSH Proxy is engaged based on interface type and Decryption Policy, how different SSH client authentication methods affect the flow (especially PKA), and the subsequent roles of App-ID classification and Security Policy enforcement on the decrypted or bypassed traffic.
This diagram shows the interaction between Decryption Policies and Security Policies in PAN-OS for SSH traffic. It illustrates how traffic flows through different policy evaluation stages on a Palo Alto Networks firewall, depending on whether SSH Proxy decryption is applied. Key configuration elements like Decryption rules and Security rules for `ssh` and `ssh-tunnel` applications are shown influencing these paths.
Decrypt
and
Type =
SSH Proxy
. An optional SSH Decryption Profile can be attached to enforce cryptographic standards (e.g., block SSHv1, weak ciphers/KEX/MACs).
ssh
,
sftp
,
scp
,
ssh-tunnel
). Security Policies then enforce allow/deny actions based on these specific App-IDs. You *must* have Security Policies to block unwanted applications like
ssh-tunnel
; SSH Proxy enablement alone does not block them.