import ipaddress


def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4624,
            event.deep_get("LogonType", default="") == 10,
            not any(
                [
                    any(
                        [
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("::1/128"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("10.0.0.0/8"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("127.0.0.0/8"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("172.16.0.0/12"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("192.168.0.0/16"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("169.254.0.0/16"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("fc00::/7"),
                            ipaddress.ip_address(event.deep_get("IpAddress", default=""))
                            in ipaddress.ip_network("fe80::/10"),
                        ]
                    ),
                    event.deep_get("IpAddress", default="") == "-",
                ]
            ),
        ]
    ):
        return True
    return False
