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

🐛 Issues with the --use-recording switch and cnspec mock #1297

Open
mm-weber opened this issue May 18, 2024 · 3 comments
Open

🐛 Issues with the --use-recording switch and cnspec mock #1297

mm-weber opened this issue May 18, 2024 · 3 comments

Comments

@mm-weber
Copy link
Contributor

1) the --use-recording switch depends on live provider authentication

cnspec scan k8s   -f ~/projects/cnspec-enterprise-policies/policies/amazon-eks.mql.yaml --discover clusters   --use-recording ~/projects/cnspec-enterprise-policies/certifications/eks-1.4.0/pass-k8s.json

using the online k8s provider with the --use-recording switch will work sort-of, but only with an online asset, which can be the wrong one.

Running against this EKS PASS recording when kubctl is actually talking to an AKS cluster, will lead to the correct results, but with the wrong asset

2) the --use-recording switch running against a recording that would need the --sudo switch it will fail the checks that count on it

cnspec scan mock   -f ~/projects/cnspec-enterprise-policies/policies/azure-aks.mql.yaml   --use-recording ~/projects/cnspec-enterprise-policies/certifications/aks-1.5.0/pass-node.json -o full

Desired behaviour.

  • Be able to use cnspec scan mock and --use-recording as a replacement for any other provider, e.g. cnspec scan k8s and --use-recording
  • Be able to cnspec scan mock and --use-recording without depending on a live connection to a previously scanned asset cnspec scan --record when scanning a .json file.
@benr
Copy link
Member

benr commented Sep 27, 2024

@vjeffrey @chris-rock This should be addressed as we require the functionality for our testing efforts.

@mm-weber
Copy link
Contributor Author

Linux Recordings:

cnspec scan mock -f ../../policies/cis-debian-linux-12.mql.yaml --use-recording debian-l1-pass.json -o full

Image

@mm-weber
Copy link
Contributor Author

Related to:
mondoohq/cnquery#4330

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

No branches or pull requests

3 participants