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

platform(sca): Run package scan using API #3812

Merged
merged 30 commits into from
Nov 8, 2022
Merged

platform(sca): Run package scan using API #3812

merged 30 commits into from
Nov 8, 2022

Conversation

ayajbara
Copy link
Contributor

@ayajbara ayajbara commented Nov 7, 2022

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

using POST request start sca package scanning process

Fixes # (issue)

New/Edited policies (Delete if not relevant)

Description

Include a description of what makes it a violation and any relevant external links.

Fix

How does someone fix the issue in code and/or in runtime?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ayajbara ayajbara marked this pull request as ready for review November 7, 2022 11:06
Base automatically changed from add_new_sca_package_scan to master November 7, 2022 12:34
# Conflicts:
#	checkov/sca_package_2/runner.py
#	checkov/sca_package_2/scanner.py
Copy link
Contributor

@gruebel gruebel left a comment

Choose a reason for hiding this comment

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

nice, looking forward when it is completely implemented 🚀

checkov/sca_package_2/scanner.py Show resolved Hide resolved
}

response = request_wrapper(
"POST", f"{self._base_url}/api/v1/vulnerabilities/cli/scan",
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move f"{self._base_url}/api/v1/vulnerabilities/cli/scan" to the __init__ then it can be used for the polling to0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

logging.info("Failed to run package scanning.")
return dict()

return self.poll_scan_result()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the polling should be under def scan(), just return the id here so, it can be used by poll_scan_result()

@ayajbara ayajbara merged commit d44c657 into master Nov 8, 2022
@ayajbara ayajbara deleted the run_package_scan branch November 8, 2022 14:26
kadoshms pushed a commit that referenced this pull request Nov 8, 2022
* add new sca package

* updated

* updated

* removed redundant lines

* update class

* run sca scan

* mypy

* flake8

* RUN_SCA_PACKAGE_SCAN_V2

* RUN_SCA_PACKAGE_SCAN_V2

* fixed

* reformat path

* fix files config

* updated

* mypy

* fixed root_folder

* Added tests

* update files

* mypy

* linting

* Fixed tests

* Fixed tests

* Fixed tests

* update endpoint url

* updated

* linting
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.

4 participants