def rule(event):
    if all(
        [
            event.deep_get("ParentCommandLine", default="") == "bash -i",
            any(
                [
                    any(
                        [
                            "-c import " in event.deep_get("CommandLine", default=""),
                            "base64" in event.deep_get("CommandLine", default=""),
                            "pty.spawn" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("Image", default="").endswith("whoami"),
                            event.deep_get("Image", default="").endswith("iptables"),
                            event.deep_get("Image", default="").endswith("/ncat"),
                            event.deep_get("Image", default="").endswith("/nc"),
                            event.deep_get("Image", default="").endswith("/netcat"),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
