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

🌱 Remove JavaScript CodeQL linting #1354

Closed

Conversation

adamdmharvey
Copy link

@adamdmharvey adamdmharvey commented Mar 25, 2024

This PR eliminates the JavaScript CodeQL scanning in the Actions workflows.

Currently, each PR scans both Go and JavaScript:

image

However, the only JavaScript in the repo is a single file. This file was added via #23 when the CodeQL workflow was breaking; but it was breaking because there was NO CodeQL scanning language set at the time. (so the "fix" was to go from none, to JavaScript, adding the single line JavaScript file which just spits out to console the word "codeql" 😁 ) But since Go was added, JavaScript should no longer be necessary.

This will eliminate about 1.5 minutes of CodeQL workflow scanning during each actions run.

No release should be necessary.

Signed-off-by: Adam Harvey <33203301+adamdmharvey@users.noreply.github.com>
@adamdmharvey
Copy link
Author

Here's how it now looks on my fork:

image

@adamdmharvey adamdmharvey changed the title chore(ci): Remove JavaScript CodeQL linting 🌱 Remove JavaScript CodeQL linting Mar 25, 2024
@spencerschrock
Copy link
Contributor

spencerschrock commented Mar 25, 2024

But since Go was added, JavaScript should no longer be necessary.

I believe the JS analysis also covers things like GitHub Actions:
https://codeql.github.com/codeql-query-help/javascript/js-actions-command-injection/

It's caught things for us before on ossf/scorecard

@adamdmharvey
Copy link
Author

It's caught things for us before on ossf/scorecard

Thanks for the feedback! Will check into that.

For this repo at least, the Action notes:

CodeQL scanned 1 out of 1 JavaScript files in this invocation. Check the status page for overall coverage information: https://github.com/ossf/scorecard-action/security/code-scanning/tools/CodeQL/status/

I checked an action on ossf/scorecard, and indeed that one is scanning 222 "extracted" JavaScript files (even though the repo contains one actual file). Seems it's extracting JavaScript OUT of some of the workflows themselves, which it's not doing in this repo.

@adamdmharvey
Copy link
Author

Looks like the difference may be this repo isn't doing:

     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
       uses: github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a # v1
       with:
         languages: ${{ matrix.language }}
+        queries: +security-extended

Maybe the alternative is to turn that ON here too?

@spencerschrock
Copy link
Contributor

At least based on this doc

"Expression injection in Actions" is listed for both default and security-extended

@adamdmharvey
Copy link
Author

Will give this a close, based on the point re: validating extracted/interpreted JS through embeddings in actions. Good feedback thx!

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.

None yet

2 participants