🔐 Palo Alto SSH Proxy – Configuration, Troubleshooting & PCNSE Guide

1. Overview

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

2. Configuration Steps

Configuring SSH Proxy involves creating a Decryption policy rule and, optionally, a Decryption profile.

  1. Ensure Interface Types: SSH Proxy decryption can be performed on virtual wire, Layer 2, or Layer 3 interfaces.
  2. (Optional but Recommended) Create/Modify Decryption Profile:
    • Navigate to Objects > Decryption > Decryption Profile .
    • Create a new profile or modify an existing one.
    • Under the 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 .
    • This profile allows granular control over what SSH parameters are permitted when decryption is active.
  3. Create Decryption Policy Rule:
    • Navigate to Policies > Decryption .
    • Add a new rule.
    • Define match criteria (Source, Destination, Service, etc.).
    • Under the Options tab:
      • Action: Decrypt
      • Type: SSH Proxy
      • Attach the Decryption Profile created/modified in the previous step.
  4. Commit Configuration: Save and commit the changes to apply the configuration.
  5. (Optional) Create Decryption Exclusions: Exclude specific traffic from decryption if necessary (e.g., for hosts requiring key-based authentication that cannot be altered). Navigate to 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.

3. Impact on Key-Based Authentication

SSH Proxy fundamentally breaks standard public key-based authentication. This is a critical consideration.

Here's why:

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

Solutions and Workarounds for Key-Based Authentication:

  1. Username/Password Authentication: The most common solution is to use username and password-based authentication for SSH sessions that are being proxied. The firewall will proxy these credentials.
  2. Decryption Exclusions: For specific servers or clients that must use key-based authentication and cannot switch to password authentication, exclude their traffic from SSH Proxy decryption. This means their traffic will not be inspected. Policies > Decryption > (select rule) > Destination > Add IP addresses > Select "Negate" checkbox.
  3. Jump Server/Bastion Host: Consider using a bastion host that enforces strict access controls and logging. Traffic to this bastion host could potentially be excluded from decryption if key-based auth is paramount, though this reduces visibility. Alternatively, proxy connections *to* the bastion host (if it supports password auth) and then allow key-based auth *from* the bastion host to internal servers (this segment would not be decrypted by the perimeter firewall).

4. Common Issues, Challenges, and Caveats

Implementing SSH Proxy can introduce several challenges:

Key Summary of Challenges:

5. Troubleshooting SSH Proxy

When SSH connections fail or behave unexpectedly with SSH Proxy enabled, follow a systematic troubleshooting approach.

Figure 4: SSH Proxy Troubleshooting Flowchart

5.1. Firewall Logs

5.2. CLI Troubleshooting Commands

Use these commands via the CLI for more in-depth analysis. Access CLI via SSH or console connection.

Show Commands:

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.

Debug Commands (Use with Caution):

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 destination destination-port 22 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 .

5.3. Packet Captures

Packet captures are invaluable for understanding network interactions:

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

6. PCNSE Exam Insights & Gotchas

For the Palo Alto Networks Certified Network Security Engineer (PCNSE) exam, understanding SSH Proxy is crucial, especially its capabilities, limitations, and configuration nuances.

Key Areas for PCNSE Takers:

Critical Information & Gotchas Summary:

Common PCNSE Exam Questions Themes:

7. Summary

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.

PCNSE Style Quiz: SSH Proxy

1. Which of the following is a primary reason for implementing SSH Proxy on a Palo Alto Networks firewall?

2. What is the impact of SSH Proxy on SSH public key-based authentication?

3. Which certificate is required from an administrator to configure SSH Proxy on a Palo Alto Networks firewall?

4. In a Decryption policy rule for SSH Proxy, what 'Action' and 'Type' should be selected?

5. How does the firewall handle SSH tunneling (e.g., X11 forwarding, port forwarding) when SSH Proxy is active?

6. What is a recommended best practice when configuring an SSH Proxy Decryption policy rule?

7. If an SSH client attempts to connect using an SSH algorithm not supported by the firewall's SSH Proxy, and the Decryption Profile is set to block unsupported algorithms, what is the likely outcome?

8. Which SSH version is supported for decryption by Palo Alto Networks SSH Proxy?

9. When troubleshooting a failing SSH connection that is subject to SSH Proxy, where would you typically NOT expect to find detailed logs about the SSH Proxy session itself?

10. A user reports a "host key changed" warning after SSH Proxy is implemented for connections to an internal server. This is likely because:

11. To prevent SSH port forwarding (e.g., `ssh -L 8080:localhost:80 user@server`), after SSH Proxy has decrypted the main SSH session, what is typically required?

12. Which of the following CLI commands is most useful for viewing real-time CPU and memory utilization on the firewall, which can be impacted by SSH Proxy?

13. What is a known limitation regarding Quality of Service (QoS) and SSH Proxy?

14. If SSH decryption is failing due to "unsupported parameters" and you want to identify the specific algorithm mismatch, what is a good first step?

15. Which interface types support SSH Proxy decryption?

16. A session end reason of `decrypt-unsupport-param` in logs for an SSH session likely indicates:

17. If you need to exclude specific servers from SSH Proxy decryption (e.g., because they strictly require key-based authentication), how would you configure this in the Decryption policy?

18. The SSH key used by the firewall for SSH Proxy operations is:

19. What is the primary security benefit of using SSH Proxy over simply allowing the `ssh` application in a Security policy?

20. When a firewall with SSH Proxy identifies X11 forwarding within an SSH connection, it typically classifies this as what application for Security policy enforcement?