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

rekor-cli: intersection vs union search #849

Closed
di opened this issue May 31, 2022 · 0 comments
Closed

rekor-cli: intersection vs union search #849

di opened this issue May 31, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@di
Copy link
Member

di commented May 31, 2022

Description

Currently if I provide multiple search flags to rekor-cli search, I get the union of results with those individual terms (without duplicates removed):

$ rekor-cli search --sha `sha256sum hi.txt`
Found matching entries (listed by UUID):
5dbf6d1b87e46f0bdf218c42befffd9a77dc678fc6868ee63f97db6145db4625

$ rekor-cli search --email di@python.org
Found matching entries (listed by UUID):
5dbf6d1b87e46f0bdf218c42befffd9a77dc678fc6868ee63f97db6145db4625
00f1e767aea63eeec6f01005c7a9a6b0eb578a77ebc6a0dc3f4798a172d7562b
3c2ebb9e75bf89efeb52e2a465ad57c0f93f4d86c2aca63f42a1d2f34a835226
89473f4630b65edef4927dc5f02f8e810325455087297d8d1dec8998127f2420
19700e194c143e7aedb379004330f7636fa76afff4f59fcea2ed762412299ab7

$ rekor-cli search --sha `sha256sum hi.txt` --email di@python.org
Found matching entries (listed by UUID):
5dbf6d1b87e46f0bdf218c42befffd9a77dc678fc6868ee63f97db6145db4625
5dbf6d1b87e46f0bdf218c42befffd9a77dc678fc6868ee63f97db6145db4625
00f1e767aea63eeec6f01005c7a9a6b0eb578a77ebc6a0dc3f4798a172d7562b
3c2ebb9e75bf89efeb52e2a465ad57c0f93f4d86c2aca63f42a1d2f34a835226
89473f4630b65edef4927dc5f02f8e810325455087297d8d1dec8998127f2420
19700e194c143e7aedb379004330f7636fa76afff4f59fcea2ed762412299ab7

It'd be helpful to be able to provide a flag which switches this from the implicit OR to an explicit AND operator, something like:

$ rekor-cli search --operator AND --sha `sha256sum hi.txt` --email di@python.org
Found matching entries (listed by UUID):
5dbf6d1b87e46f0bdf218c42befffd9a77dc678fc6868ee63f97db6145db4625

As a workaround for now, folks can do something like:

$ comm -12 <(rekor-cli search --sha `sha256sum hi.txt` | sort) <(rekor-cli search --email di@python.org | sort)
Found matching entries (listed by UUID):
Found matching entries (listed by UUID):
5dbf6d1b87e46f0bdf218c42befffd9a77dc678fc6868ee63f97db6145db4625
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

No branches or pull requests

2 participants