Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report more debug info in external data response #1669

Closed
1 task
binbin-li opened this issue Jul 29, 2024 · 0 comments · Fixed by #1697
Closed
1 task

Report more debug info in external data response #1669

binbin-li opened this issue Jul 29, 2024 · 0 comments · Fixed by #1697
Labels
enhancement New feature or request
Milestone

Comments

@binbin-li
Copy link
Collaborator

binbin-li commented Jul 29, 2024

What would you like to be added?

Ratify embeds the artifact reference, verifier reports and error (if exist) in the external data response.
Take below an example failure message from terminal:

Error from server (Forbidden): admission webhook "validation.gatekeeper.sh" denied the request: [ratify-constraint] Subject failed verification: ghcr.io/ratify-project/ratify/notary-image@sha256:8e3d01113285a0e4aa574da8eb9c0f112a1eb979d72f73399d7175ba3cdb1c1b

Users could only know the artifact reference from the output. If they need to look into the root cause, they have to inspect logs in terms of the provided image digest. However, it would be difficult when there are lots of logs, especially when many requests with the same image digest.

One possible improvement is to display the traceId, timestamp, error and even remediation in the error output.
Given the struct of the response Item:

	// Key is the request from the provider.
	Key string `json:"key,omitempty"`
	// Value is the response from the provider.
	Value interface{} `json:"value,omitempty"`
	// Error is the error from the provider.
	Error string `json:"error,omitempty"`
}

We can either pass additional info like traceId and timestamp in the Value or Error field.
If it's embeded in Value field, we would need to update the verifierReport schema. And to be honest, I don't think traceId and timestamp belongs to verifier result.
As for Error field, we can concatenate traceId and timestamp with original error string, which requires constraint template to parse it.

Anything else you would like to add?

No response

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@binbin-li binbin-li added enhancement New feature or request triage Needs investigation labels Jul 29, 2024
@binbin-li binbin-li changed the title Report more info in external data response Report more debug info in external data response Jul 29, 2024
@susanshi susanshi added this to the v1.4.0 milestone Aug 1, 2024
@susanshi susanshi removed the triage Needs investigation label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants