import re


def rule(event):
    if any(
        [
            all(
                [
                    event.deep_get("EventID", default="") in [4625, 4624],
                    event.deep_get("LogonType", default="") == 3,
                    event.deep_get("AuthenticationPackageName", default="") == "NTLM",
                    re.match(r"^[A-Za-z0-9]{16}$", event.deep_get("WorkstationName", default="")),
                ]
            ),
            all(
                [
                    event.deep_get("EventID", default="") == 4776,
                    re.match(r"^[A-Za-z0-9]{16}$", event.deep_get("Workstation", default="")),
                ]
            ),
        ]
    ):
        return True
    return False
