def rule(event):
    if all(
        [
            any(
                [
                    "Control Panel\\Desktop" in event.deep_get("TargetObject", default=""),
                    "CurrentVersion\\Policies\\ActiveDesktop"
                    in event.deep_get("TargetObject", default=""),
                    "CurrentVersion\\Policies\\System"
                    in event.deep_get("TargetObject", default=""),
                ]
            ),
            any(
                [
                    all(
                        [
                            event.deep_get("TargetObject", default="").endswith(
                                "NoChangingWallpaper"
                            ),
                            event.deep_get("Details", default="") == "DWORD (0x00000001)",
                        ]
                    ),
                    event.deep_get("TargetObject", default="").endswith("\\Wallpaper"),
                    all(
                        [
                            event.deep_get("TargetObject", default="").endswith("\\WallpaperStyle"),
                            event.deep_get("Details", default="") == "2",
                        ]
                    ),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").endswith("\\svchost.exe"),
                    all(
                        [
                            event.deep_get("TargetObject", default="").endswith(
                                "\\Control Panel\\Desktop\\Wallpaper"
                            ),
                            event.deep_get("Details", default="") == "(Empty)",
                        ]
                    ),
                    event.deep_get("Image", default="").endswith("C:\\Windows\\Explorer.EXE"),
                ]
            ),
            not all(
                [
                    event.deep_get("Image", default="")
                    in [
                        "C:\\Program Files\\Amazon\\EC2Launch\\EC2Launch.exe",
                        "C:\\Program Files (x86)\\Amazon\\EC2Launch\\EC2Launch.exe",
                    ],
                    event.deep_get("TargetObject", default="").endswith(
                        "\\Control Panel\\Desktop\\Wallpaper"
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
