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

Add Github Code Scanning codeql.yml #2149

Merged
merged 20 commits into from
Feb 21, 2023
Merged

Add Github Code Scanning codeql.yml #2149

merged 20 commits into from
Feb 21, 2023

Conversation

msaroufim
Copy link
Member

@msaroufim msaroufim commented Feb 20, 2023

Description

This PR adds support for code scanning which detects a large suite of common vulnerabilities like code injection, directory traversal, bad crypto algorithms

So now our security process includes

  1. Dependency analysis with dependabot
  2. Code scanning (this PR)
  3. Docker scanning (Snyk, already added in 0.7.1)

Might also be useful to do

  1. Penetration testing on a deployed instance - maybe @agunapal is interested in this
  2. An Audit - I'll look into this

The security issues will show up in https://github.com/pytorch/serve/security/code-scanning after this is merged

Type of change

  • New feature (non-breaking change which adds functionality)

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A

Scroll down to CI, there should be 2 new jobs for code scanning, one for python and one for java

When both those jobs get completed a report gets created and it accurately shows some existing vulnerabilities we need to be fixing https://github.com/pytorch/serve/pull/2149/checks?check_run_id=11473788403

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?

@msaroufim msaroufim changed the title Create codeql.yml Add Github Code Scanning codeql.yml Feb 20, 2023
@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Merging #2149 (330273f) into master (c417b4a) will not change coverage.
The diff coverage is n/a.

❗ Current head 330273f differs from pull request most recent head aa02933. Consider uploading reports for the commit aa02933 to get more accurate results

@@           Coverage Diff           @@
##           master    #2149   +/-   ##
=======================================
  Coverage   53.36%   53.36%           
=======================================
  Files          71       71           
  Lines        3225     3225           
  Branches       56       56           
=======================================
  Hits         1721     1721           
  Misses       1504     1504           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

.map(e -> e.split("=", 2))
.collect(Collectors.toMap(e -> e[0], e -> e[1]));

ProcessBuilder pb = new ProcessBuilder(packageInstallCommand);

Check failure

Code scanning / CodeQL

Building a command line with string concatenation

Command line is built with string concatenation.
@msaroufim msaroufim merged commit 92657b2 into master Feb 21, 2023
@msaroufim msaroufim deleted the msaroufim-patch-6 branch February 21, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants