def rule(event):
    if all(
        [
            any(
                [
                    "\\Microsoft\\Protect\\S-1-5-18\\" in event.deep_get("FileName", default=""),
                    "\\Microsoft\\Protect\\S-1-5-21-" in event.deep_get("FileName", default=""),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").startswith("C:\\Program Files\\"),
                    event.deep_get("Image", default="").startswith("C:\\Program Files (x86)\\"),
                    event.deep_get("Image", default="").startswith("C:\\Windows\\system32\\"),
                    event.deep_get("Image", default="").startswith("C:\\Windows\\SysWOW64\\"),
                ]
            ),
        ]
    ):
        return True
    return False
