FORTIGATE - SAML Debug: Difference between revisions
Created page with "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' == Debug SAML Authentication == === Enable timestamped debugging === Enable timestamps before collecting any debug output to simplify correlation with client and identity provider logs. <nowiki> diagnose debug console timestamp enable diagnose debug reset diagnose debug application samld -1 diagnose debug enable </nowiki> === Disable debugging === Always disable debuggi..." |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Category:Wiki]] | |||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | |||
[[Category:Wiki]] | [[Category:Wiki]] | ||
| Line 9: | Line 12: | ||
Enable timestamps before collecting any debug output to simplify correlation with client and identity provider logs. | Enable timestamps before collecting any debug output to simplify correlation with client and identity provider logs. | ||
<nowiki> | |||
diagnose debug console timestamp enable | diagnose debug console timestamp enable | ||
diagnose debug reset | diagnose debug reset | ||
diagnose debug application samld -1 | diagnose debug application samld -1 | ||
diagnose debug enable | diagnose debug application fnbamd -1 | ||
</nowiki> | diagnose debug enable</nowiki> | ||
=== Disable debugging === | === Disable debugging === | ||
| Line 20: | Line 23: | ||
Always disable debugging after troubleshooting to avoid unnecessary CPU usage and excessive log generation. | Always disable debugging after troubleshooting to avoid unnecessary CPU usage and excessive log generation. | ||
<nowiki> | |||
diagnose debug disable | diagnose debug disable | ||
diagnose debug reset | diagnose debug reset</nowiki> | ||
</nowiki> | |||
=== | === Verify SAML daemon activity === | ||
Check that SAML daemon is actually processing authentication requests. | |||
<nowiki> | |||
diagnose sys process pidof samld | diagnose sys process pidof samld | ||
diagnose sys top</nowiki> | |||
diagnose sys top | |||
</nowiki> | |||
== SAML Runtime Information == | == SAML Runtime Information == | ||
| Line 59: | Line 39: | ||
=== Display current SAML sessions === | === Display current SAML sessions === | ||
<nowiki> | |||
diagnose vpn ssl saml-session list | diagnose vpn ssl saml-session list</nowiki> | ||
</nowiki> | |||
Example: | Example: | ||
<nowiki> | |||
Session ID : 9 | Session ID : 9 | ||
User : john.doe | User : john.doe | ||
| Line 71: | Line 50: | ||
Portal : full-access | Portal : full-access | ||
IdP : AzureAD | IdP : AzureAD | ||
Login time : 2026-07-04 09:54:13 | Login time : 2026-07-04 09:54:13</nowiki> | ||
</nowiki> | |||
=== Display authenticated users === | |||
<nowiki> | |||
diagnose firewall auth list</nowiki> | |||
=== Display session table === | |||
<nowiki> | |||
diagnose sys session list</nowiki> | |||
== SSL VPN Debugging == | == SSL VPN Debugging (SAML + non-SAML) == | ||
=== Enable SSL | === Enable SSL VPN debug === | ||
<nowiki> | |||
diagnose debug application sslvpn -1 | diagnose debug application sslvpn -1 | ||
diagnose debug enable | diagnose debug enable</nowiki> | ||
</nowiki> | |||
=== View SSL VPN sessions === | |||
<nowiki> | |||
get vpn ssl monitor</nowiki> | |||
=== | === SSL VPN configuration check === | ||
<nowiki> | |||
show vpn ssl settings</nowiki> | |||
</nowiki> | |||
== | == IPsec SAML / authentication context (important) == | ||
SAML is typically used for SSL-VPN, but in IPsec environments authentication depends on mode: | |||
== | === IPsec with username/password (FNBAMD path) === | ||
Authentication is handled by fnbamd (same as SAML group mapping logic). | |||
<nowiki> | |||
diagnose debug application fnbamd -1 | diagnose debug application fnbamd -1 | ||
diagnose debug enable | diagnose debug application ike -1 | ||
</nowiki> | diagnose debug enable</nowiki> | ||
=== IPsec tunnel negotiation debugging === | |||
<nowiki> | |||
diagnose debug application ike -1 | |||
diagnose vpn ike gateway list | |||
diagnose vpn tunnel list</nowiki> | |||
== | === Live IKE negotiation trace === | ||
<nowiki> | |||
diagnose debug console timestamp enable | |||
diagnose debug reset | |||
diagnose debug application ike -1 | |||
diagnose debug enable</nowiki> | |||
Filter by peer IP: | |||
<nowiki> | |||
diagnose vpn ike log-filter addr <peer_ip></nowiki> | |||
Stop debug: | |||
<nowiki> | |||
diagnose debug disable | |||
diagnose debug reset</nowiki> | |||
=== IPsec + SAML reality check === | |||
SAML is NOT directly used in classic IPsec tunnels. | |||
Instead: | |||
* | * SSL-VPN → SAML supported natively | ||
* | * IPsec dialup → usually LDAP/RADIUS or local users | ||
* | * IPsec + external auth → goes through fnbamd, not samld | ||
So when troubleshooting IPsec login issues, focus on: | |||
* ike daemon | |||
* fnbamd daemon | |||
* user/group mapping | |||
== Web authentication (shared backend) == | |||
<nowiki> | |||
diagnose debug application fnbamd -1 | |||
</nowiki> | diagnose debug enable</nowiki> | ||
Useful for: | |||
* | * SAML group mapping | ||
* LDAP / RADIUS fallback | |||
* user identity resolution | |||
* | |||
* | |||
== | == Certificates validation == | ||
<nowiki> | |||
show full-configuration vpn certificate local | |||
show full-configuration vpn certificate ca</nowiki> | |||
SAML | == Time synchronization (critical for SAML) == | ||
<nowiki> | |||
get system status | get system status | ||
diagnose sys ntp status</nowiki> | |||
diagnose sys ntp status | |||
</nowiki> | |||
== Packet capture (SAML / IPsec) == | |||
=== SAML / HTTPS === | |||
<nowiki> | |||
diagnose sniffer packet any "host <idp_ip>" 4 0 a</nowiki> | |||
=== IPsec IKE === | |||
<nowiki> | |||
diagnose sniffer packet any " | diagnose sniffer packet any "udp port 500 or udp port 4500" 4 0 a</nowiki> | ||
</nowiki> | |||
== Flow debugging (authentication path) == | |||
<nowiki> | |||
diagnose debug reset | diagnose debug reset | ||
diagnose debug flow filter clear | diagnose debug flow filter clear | ||
diagnose debug flow show function-name enable | diagnose debug flow show function-name enable | ||
diagnose debug flow trace start 100 | diagnose debug flow trace start 100 | ||
diagnose debug enable | diagnose debug enable</nowiki> | ||
</nowiki> | |||
Filter | Filter: | ||
<nowiki> | |||
diagnose debug flow filter addr <client_ip> | diagnose debug flow filter addr <client_ip></nowiki> | ||
</nowiki> | |||
Stop | Stop: | ||
<nowiki> | |||
diagnose debug disable | diagnose debug disable | ||
diagnose debug reset | diagnose debug reset</nowiki> | ||
</nowiki> | |||
== Common failures == | |||
=== SAML login loop === | |||
* wrong ACS URL | |||
* | * cookie blocked | ||
* time drift | |||
* wrong entity-id | |||
* | |||
* | |||
* | |||
== | === IPsec authentication fails === | ||
* wrong group mapping | |||
* fnbamd rejection | |||
* phase1 mismatch | |||
* PSK mismatch (non-SAML case) | |||
=== | === SAML works but no VPN access === | ||
* firewall policy missing | |||
* group not mapped | |||
* portal mismatch | |||
=== No debug output === | |||
* forgot enable | |||
* wrong daemon targeted | |||
* authentication not triggered | |||
== Security concepts == | |||
=== | === Assertion integrity === | ||
SAML must be signed and validated. | |||
Only trusted | === Trust chain === | ||
Only trusted IdP certificates allowed. | |||
=== Time validation === | |||
NTP drift breaks authentication. | |||
=== | |||
=== Least privilege === | === Least privilege === | ||
Map only required groups to VPN access. | |||
== Useful links == | |||
== Useful | |||
* https://docs.fortinet.com/ | * https://docs.fortinet.com/ | ||
| Line 486: | Line 235: | ||
* https://docs.fortinet.com/document/fortigate/latest/administration-guide | * https://docs.fortinet.com/document/fortigate/latest/administration-guide | ||
* https://docs.fortinet.com/document/fortigate/latest/cli-reference | * https://docs.fortinet.com/document/fortigate/latest/cli-reference | ||
* https://learn.microsoft.com/entra/identity/ | * https://learn.microsoft.com/entra/identity/ | ||
* https://wiki.oasis-open.org/security/saml | |||
---- | |||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | |||
* https://wiki.oasis-open.org/security/ | |||
---- | ---- | ||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | ||
Revision as of 06:23, 6 July 2026
Debug SAML Authentication
Enable timestamped debugging
Enable timestamps before collecting any debug output to simplify correlation with client and identity provider logs.
diagnose debug console timestamp enable diagnose debug reset diagnose debug application samld -1 diagnose debug application fnbamd -1 diagnose debug enable
Disable debugging
Always disable debugging after troubleshooting to avoid unnecessary CPU usage and excessive log generation.
diagnose debug disable diagnose debug reset
Verify SAML daemon activity
Check that SAML daemon is actually processing authentication requests.
diagnose sys process pidof samld diagnose sys top
SAML Runtime Information
Display current SAML sessions
diagnose vpn ssl saml-session list
Example:
Session ID : 9 User : john.doe Group : VPN_Users Portal : full-access IdP : AzureAD Login time : 2026-07-04 09:54:13
Display authenticated users
diagnose firewall auth list
Display session table
diagnose sys session list
SSL VPN Debugging (SAML + non-SAML)
Enable SSL VPN debug
diagnose debug application sslvpn -1 diagnose debug enable
View SSL VPN sessions
get vpn ssl monitor
SSL VPN configuration check
show vpn ssl settings
IPsec SAML / authentication context (important)
SAML is typically used for SSL-VPN, but in IPsec environments authentication depends on mode:
IPsec with username/password (FNBAMD path)
Authentication is handled by fnbamd (same as SAML group mapping logic).
diagnose debug application fnbamd -1 diagnose debug application ike -1 diagnose debug enable
IPsec tunnel negotiation debugging
diagnose debug application ike -1 diagnose vpn ike gateway list diagnose vpn tunnel list
Live IKE negotiation trace
diagnose debug console timestamp enable diagnose debug reset diagnose debug application ike -1 diagnose debug enable
Filter by peer IP:
diagnose vpn ike log-filter addr <peer_ip>
Stop debug:
diagnose debug disable diagnose debug reset
IPsec + SAML reality check
SAML is NOT directly used in classic IPsec tunnels.
Instead:
- SSL-VPN → SAML supported natively
- IPsec dialup → usually LDAP/RADIUS or local users
- IPsec + external auth → goes through fnbamd, not samld
So when troubleshooting IPsec login issues, focus on:
- ike daemon
- fnbamd daemon
- user/group mapping
Web authentication (shared backend)
diagnose debug application fnbamd -1 diagnose debug enable
Useful for:
- SAML group mapping
- LDAP / RADIUS fallback
- user identity resolution
Certificates validation
show full-configuration vpn certificate local show full-configuration vpn certificate ca
Time synchronization (critical for SAML)
get system status diagnose sys ntp status
Packet capture (SAML / IPsec)
SAML / HTTPS
diagnose sniffer packet any "host <idp_ip>" 4 0 a
IPsec IKE
diagnose sniffer packet any "udp port 500 or udp port 4500" 4 0 a
Flow debugging (authentication path)
diagnose debug reset diagnose debug flow filter clear diagnose debug flow show function-name enable diagnose debug flow trace start 100 diagnose debug enable
Filter:
diagnose debug flow filter addr <client_ip>
Stop:
diagnose debug disable diagnose debug reset
Common failures
SAML login loop
- wrong ACS URL
- cookie blocked
- time drift
- wrong entity-id
IPsec authentication fails
- wrong group mapping
- fnbamd rejection
- phase1 mismatch
- PSK mismatch (non-SAML case)
SAML works but no VPN access
- firewall policy missing
- group not mapped
- portal mismatch
No debug output
- forgot enable
- wrong daemon targeted
- authentication not triggered
Security concepts
Assertion integrity
SAML must be signed and validated.
Trust chain
Only trusted IdP certificates allowed.
Time validation
NTP drift breaks authentication.
Least privilege
Map only required groups to VPN access.
Useful links
- https://docs.fortinet.com/
- https://community.fortinet.com/
- https://docs.fortinet.com/document/fortigate/latest/administration-guide
- https://docs.fortinet.com/document/fortigate/latest/cli-reference
- https://learn.microsoft.com/entra/identity/
- https://wiki.oasis-open.org/security/saml
