import re


def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("/openssl"),
            re.match(
                r"[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}",
                event.deep_get("CommandLine", default=""),
            ),
            "s_client" in event.deep_get("CommandLine", default=""),
            "-quiet" in event.deep_get("CommandLine", default=""),
            "-connect" in event.deep_get("CommandLine", default=""),
            any(
                [
                    ":443" in event.deep_get("CommandLine", default=""),
                    ":8080" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
