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

added Azure repo scanning support #1012

Merged
merged 2 commits into from Jan 11, 2023
Merged

Conversation

anubhav06
Copy link
Contributor

Signed-off-by: Anubhav Gupta mail.anubhav06@gmail.com

Describe your changes

Added support for scanning remote repositories hosted on Azure

ABOUT THE CHANGES:
Updated the version of go-git, as the present version does not support cloning of Azure DevOps repos.
The new version of go-git has a temporary solution for cloning of Azure repos, as the Azure support is not fully implemented yet.

Thus, we have to provide the AZURE_TOKEN when scanning even public repos.

Screenshots

0

This PR fixes:

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas
  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • New and existing unit tests pass locally with my changes

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi! Welcome to Kubescape. Thank you for taking the time and contributing to the open source community

We will try to review as soon as possible!

@anubhav06 anubhav06 mentioned this pull request Jan 6, 2023
5 tasks
@matthyx
Copy link
Contributor

matthyx commented Jan 7, 2023

@anubhav06 I have to check why we have this CI test failing before merging... likely on Monday. Thanks for your patience...

@dwertent dwertent requested a review from matthyx January 9, 2023 08:07
@dwertent
Copy link
Contributor

dwertent commented Jan 9, 2023

@matthyx following our previous conversation regarding the need of using an AZURE_TOKEN for cloning also public repos - Since it is possible to build KS without git2lib, I think we should have fewer dependencies as possible on that library.

@matthyx
Copy link
Contributor

matthyx commented Jan 9, 2023

@anubhav06 error is:
"msg":"failed to get policies from github release, loading policies from cache","error":"error getting: attack_tracks.json from: \'[https://github.com/kubescape\\\\regolibrary\\\\releases\\\\latest\\\\download\](https://github.com/kubescape////regolibrary////releases////latest////download/)' ,error: HTTP request failed. URL: \'/kubescape%5Cregolibrary%5Creleases%5Clatest%5Cdownload/attack_tracks\', HTTP-ERROR: \'404 Not Found\',

It clearly comes from the joining of the URL but I will dig deeper tomorrow...

@matthyx
Copy link
Contributor

matthyx commented Jan 9, 2023

@anubhav06 error is: "msg":"failed to get policies from github release, loading policies from cache","error":"error getting: attack_tracks.json from: \'[https://github.com/kubescape\\\\regolibrary\\\\releases\\\\latest\\\\download\](https://github.com/kubescape////regolibrary////releases////latest////download/)' ,error: HTTP request failed. URL: \'/kubescape%5Cregolibrary%5Creleases%5Clatest%5Cdownload/attack_tracks\', HTTP-ERROR: \'404 Not Found\',

It clearly comes from the joining of the URL but I will dig deeper tomorrow...

@anubhav06 the fix is here: https://github.com/kubescape/opa-utils/releases/tag/v0.0.223

@anubhav06
Copy link
Contributor Author

anubhav06 commented Jan 10, 2023

Thank you @matthyx for helping with the error. Updating to the latest version of kubescape/opa-utils seemed to solve the issue as now when I locally run the command kubescape scan control C-0048, I don't get any error.
Should I push the changes and see if CI tests are passing ?

@matthyx
Copy link
Contributor

matthyx commented Jan 10, 2023

Thank you @matthyx for helping with the error. Updating to the latest version of kubescape/opa-utils seemed to solve the issue as now when I locally run the command kubescape scan control C-0048, I don't get any error. Should I push the changes and see if CI tests are passing ?

yes pls, they will work, I have tested that, so once you push I'll merge - thanks!

@matthyx matthyx merged commit 19438e6 into kubescape:dev Jan 11, 2023
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 this pull request may close these issues.

None yet

3 participants