def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("/ssh"),
            any(
                [
                    "ProxyCommand=;" in event.deep_get("CommandLine", default=""),
                    "permitlocalcommand=yes" in event.deep_get("CommandLine", default=""),
                    "localhost" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "/bin/bash" in event.deep_get("CommandLine", default=""),
                    "/bin/dash" in event.deep_get("CommandLine", default=""),
                    "/bin/fish" in event.deep_get("CommandLine", default=""),
                    "/bin/sh" in event.deep_get("CommandLine", default=""),
                    "/bin/zsh" in event.deep_get("CommandLine", default=""),
                    "sh 0<&2 1>&2" in event.deep_get("CommandLine", default=""),
                    "sh 1>&2 0<&2" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
