Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: add support for plugin index #6674

Merged
merged 26 commits into from
May 14, 2024

Conversation

knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented May 13, 2024

Description

This PR adds support for the plugin index. See #6641 for more details.

Usage

  1. Download the plugin list:
$ trivy plugin update
  1. Discover plugins available on the index:
$ trivy plugin search
NAME                 DESCRIPTION                                                  MAINTAINER           OUTPUT
aqua                 A plugin for integration with Aqua Security SaaS platform    aquasecurity
kubectl              A plugin scanning the images of a kubernetes resource        aquasecurity
referrer             A plugin for OCI referrers                                   aquasecurity           ✓
[...]
  1. Choose a plugin from the list and install it:
$ trivy plugin install referrer
  1. Use the installed plugin:
$ trivy referrer --help
  1. Keep your plugins up-to-date:
$ trivy plugin upgrade
  1. Uninstall a plugin you no longer use:
trivy plugin uninstall referrer

Schema update

This PR also adds changes to plugin.yaml.

  • Rename usage to summary for clarity
    • Trivy also recognizes usage for backward compatibility.
  • Add maintainer

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

knqyf263 added 4 commits May 10, 2024 14:53
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 self-assigned this May 13, 2024
@knqyf263 knqyf263 requested a review from DmitriyLewen May 13, 2024 04:49
@knqyf263
Copy link
Collaborator Author

@DmitriyLewen I'm still writing a developer guide, but the implementation has been completed. I would appreciate your quick feedback.

knqyf263 added 2 commits May 13, 2024 09:47
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 force-pushed the feat/plugin_index branch from 4ae9241 to a7c71fa Compare May 13, 2024 06:21
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

Also prefix log is broken:

➜  ./trivy plugin install aqua
2024/05/13 12:40:43 INFO Installing the plugin... prefix="[plugin] " src=github.com/aquasecurity/trivy-plugin-aqua

@DmitriyLewen
Copy link
Contributor

1 more thought:
perhaps we want to add information that the plugin was installed successfully?

Currently:

➜  trivy git:(feat/plugin_index) ✗ ./trivy plugin install kubectl
2024/05/13 12:57:56 INFO Installing the plugin... prefix="[plugin] " src=github.com/aquasecurity/trivy-plugin-kubectl

knqyf263 and others added 8 commits May 13, 2024 11:58
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263
Copy link
Collaborator Author

Also prefix log is broken:

Thanks. It worked at the beginning, and got broken after refactoring. Fixed in 9dbecdf

knqyf263 added 4 commits May 13, 2024 14:07
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 marked this pull request as ready for review May 13, 2024 10:51
@knqyf263 knqyf263 requested a review from DmitriyLewen May 13, 2024 10:51
@knqyf263
Copy link
Collaborator Author

perhaps we want to add information that the plugin was installed successfully?

Done
466b9f5

@knqyf263
Copy link
Collaborator Author

@DmitriyLewen I've addressed your comments and completed the developer guide. This PR is now ready for review.

knqyf263 and others added 6 commits May 14, 2024 09:55
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 requested a review from DmitriyLewen May 14, 2024 06:16
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 force-pushed the feat/plugin_index branch from 6e0163e to 7fae791 Compare May 14, 2024 07:18
@knqyf263 knqyf263 added this pull request to the merge queue May 14, 2024
Merged via the queue into aquasecurity:main with commit 26faf8f May 14, 2024
17 checks passed
@knqyf263 knqyf263 deleted the feat/plugin_index branch May 14, 2024 08:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: plugin Index
2 participants