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

🔒️ Adds codeql-analysis cron job #2826

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Feb 11, 2022

What do these changes do?

  • Activates cron job that analyzes repo code for vulnerabilities (every monday at 5:26am)
  • Fixes two clear-text logging of sensitive info
    • NOTE: as a good practice always use SecretStr in pydantic models for objects that are logged

More details:

To see some of the job runs, check the "Actions" tab and select CodeQL workflow

Screen Shot 2022-03-15 at 22 56 00

Related issue/s

Checklist

  • scan only src/ folders
  • leave only cron-job and disable push+pull-request
  • analyze code and apply fixes
  • Openapi changes? make openapi-specs, git commit ... and then make version-*)
  • Database migration script? cd packages/postgres-database, make setup-commit, sc-pg review -m "my changes"
  • Unit tests for the changes exist
  • Runs in the swarm
  • Documentation reflects the changes
  • New module? Add your github username to .github/CODEOWNERS

@pcrespov pcrespov self-assigned this Feb 11, 2022
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #2826 (21e5339) into master (64f0631) will increase coverage by 3.2%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2826     +/-   ##
========================================
+ Coverage    76.0%   79.2%   +3.2%     
========================================
  Files         675     675             
  Lines       27642   27640      -2     
  Branches     3221    3221             
========================================
+ Hits        21017   21912    +895     
+ Misses       5935    4979    -956     
- Partials      690     749     +59     
Flag Coverage Δ
integrationtests 65.6% <100.0%> (+24.8%) ⬆️
unittests 74.8% <50.0%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...mcore_service_datcore_adapter/modules/pennsieve.py 90.9% <ø> (-0.1%) ⬇️
...tor_v2/modules/dynamic_sidecar/scheduler/events.py 94.8% <ø> (+56.2%) ⬆️
...es/dynamic_sidecar/docker_service_specs/sidecar.py 82.9% <100.0%> (+14.6%) ⬆️
.../simcore_service_catalog/db/repositories/groups.py 70.2% <0.0%> (-2.8%) ⬇️
.../simcore_service_catalog/services/access_rights.py 78.7% <0.0%> (-2.5%) ⬇️
...ore_service_director_v2/utils/dask_client_utils.py 73.4% <0.0%> (-1.3%) ⬇️
...c/simcore_service_catalog/core/background_tasks.py 67.3% <0.0%> (-1.1%) ⬇️
.../director/src/simcore_service_director/producer.py 62.1% <0.0%> (-0.7%) ⬇️
.../simcore_service_webserver/projects/projects_db.py 93.8% <0.0%> (+0.2%) ⬆️
...re_service_webserver/projects/projects_handlers.py 81.1% <0.0%> (+0.3%) ⬆️
... and 50 more

@pcrespov pcrespov added this to the R.Schumann milestone Feb 11, 2022
@pcrespov pcrespov added changelog:🔒️security security Pull requests that address a security vulnerability labels Feb 11, 2022
@pcrespov pcrespov changed the title Adds codeql-analysis cron job WIP: Adds codeql-analysis cron job Feb 11, 2022
@pcrespov pcrespov force-pushed the maintenance/adds-code-analysis-ci branch from d261ad4 to f901155 Compare February 13, 2022 13:01
@pcrespov pcrespov removed this from the R.Schumann milestone Mar 14, 2022
@pcrespov pcrespov force-pushed the maintenance/adds-code-analysis-ci branch from f901155 to 745f8ec Compare March 15, 2022 16:59
@pcrespov pcrespov added this to the E.Shackleton milestone Mar 15, 2022
@pcrespov pcrespov changed the title WIP: Adds codeql-analysis cron job 🔒️ Adds codeql-analysis cron job Mar 15, 2022
@pcrespov pcrespov marked this pull request as ready for review March 15, 2022 17:03
@pcrespov pcrespov requested review from sanderegg, GitHK and mrnicegyu11 and removed request for sanderegg March 15, 2022 17:09
@pcrespov pcrespov requested a review from mguidon March 15, 2022 21:32
@@ -0,0 +1,26 @@
name: "ospac-simcore CodeQL config"

disable-default-queries: false
Copy link
Member

Choose a reason for hiding this comment

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

So what are we scanning for by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Check the links above RT... :-) ... but basically thinks like plotting sensitive info (e.g. he was able to trace in the code and detect that a password was printed in the logs ... was quite impressive BTW)

Copy link
Member

@mguidon mguidon left a comment

Choose a reason for hiding this comment

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

Very nice tool!

@pcrespov pcrespov merged commit 4fba871 into ITISFoundation:master Mar 16, 2022
@pcrespov pcrespov deleted the maintenance/adds-code-analysis-ci branch March 16, 2022 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants