Skip to content
Commits on Source (3)
# [2.2.0](https://gitlab.ics.muni.cz/perun-proxy-aai/python/perun-proxy-utils/compare/v2.1.0...v2.2.0) (2024-01-05)
### Features
* check_saml.py security text support ([36ce42d](https://gitlab.ics.muni.cz/perun-proxy-aai/python/perun-proxy-utils/commit/36ce42d33d6410944881203e18f2dc97b3943599))
# [2.1.0](https://gitlab.ics.muni.cz/perun-proxy-aai/python/perun-proxy-utils/compare/v2.0.0...v2.1.0) (2024-01-02)
......
......@@ -186,6 +186,12 @@ def get_args():
action="store_true",
help="skip security image check when remember me is used",
)
parser.add_argument(
"--security-text-check",
action="store_true",
help="perform security text check when remember me is used, "
"security image check will be automatically skipped",
)
parser.add_argument(
"--cache-timeout",
type=int,
......@@ -203,7 +209,11 @@ def get_args():
help="check for presence of state and code parameters in the result",
)
return parser.parse_args()
args = parser.parse_args()
if args.security_text_check:
args.skip_security_image_check = True
return args
def replace_host_in_url(hosts, url, headers):
......@@ -499,6 +509,15 @@ class SAMLChecker:
login_form_html, login_form_url = self.initial_request(self.args.url)
if self.args.verbose >= 3:
print(login_form_html)
if (
self.args.security_text_check
and "class='security-image-text'" not in login_form_html
):
self.finish(
"Missing security text on the login page.",
"CRITICAL",
)
if (
not self.args.skip_security_image_check
and "class='antiphishing-img'" not in login_form_html
......
[metadata]
version = 2.1.0
version = 2.2.0
license_files = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown
......