-
Notifications
You must be signed in to change notification settings - Fork 722
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 CodeQL workflow for GitHub code scanning #3601
Changes from all commits
d0e7951
ef88cf0
5f88dc1
70fd36f
37b55a3
e735b4f
ca06eb3
3230681
7fa0e34
386decb
51611c8
0c532dd
25a4cea
1049fbf
fabadb4
1bbd659
121e2ab
fffcc7b
c2cfb4a
21cf4ae
4148758
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: "S2N CodeQL Config" | ||
|
||
paths-ignore: | ||
- tests/integration |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "CodeQL - Python" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '**/tests/integration/*' | ||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '**/tests/integration/*' | ||
schedule: | ||
- cron: "1 18 * * 0" | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Disabling c analysis (for now) as this takes ~2 hours to complete | ||
language: [ python ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: +security-and-quality | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list of analyses that seemed to have taken the longest amount of time. We should review the wisdom of disabling them.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could also potentially have separate configurations for pushes and PRs. The PR configuration could include the cheap checks which is hopefully style related stuff, and the push could check for everything else that we could add afterwards. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. We can run the more expensive checks on a schedule. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this PR is (now?) focused on Python, it might make sense to move these comments to another issue where we can track what's needed for the C checks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, we're tracking this here: #3636. I'll move the notes over there |
||
config-file: ./.github/codeql-config.yml | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
if: ${{ matrix.language == 'c' || matrix.language == 'python' }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{ matrix.language }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import os | ||
import re | ||
import subprocess | ||
import string | ||
import threading | ||
import itertools | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import pytest | ||
from global_flags import set_flag, S2N_PROVIDER_VERSION, S2N_FIPS_MODE, S2N_NO_PQ | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import time | ||
import os | ||
import select | ||
import selectors | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output below shows where the bulk (a little over 2 hours out of 2 and a half) of the time is being spent:
Here is a list of the id's of the above long running evaluations to be considered for potential exclusion:
Here is the mapping of
ql
files to ids:They are all of kind
path-problem
orproblem
.