Conversation
- Set an explicit read-only GITHUB_TOKEN permissions block on the build, deploy and release workflows, elevating only the jobs that need it (wiki/docs push and release tag: contents:write; ghcr push: packages:write) - Pin the third-party docker/* and softprops/action-gh-release actions to commit SHAs - EmailClient: stop trusting every SMTP server certificate over STARTTLS; validation is now the default, with opt-in starttls.trustedHosts / starttls.trustAll settings (documented) Resolves CodeQL alerts #711-#716, #718-#738, #920, #921 (actions) and OpenIdentityPlatform#22 (java/insecure-smtp-ssl).
Keeps the commit-hash-pinned third-party actions in .github/workflows up to date: Dependabot bumps the SHA and the trailing version comment together, grouped into one weekly PR. Ported from OpenIdentityPlatform/OpenIG#170.
This file contains hidden or 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
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.
Summary
Closes 30 of the 31 open medium CodeQL alerts: the 29 GitHub Actions findings and
java/insecure-smtp-ssl#22. The remaining one (#4,ResourceServletredirect) touches a file that #202 is already changing and will follow once that PR lands.GitHub Actions
actions/missing-workflow-permissions(#711–#716, #920, #921) — every workflow now starts frompermissions: contents: read; only the jobs that actually use the token get more, each with an inline comment saying why:build.yml(all jobs)contents: readregistry:2service need nothing elsedeploy.yml/deploy-mavencontents: writegithub.token(the doc-site push uses a PAT)release.yml/release-mavencontents: writerelease:preparepushes the release tag,action-gh-releasecreates the release, docs go to the wikirelease.yml/release-docker*contents: read,packages: writeGITHUB_TOKENactions/unpinned-tag(#718–#738) — the six third-party actions are pinned to commit SHAs, with the resolved version kept as a comment:docker/metadata-actionv6.2.0 ·docker/setup-qemu-actionv4.4.0 ·docker/setup-buildx-actionv4.4.1 ·docker/build-push-actionv7.4.0 ·docker/login-actionv4.6.0 ·softprops/action-gh-releasev3.0.3actions/*andgithub/*are not covered by the rule and stay on major tags.Second commit adds
.github/dependabot.yml(ported from OpenIdentityPlatform/OpenIG#170) with thegithub-actionsecosystem, grouped into one weekly PR, so the pinned SHAs stay current. All six pins above were verified against the actions' latest releases at the time of writing and are already up to date.#22 —
EmailClienttrusted every SMTP certificate over STARTTLSThe "temporary hack to avoid cert check" installed a
MailSSLSocketFactorywithsetTrustAllHosts(true)wheneverstarttls.enablewas set, so the TLS upgrade gave no protection against an on-path attacker. Certificate validation against the JVM trust store is now the default. Two optional settings relax it (documented in the integrator's guide):Behaviour change: deployments that use STARTTLS against an SMTP server with a self-signed or otherwise untrusted certificate will fail to send mail until they either add the certificate to the JVM trust store or set
trustedHosts/trustAll.Test plan
EmailClientTest(4): default → no custom socket factory;trustAll→ trust-all factory;trustedHosts→ limited factory; no STARTTLS → nothing configured. Two cases failed before the change.openidm-external-emailsuite green (9/9)contents: write/packages: writeare sufficient (the token had full default permissions before)