Shopify / kubeaudit

kubeaudit helps you audit your Kubernetes clusters against common security controls
MIT License
1.89k stars 183 forks source link

github action for kubeaudit to generate sarif results #462

Open dani-santos-code opened 2 years ago

dani-santos-code commented 2 years ago
ISSUE TYPE
SUMMARY

the idea here is to offer open source users the convenience of uploading a sarif result as a step in their github action Some ideas for this suggested by @thepwagner:

Make Shopify/kubeaudit an action

We add a action.yml file to the Shopify/kubeaudit, turning it into either a Docker container action or composite action.

This would mean users enable it like:

- uses: actions/checkout@v3

- uses: Shopify/kubeaudit@v0.19.0
- uses: Shopify/kubeaudit@v0.20.0 # or a different version

- uses: github/codeql-action/upload-sarif@v2

Depending on the implementation, it can result in compiling the kubeaudit binary each run (and be slow).

Make a Shopify/kubeaudit-action action

This is a common pattern when an action is wrapping a tool with its own release process, that doesn't want to pollute the original tool by Actions-izing it. https://github.com/golangci/golangci-lint-action is a good example.

TypeScript is pretty dope for building actions that do this:

This would mean users enable like:

- uses: actions/checkout@v3

- uses: Shopify/kubeaudit-action@v1.0.0
  with:
    version: v0.19.0
- uses: Shopify/kubeaudit-action@v1.0.0
  with:
    version: v0.20.0

- uses: github/codeql-action/upload-sarif@v2

Since TypeScript runs without container overhead, and this pattern downloads pre-compiled binaries I think this would have the fastest runtimes.

FEATURE IDEA

Proposal:

1 This is the quickest way to get a new feature! We reserve the right to close feature requests, even ones we like, if the proposer does not intend to contribute to the feature and it doesn't fit in our current roadmap.

thepwagner commented 2 years ago

This could also just be documentation: we can write a sample workflow that fetches kubeaudit via curl and invokes it via bash.

Wrapping the functionality as an Action(TM) is just an added convenience.