def rule(event):
    if all(
        [
            event.deep_get("DestinationPort", default="") in [5985, 5986],
            event.deep_get("Initiated", default="") == "true",
            event.deep_get("SourceIsIpv6", default="") == "false",
            not any(
                [
                    any(
                        [
                            any(
                                [
                                    "NETWORK SERVICE" in event.deep_get("User", default=""),
                                    "NETZWERKDIENST" in event.deep_get("User", default=""),
                                    "SERVICIO DE RED" in event.deep_get("User", default=""),
                                    "SERVIZIO DI RETE" in event.deep_get("User", default=""),
                                ]
                            ),
                            all(
                                [
                                    "SERVICE R" in event.deep_get("User", default=""),
                                    "SEAU" in event.deep_get("User", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("SourceIp", default="") in ["::1", "127.0.0.1"],
                            event.deep_get("DestinationIp", default="") in ["::1", "127.0.0.1"],
                        ]
                    ),
                ]
            ),
            not event.deep_get("Image", default="")
            in [
                "C:\\Program Files\\Avast Software\\Avast\\AvastSvc.exe",
                "C:\\Program Files (x86)\\Avast Software\\Avast\\AvastSvc.exe",
            ],
        ]
    ):
        return True
    return False
