SSH Proxy enables Palo Alto Networks firewalls to decrypt and inspect SSH (Secure Shell) traffic, preventing the use of SSH for tunneling malicious applications and content. It supports both inbound and outbound SSH sessions and operates by acting as a "man-in-the-middle" (MitM), establishing separate SSH sessions with the client and the server. This allows the firewall to gain visibility into the encrypted SSH payload for security inspection.
Key Function: Decrypt SSHv2 traffic for inspection and policy enforcement.
Core Benefit: Prevents abuse of SSH for unauthorized tunneling (e.g., X11 forwarding, TCP forwarding) and allows threat inspection within the SSH channel.
Figure 1: Conceptual SSH Proxy Man-in-the-Middle Flow
Configuring SSH Proxy involves creating a Decryption policy rule and, optionally, a Decryption profile.
Objects > Decryption > Decryption Profile
.
SSH Proxy
tab, you can define controls for:
Block sessions with unsupported versions
(e.g., SSHv1, which is not supported by SSH Proxy).
Block sessions with unsupported algorithms
.
Block sessions if resources not available
.
Block sessions if a hardware security module (HSM) is unavailable
.
Policies > Decryption
.
Options
tab:
Decrypt
SSH Proxy
Policies > Decryption
, select the rule, go to the
Destination
tab, add IPs, and select
Negate
.
No Certificates Required for SSH Proxy:
Unlike SSL/TLS decryption, SSH Proxy does not require you to manage or import server/client certificates. The firewall automatically generates the SSH key pair used for the proxy functionality during its boot-up process.
SSH Proxy fundamentally breaks standard public key-based authentication.
This is a critical consideration.
Here's why:
authorized_keys
file. When SSH Proxy is active:
As a result, direct client public key authentication to the end server through an SSH Proxy setup will fail.
Figure 3: Sequence Diagram Illustrating Key-Based Authentication Impact
Policies > Decryption > (select rule) > Destination > Add IP addresses > Select "Negate" checkbox.
Implementing SSH Proxy can introduce several challenges:
show system resources follow
,
show session info
).
not captured in Decryption logs
according to some documentation. However, the outcome of policy (allow/deny of tunneled apps) will be in Traffic logs, and threat logs if signatures trigger.
When SSH connections fail or behave unexpectedly with SSH Proxy enabled, follow a systematic troubleshooting approach.
Figure 4: SSH Proxy Troubleshooting Flowchart
Monitor > Logs > Traffic
):
Monitor > Logs > Threat
):
Monitor > Logs > System
):
Monitor > Logs > Decryption
):
Use these commands via the CLI for more in-depth analysis. Access CLI via SSH or console connection.
Command | Description |
---|---|
show system info
|
Displays basic system information, uptime, PAN-OS version. |
show session all filter type ssh proxy
|
(Or similar filters) Tries to display active SSH sessions being handled by the proxy. The exact filter might vary or need
application ssh
and inspection of flags.
|
show session all filter application ssh count yes
|
Shows count of sessions for application 'ssh'. |
show session id
|
Displays detailed information for a specific session ID identified from logs or other commands. |
show counter global filter aspect ssh
|
Displays global counters related to SSH processing. (The exact 'aspect' might differ, use '?' for options). |
show counter global filter delta yes packet-filter yes
|
Show global counters that have changed, filtered by current packet capture filters (if any set). Useful for seeing specific counter changes during a test. |
show running decryption-policy
|
Displays the configured decryption policies. |
show running decryption-profile
|
Displays the configuration of a specific decryption profile. |
show system setting L7-debug
|
Shows if Layer 7 debugging is enabled (relevant for debug commands). |
show system setting ssh-proxy
|
May show specific system-level settings or status for SSH proxy (availability may vary by PAN-OS version). |
show system resources follow
|
Real-time view of CPU and memory utilization, similar to `top` in Linux. Helps identify resource exhaustion. |
show system statistics
|
General system health statistics. |
show jobs all
|
Shows status of recent jobs like commits or software updates. |
less mp-log sshd.log
|
(If available and applicable to the proxy component) Check management plane SSH daemon logs. Specific log file names may vary. |
less mp-log devsrv.log
|
Device server logs on the management plane. Might contain information related to decryption key generation or proxy service status. |
less dp-log pan_l7_proxyd.log
|
(If this specific log exists for SSH proxy) Dataplane Layer 7 proxy daemon logs. The actual log name for SSH proxy might differ; explore `dp-log` options. |
Warning: Debug commands can generate a large amount of output and consume significant CPU resources. Use them sparingly in a controlled manner, preferably during a maintenance window or under the guidance of Palo Alto Networks support. Always remember to turn off debugs after troubleshooting.
Command | Description |
---|---|
set L7-debug on severity debug
|
Enables Layer 7 debugging. Specific sub-modules for SSH might exist. (Older command, may be replaced by dataplane debugs). |
debug L7-debug
|
(Older PAN-OS) Toggles Layer 7 debugging. |
debug decryption L7-debug on
|
Enables debugging for the L7 decryption process. Check if this provides SSH Proxy details. |
debug dataplane packet-diag set filter match source
|
Sets a filter for packet diagnostics. Add
protocol 6
for TCP.
|
debug dataplane packet-diag set capture stage ?
|
Shows available capture stages (e.g., `receive`, `firewall`, `transmit`, `drop`). |
debug dataplane packet-diag set capture stage firewall file ssh_capture.pcap
|
Captures packets at the firewall stage matching the filter to a file. |
debug dataplane packet-diag set capture on
|
Starts the packet capture. |
debug dataplane packet-diag set capture off
|
Stops the packet capture. (PCAPs can be viewed in Wireshark). |
debug dataplane pool statistics
|
Shows statistics for various dataplane resource pools, which can indicate exhaustion. |
debug user-id log-all on
|
If User-ID is involved with policies applied to SSH traffic. Remember to turn off. |
debug device-server show
|
(May require specific context or role) Show debug information for device server processes. |
debug log-receiver statistics
|
(May require specific context or role) For troubleshooting log forwarding issues, if logs about SSH proxy are expected elsewhere. |
clear L7-debug
|
Clears the L7 debug settings. |
debug decryption L7-debug off
|
Turns off decryption L7 debug. |
To view the logs generated by some debug commands (especially older ones or management plane logs):
less mp-log
or
less dp-log
.
For live tailing:
tail follow yes mp-log
.
Packet captures are invaluable for understanding network interactions:
debug dataplane packet-diag
or the GUI (
Monitor > Packet Capture
) to capture traffic as it enters and exits the firewall. This helps verify NAT, routing, and what the firewall does with the packets.
Compare captures at different points to isolate where the SSH negotiation is failing or data stops flowing.
Figure 5: State Diagram of an SSH Proxied Session
For the Palo Alto Networks Certified Network Security Engineer (PCNSE) exam, understanding SSH Proxy is crucial, especially its capabilities, limitations, and configuration nuances.
does not require administrator-managed certificates
. The firewall auto-generates its proxy key. This is a frequent exam point.
Decrypt
SSH Proxy
Impact on Key-Based Authentication:
Fundamentally incompatible.
Solutions are password authentication or exclusion. This is a major gotcha.
Deny
the `ssh-tunnel` application.
Palo Alto Networks' SSH Proxy is a powerful feature for gaining visibility into encrypted SSHv2 traffic. Its primary goal is to prevent the abuse of SSH for tunneling unauthorized applications and to enable threat inspection. Configuration is relatively straightforward, involving a Decryption policy rule with the "SSH Proxy" type and an optional, but highly recommended, Decryption Profile to handle unsupported SSH versions and algorithms.
The
most significant challenge and "gotcha" is its incompatibility with public key-based authentication
due to its man-in-the-middle architecture. Administrators must plan for this, either by using password authentication for proxied sessions or by strategically excluding traffic that strictly requires key-based methods.
Troubleshooting involves checking firewall logs (Traffic, Threat, System), using CLI `show` commands for status and statistics, and cautiously employing `debug` commands for deeper insights. Understanding the packet flow and the distinct roles of the `ssh` application versus the `ssh-tunnel` application is vital for effective policy enforcement. While SSH Proxy enhances security by decrypting and inspecting SSH, awareness of its limitations, such as the impact on key-based logins and QoS, is crucial for successful deployment and for PCNSE exam preparedness.