def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\amazon-ssm-agent.exe"),
            "-register " in event.deep_get("CommandLine", default=""),
            "-code " in event.deep_get("CommandLine", default=""),
            "-id " in event.deep_get("CommandLine", default=""),
            "-region " in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
