def rule(event):
    if any(
        [
            all(
                [
                    event.deep_get("ResultType", default="") == 50097,
                    event.deep_get("ResultDescription", default="")
                    == "Device authentication is required",
                ]
            ),
            all(
                [
                    event.deep_get("ResultType", default="") == 50155,
                    event.deep_get("ResultDescription", default="") == "DeviceAuthenticationFailed",
                ]
            ),
            all(
                [
                    event.deep_get("ResultType", default="") == 50158,
                    event.deep_get("ResultDescription", default="")
                    == "ExternalSecurityChallenge - External security challenge was not satisfied",
                ]
            ),
        ]
    ):
        return True
    return False
