Skip to content
Snippets Groups Projects
Verified Commit 533b3906 authored by Peter Bolha's avatar Peter Bolha :ok_hand_tone1:
Browse files

feat: add basic oidc check option

parent 2a82570c
No related branches found
No related tags found
1 merge request!46Extend check_saml probe
Pipeline #360346 passed
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
make a full roundtrip test for SAML based SSO make a full roundtrip test for SAML based SSO
""" """
import argparse
import base64 import base64
import hmac import hmac
import http.cookiejar
import os import os
import re
import ssl
import struct import struct
import argparse
import sys import sys
import tempfile
import time import time
import urllib.request
import urllib.error import urllib.error
import urllib.parse import urllib.parse
import ssl import urllib.request
import tempfile
import re
from html.parser import HTMLParser from html.parser import HTMLParser
import http.cookiejar
STATUS = {"OK": 0, "WARNING": 1, "CRITICAL": 2, "UNKNOWN": 3} STATUS = {"OK": 0, "WARNING": 1, "CRITICAL": 2, "UNKNOWN": 3}
...@@ -197,6 +197,11 @@ def get_args(): ...@@ -197,6 +197,11 @@ def get_args():
default="check_saml_cache", default="check_saml_cache",
help="name of the file used for the cache", help="name of the file used for the cache",
) )
parser.add_argument(
"--basic-oidc-check",
action="store_true",
help="check for presence of state and code parameters in the result",
)
return parser.parse_args() return parser.parse_args()
...@@ -508,6 +513,17 @@ class SAMLChecker: ...@@ -508,6 +513,17 @@ class SAMLChecker:
"WARNING", "WARNING",
) )
if self.args.basic_oidc_check:
mandatory_parameters = ["code=", "state="]
for param in mandatory_parameters:
if param not in response_url:
if self.args.verbose >= 3:
print(response_url)
self.finish(
f"Missing mandatory parameter '{param}' in response url.",
"CRITICAL",
)
if not self.args.skip_logout_check: if not self.args.skip_logout_check:
# test logout # test logout
logout_html, logout_url = self.initial_request(self.args.logout_url) logout_html, logout_url = self.initial_request(self.args.logout_url)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment