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

⭐️ github terraform discovery #4109

Merged
merged 2 commits into from
May 27, 2024
Merged

⭐️ github terraform discovery #4109

merged 2 commits into from
May 27, 2024

Conversation

imilchev
Copy link
Member

We can now do terraform discovery for github. Things to note:

  • to discover terraform, we need to discover the repo too, this means we provide 2 flags now
cnspec scan github repo mondoohq/X--discover repository,terraform 
  • we use mql to loop over the files and check for terraform files. This means we are caching the directory tree for the repo as we go. Later we can use the same approach when looking for k8s manifests and dockerifiles and can work with the cached tree
  • we are cloning the repos in the terraform provider on Connect, which means if I am currently scanning a github org, we will pull all repos with terraform files immediately on discovery... We need to change that to only clone the repos on starting the scan and not before. (delayed discovery)
  • we probably need to move the clone step to the github/gitlab providers (or to a separate git provider) when we start scanning for k8s manifests and dockerfiles we shouldn't clone the same repo multiple times for each provider

Copy link
Contributor

Test Results

3 000 tests  ±0   2 999 ✅ ±0   1m 25s ⏱️ ±0s
  331 suites ±0       1 💤 ±0 
   23 files   ±0       0 ❌ ±0 

Results for commit 0019c18. ± Comparison against base commit a49f250.

@chris-rock chris-rock requested a review from jaym May 27, 2024 18:45
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @imilchev

@chris-rock chris-rock merged commit 981a931 into main May 27, 2024
15 checks passed
@chris-rock chris-rock deleted the ivan/github-tf-discovery branch May 27, 2024 18:53
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants