def rule(event):
    if all(
        [
            any(
                [
                    all(
                        [
                            "\\SYSTEM\\CurrentControlSet\\Services\\EventLog\\"
                            in event.deep_get("TargetObject", default=""),
                            event.deep_get("TargetObject", default="").endswith("\\CustomSD"),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    "\\Policies\\Microsoft\\Windows\\EventLog\\"
                                    in event.deep_get("TargetObject", default=""),
                                    "\\Microsoft\\Windows\\CurrentVersion\\WINEVT\\Channels"
                                    in event.deep_get("TargetObject", default=""),
                                ]
                            ),
                            event.deep_get("TargetObject", default="").endswith("\\ChannelAccess"),
                        ]
                    ),
                ]
            ),
            any(
                [
                    "D:(D;" in event.deep_get("Details", default=""),
                    all(
                        [
                            "D:(" in event.deep_get("Details", default=""),
                            ")(D;" in event.deep_get("Details", default=""),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="")
                    == "C:\\Windows\\servicing\\TrustedInstaller.exe",
                    all(
                        [
                            event.deep_get("Image", default="").startswith("C:\\Windows\\WinSxS\\"),
                            event.deep_get("Image", default="").endswith("\\TiWorker.exe"),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="") == "",
                    event.deep_get("Image", default="") == "",
                ]
            ),
        ]
    ):
        return True
    return False
