def rule(event):
    if all(
        [
            any(
                [
                    ".key" in event.deep_get("CommandLine", default=""),
                    ".pgp" in event.deep_get("CommandLine", default=""),
                    ".gpg" in event.deep_get("CommandLine", default=""),
                    ".ppk" in event.deep_get("CommandLine", default=""),
                    ".p12" in event.deep_get("CommandLine", default=""),
                    ".pem" in event.deep_get("CommandLine", default=""),
                    ".pfx" in event.deep_get("CommandLine", default=""),
                    ".cer" in event.deep_get("CommandLine", default=""),
                    ".p7b" in event.deep_get("CommandLine", default=""),
                    ".asc" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                                    event.deep_get("OriginalFileName", default="") == "Cmd.Exe",
                                ]
                            ),
                            "dir " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    any(
                                        [
                                            event.deep_get("Image", default="").endswith(
                                                "\\powershell.exe"
                                            ),
                                            event.deep_get("Image", default="").endswith(
                                                "\\pwsh.exe"
                                            ),
                                        ]
                                    ),
                                    event.deep_get("OriginalFileName", default="")
                                    in ["PowerShell.EXE", "pwsh.dll"],
                                ]
                            ),
                            "Get-ChildItem " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\findstr.exe"),
                            event.deep_get("OriginalFileName", default="") == "FINDSTR.EXE",
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
