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

How to recursively scan all *.yaml files #103

Open
huornlmj opened this issue Jul 9, 2020 · 1 comment · May be fixed by #106
Open

How to recursively scan all *.yaml files #103

huornlmj opened this issue Jul 9, 2020 · 1 comment · May be fixed by #106

Comments

@huornlmj
Copy link

huornlmj commented Jul 9, 2020

I don't see a recursive option to go automatically search all *.yaml files in the current dir and sub dirs. I've also tried xargs but for some reason find . -name "*.yaml" | xargs kubesec scan is only returning this output, which is not correct because I get a proper report if I manually specify any one of the files that exist:

[
  {
    "object": "Unknown",
    "valid": false,
    "message": "This resource is invalid, Kubernetes kind not found",
    "score": 0,
    "scoring": {}
  },
  {
    "object": "Network/flannel.default",
    "valid": false,
    "message": "This resource is invalid, unknown schema",
    "score": 0,
    "scoring": {}
  }
]
@06kellyjac
Copy link
Member

That'd be a nice feature.

If you want to use find you'd be better off using -exec than piping into xargs: find . -name '*.yaml' -exec kubesec scan {} \;

If you have --- at the top of all your yaml you could also do cat *.yaml | kubesec scan /dev/stdin

@06kellyjac 06kellyjac linked a pull request Sep 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants