def rule(event):
    if all(
        [
            any(
                [
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("/apt"),
                                    event.deep_get("Image", default="").endswith("/apt-get"),
                                ]
                            ),
                            "install" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("/yum"),
                            any(
                                [
                                    "localinstall" in event.deep_get("CommandLine", default=""),
                                    "install" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("/rpm"),
                            "-i" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("/dpkg"),
                            any(
                                [
                                    "--install" in event.deep_get("CommandLine", default=""),
                                    "-i" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
            any(
                [
                    "nmap" in event.deep_get("CommandLine", default=""),
                    " nc" in event.deep_get("CommandLine", default=""),
                    "netcat" in event.deep_get("CommandLine", default=""),
                    "wireshark" in event.deep_get("CommandLine", default=""),
                    "tshark" in event.deep_get("CommandLine", default=""),
                    "openconnect" in event.deep_get("CommandLine", default=""),
                    "proxychains" in event.deep_get("CommandLine", default=""),
                    "socat" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
