def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("CommandLine", default="").startswith("sh -c "),
                    event.deep_get("CommandLine", default="").startswith("bash -c "),
                ]
            ),
            any(
                [
                    any(
                        [
                            "| bash " in event.deep_get("CommandLine", default=""),
                            "| sh " in event.deep_get("CommandLine", default=""),
                            "|bash " in event.deep_get("CommandLine", default=""),
                            "|sh " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("CommandLine", default="").endswith("| bash"),
                            event.deep_get("CommandLine", default="").endswith("| sh"),
                            event.deep_get("CommandLine", default="").endswith("|bash"),
                            event.deep_get("CommandLine", default="").endswith(" |sh"),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
