Hi everyone,
I've published the previously private[1] Jenkins code scanning rules for CodeQL. These are static analysis rules covering mostly Jenkins-specific issues, like unprotected Stapler web methods and use of APIs that are generally not a good idea in the context of Jenkins plugins.
While this uses the CodeQL CLI and Java language support, the queries are entirely custom, so this is set up so it can run side-by-side with the normal GitHub CodeQL security scanner (or any other such tool), which would identify more generic issues.
You can now enable them for your plugins by setting up a GitHub Workflow. For details about setting this up inside and outside the jenkinsci GitHub org, see the documentation on jenkins.io[2].
The existing mechanisms to run this scan on plugin repos -- signing up through INFRA tickets and labeling repos with jenkins-security-scan-enabled[3] -- will be retired, so I recommend you set this up even if you already get scan results.
Regards
Daniel
1: https://www.jenkins.io/blog/2020/11/04/codeql/
2: https://www.jenkins.io/redirect/jenkins-security-scan
3: https://groups.google.com/g/jenkinsci-dev/c/xpsIgJJy44U/m/w-O0JbpTBgAJ
Do we generally recommend this for any plugin? If so, it would be great to add this to `archetypes`.
That's where I think we should end up, but I'd like to get some more scan quality feedback first. The private beta wasn't as successful as I'd hoped in getting that. Perhaps it no longer being an intransparent black box helps with that :)
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8a6ea7f4-c6d6-4515-a3f3-1c6041a9d256n%40googlegroups.com.
I suppose any results would appear in `/security/code-scanning` to repo admins only?
Will the Checks tab of a PR or trunk commit always be green so long as scanning completed, even if there are violations?
The scan should pass `-ntp` to Maven builds—noisy. It is a bit slower than I expected too, though I suppose it does not matter much (still finishes before the Jenkins build).
PR-specific results are shown directly and publicly in the PR. GitHub compares results from the PR to results from the target branch to only show differences.
And if you add the workflow file in a PR, that PR will have all findings, because they're all new…
note that you can set up a Maven cache if you haven't.
curl: (22) The requested URL returned error: 403
Failed to upload results
curl: (22) The requested URL returned error: 403
Failed to upload results
Error: Process completed with exit code 1.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAL-LwjzkAdS0T7Ew568x7N05nTZhpNxe%3DkQyF0ZgWT0JfV1ncQ%40mail.gmail.com.
Interesting. It probably happens because it's a PR from a fork and the GITHUB_TOKEN used only has read permission for SecurityEvents. I'll look into solutions tomorrow.
It looks like GitHub's action can do what I cannot because it uses an undocumented API.
I'll update this thread once it works, meanwhile you can watch https://github.com/jenkins-infra/jenkins-security-scan/issues/3
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAMo7PtKKZVTPDQG%3D_zYbf3NHgasJm1weaPBs5TTdTtsreuaHXw%40mail.gmail.com.
In the meantime, I will (try) to turn code scanning off so that I can get the PRs through CI.
It looks like GitHub's action can do what I cannot because it uses an undocumented API.
I'll update this thread once it works, meanwhile you can watch https://github.com/jenkins-infra/jenkins-security-scan/issues/3
After upgrading a dozen or so plugins to Security Scan v2, the Jenkins
Security Scan workflow on the main branch failed with:
Called workflows cannot be queued onto self-hosted runners across
organisations/enterprises. Failed to queue this job. Labels:
'ubuntu-latest'.
Does the Jenkins Security Scan need to be adapted to use the artifact
caching proxy?