def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 5145,
            event.deep_get("ShareName", default="").endswith("C$"),
            event.deep_get("AccessMask", default="") == "0x2",
            not event.deep_get("SubjectUserName", default="").endswith("$"),
            not event.deep_get("IpAddress", default="") == "::1",
        ]
    ):
        return True
    return False
