def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\java.exe"),
            any(
                [
                    event.deep_get("Image", default="").endswith("\\bash.exe"),
                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                    event.deep_get("Image", default="").endswith("\\powershell.exe"),
                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                ]
            ),
            not all(
                [
                    "build" in event.deep_get("ParentImage", default=""),
                    "build" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
