-
Notifications
You must be signed in to change notification settings - Fork 509
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
🌱 Convert SAST check to probes #3571
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AdamKorcz
had a problem deploying
to
integration-test
October 13, 2023 20:53 — with
GitHub Actions
Failure
AdamKorcz
had a problem deploying
to
integration-test
October 14, 2023 14:12 — with
GitHub Actions
Failure
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3571 +/- ##
==========================================
- Coverage 76.13% 70.22% -5.92%
==========================================
Files 199 206 +7
Lines 13738 14003 +265
==========================================
- Hits 10460 9834 -626
- Misses 2668 3590 +922
+ Partials 610 579 -31 |
AdamKorcz
had a problem deploying
to
integration-test
October 14, 2023 14:34 — with
GitHub Actions
Failure
AdamKorcz
had a problem deploying
to
integration-test
October 14, 2023 15:20 — with
GitHub Actions
Failure
AdamKorcz
temporarily deployed
to
integration-test
October 14, 2023 15:44 — with
GitHub Actions
Inactive
AdamKorcz
temporarily deployed
to
integration-test
October 14, 2023 16:19 — with
GitHub Actions
Inactive
AdamKorcz
requested review from
azeemshaikh38,
justaugustus,
laurentsimon,
naveensrinivasan,
spencerschrock and
raghavkaul
as code owners
October 14, 2023 16:56
AdamKorcz
temporarily deployed
to
integration-test
October 14, 2023 17:07 — with
GitHub Actions
Inactive
AdamKorcz
changed the title
🌱 Convert SAST check to probes # DRAFT #
🌱 Convert SAST check to probes
Oct 14, 2023
AdamKorcz
temporarily deployed
to
integration-test
November 3, 2023 10:17 — with
GitHub Actions
Inactive
AdamKorcz
temporarily deployed
to
integration-test
November 3, 2023 10:40 — with
GitHub Actions
Inactive
AdamKorcz
temporarily deployed
to
integration-test
November 3, 2023 10:45 — with
GitHub Actions
Inactive
AdamKorcz
temporarily deployed
to
integration-test
November 3, 2023 11:06 — with
GitHub Actions
Inactive
AdamKorcz
temporarily deployed
to
integration-test
November 3, 2023 11:50 — with
GitHub Actions
Inactive
Signed-off-by: AdamKorcz <[email protected]>
Co-authored-by: Raghav Kaul <[email protected]> Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
Signed-off-by: AdamKorcz <[email protected]>
AdamKorcz
temporarily deployed
to
integration-test
November 6, 2023 22:20 — with
GitHub Actions
Inactive
diogoteles08
pushed a commit
to diogoteles08/scorecard
that referenced
this pull request
Nov 13, 2023
* Convert SAST checks to probes Signed-off-by: AdamKorcz <[email protected]> * Update checks/evaluation/sast.go Co-authored-by: Raghav Kaul <[email protected]> Signed-off-by: AdamKorcz <[email protected]> * preserve file info when logging positive Sonar findings Signed-off-by: AdamKorcz <[email protected]> * rebase Signed-off-by: AdamKorcz <[email protected]> * Remove warning logging Signed-off-by: AdamKorcz <[email protected]> * add outcome and message to finding on the same line Signed-off-by: AdamKorcz <[email protected]> * codeql workflow -> codeql action Signed-off-by: AdamKorcz <[email protected]> * 'the Sonar' -> 'Sonar' in probe def.yml Signed-off-by: AdamKorcz <[email protected]> * fix typo Signed-off-by: AdamKorcz <[email protected]> * Change how probe creates location Signed-off-by: AdamKorcz <[email protected]> * Change names of values Signed-off-by: AdamKorcz <[email protected]> * change 'SAST tool detected: xx' to 'SAST tool installed: xx' Signed-off-by: AdamKorcz <[email protected]> * make text in probe def.yml easier to read Signed-off-by: AdamKorcz <[email protected]> * Change 'to' to 'two' Signed-off-by: AdamKorcz <[email protected]> * Minor change Signed-off-by: AdamKorcz <[email protected]> --------- Signed-off-by: AdamKorcz <[email protected]> Signed-off-by: AdamKorcz <[email protected]> Co-authored-by: Raghav Kaul <[email protected]> Signed-off-by: Diogo Teles Sant'Anna <[email protected]>
ashearin
pushed a commit
to kgangerlm/scorecard-gitlab
that referenced
this pull request
Nov 13, 2023
* Convert SAST checks to probes Signed-off-by: AdamKorcz <[email protected]> * Update checks/evaluation/sast.go Co-authored-by: Raghav Kaul <[email protected]> Signed-off-by: AdamKorcz <[email protected]> * preserve file info when logging positive Sonar findings Signed-off-by: AdamKorcz <[email protected]> * rebase Signed-off-by: AdamKorcz <[email protected]> * Remove warning logging Signed-off-by: AdamKorcz <[email protected]> * add outcome and message to finding on the same line Signed-off-by: AdamKorcz <[email protected]> * codeql workflow -> codeql action Signed-off-by: AdamKorcz <[email protected]> * 'the Sonar' -> 'Sonar' in probe def.yml Signed-off-by: AdamKorcz <[email protected]> * fix typo Signed-off-by: AdamKorcz <[email protected]> * Change how probe creates location Signed-off-by: AdamKorcz <[email protected]> * Change names of values Signed-off-by: AdamKorcz <[email protected]> * change 'SAST tool detected: xx' to 'SAST tool installed: xx' Signed-off-by: AdamKorcz <[email protected]> * make text in probe def.yml easier to read Signed-off-by: AdamKorcz <[email protected]> * Change 'to' to 'two' Signed-off-by: AdamKorcz <[email protected]> * Minor change Signed-off-by: AdamKorcz <[email protected]> --------- Signed-off-by: AdamKorcz <[email protected]> Signed-off-by: AdamKorcz <[email protected]> Co-authored-by: Raghav Kaul <[email protected]> Signed-off-by: Allen Shearin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR rewrites the SAST check to 3 different probes. The SAST check before this change contained both creation of raw results and the evaluation part, so to convert it to probes, I've had to split it into raw results, probes and evaluation. As such, the SAST check was also missing testing - both whole unit tests and variety of input in existing tests - and I have added more tests.
Raw results
At a high level, the raw results will return a new struct called
SASTData
. This struct contains the following information for each probe:CodeQL Probe:
Sonar Probe:
Probe that checks whether SAST runs in every commit:
Compliant
field).Probes
The probes are fairly straight forward. For an explanation of each, I refer to the
implementation
in thedef.yml
file of the respective probes.Checks and evalutation
checks/sast.go
contains nothing majorly different from other migrated checks.Important changes to evaluation:
nonCompliantPRs
from here.sastScore
,codeQlScore
,sonarScore
. The existing check does that from the raw results directly, whereas the updated uses the results from the probes to assign values to these 3 variables.sastScore
,codeQlScore
,sonarScore
to create a check score. This part is kept as-is from the existing check.What kind of change does this PR introduce?
(Is it a bug fix, feature, docs update, something else?)
What is the current behavior?
What is the new behavior (if this is a feature change)?**
Which issue(s) this PR fixes
Special notes for your reviewer
Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to
the
release-note
(In particular, describe what changes users might need to make in their
application as a result of this pull request.)