-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CALCITE-6794] Site Gemfile contains vulnerable ruby libraries #4162
Conversation
Runs locally
Trivy scan completed on my fork
and unit tests are now passing at core/src/test/java/org/apache/calcite/test/org.apache.calcite.test.LintTest |
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 instructions to build the site using docker no longer work after this PR
docker compose run --service-ports dev
...
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
/usr/gem/gems/sass-embedded-1.83.4/ext/sass/embedded_sass_pb.rb:11: [BUG] Segmentation fault at 0x0000000000004410
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
-- Control frame information -----------------------------------------------
c:0023 p:---- s:0092 e:000091 CFUNC :add_serialized_file
c:0022 p:0037 s:0087 e:000086 TOP /usr/gem/gems/sass-embedded-1.83.4/ext/sass/embedded_sass_pb.rb:11 [FINISH]
c:0021 p:---- s:0082 e:000081 CFUNC :require_relative
c:0020 p:0005 s:0077 e:000076 CLASS /usr/gem/gems/sass-embedded-1.83.4/lib/sass/embedded_protocol.rb:6
c:0019 p:0007 s:0074 e:000073 CLASS /usr/gem/gems/sass-embedded-1.83.4/lib/sass/embedded_protocol.rb:5
c:0018 p:0007 s:0071 e:000070 TOP /usr/gem/gems/sass-embedded-1.83.4/lib/sass/embedded_protocol.rb:3 [FINISH]
c:0017 p:---- s:0068 e:000067 CFUNC :require_relative
c:0016 p:0053 s:0063 e:000062 TOP /usr/gem/gems/sass-embedded-1.83.4/lib/sass/compiler.rb:11 [FINISH]
I always used docker to build the site so not sure we can merge this unless we resolve this problems.
Note that also the automatic site deployment action relies on the fact that docker works so this PR cannot be merged as such. |
these are now working:
|
|
It might have been related to binding on loopback interface inside the container instead of all interfaces. I've added --host=0.0.0.0 Also not sure if httpS if supported, documentation says http |
Confirming that Can you also fix these 2 warnings?
Another thing, as @zabetak metioned is that we use docker to build the site automatically:
I remember there were some permissions issues with GH actions, so we had to set the GID of the Jekyll user: https://github.com/apache/calcite/blob/main/.github/workflows/publish-website-on-release.yml#L47 I think the uid and gid of the generated files needs to be set to the |
resolved warnings for csv and base64
|
In the original docker build it runs as root
In the new docker build, it also runs as root, same as before.
I think the jekyll userid and groupid is determined by the host, not the docker guest, so it should continue to work - what are your thoughts @F21 |
In our GH actions workflows, we set the
This is so that the files generated by the docker service is owned by the correct user (GH actions runner) and not root. |
@F21 I have not used github actions before - may I ask please what is the change you suggest, I can implement it |
Basically, docker will set root as the owner and group of the files it generates. With the Since you have changed the image to |
Looks like uid and gid is set to 1000 on the old jekyll image
When I build, the files from the mounted volume on the host now have matching uid and gid
I hope this resolves the issue |
Is this considered complete now? |
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.
Please address the comment and squash your commits, then I think we're good to go.
Can you rebase your commit on top of main? For Calcite, we don't use merge commits. |
Please squash your commits @hughpearse |
done :) sorry for the confusion, git commit management is not my strength |
@hughpearse Looks like this broke our automated site publishing due to permissions issues: https://github.com/apache/calcite/actions/runs/12972791903/job/36180649311 Can you please open a pr to fix this? |
Quality Gate passedIssues Measures |
new ticket created |
Automated scans are failing of the repo blocking corporate process for library approval due to CVE vulnerability findings. Very minor change to site gemfile required to pass the scans.
Scanning tool is Trivy, and issue does not appear in owasp dependency-check.
Scan of https://github.com/apache/calcite* on *Jan 17, 2025
Repo Tag Scanned: calcite-1.38.0
Vulnerabilities --
HIGH | rexml | 3.2.5 | >= 3.3.9 | GHSA-2rxp-v6pw-ch6m | https://avd.aquasec.com/nvd/cve-2024-49761
HIGH | webrick | 1.7.0 | >= 1.8.2 | GHSA-6f62-3596-g6w7 | https://avd.aquasec.com/nvd/cve-2024-47220
MEDIUM | nokogiri | 1.14.3 | 1.15.6, 1.16.2 | GHSA-vcc3-rw6f-jv97 | GHSA-vcc3-rw6f-jv97
MEDIUM | nokogiri | 1.14.3 | ~> 1.15.6, >= 1.16.2 | GHSA-xc9x-jj77-9p9j | GHSA-xc9x-jj77-9p9j
MEDIUM | rexml | 3.2.5 | >= 3.2.7 | GHSA-vg3r-rm7w-2xgh | https://avd.aquasec.com/nvd/cve-2024-35176
MEDIUM | rexml | 3.2.5 | >= 3.3.2 | GHSA-4xqq-m2hx-25v8 | https://avd.aquasec.com/nvd/cve-2024-39908
MEDIUM | rexml | 3.2.5 | >= 3.3.3 | GHSA-r55c-59qm-vjw6 | https://avd.aquasec.com/nvd/cve-2024-41123
MEDIUM | rexml | 3.2.5 | >= 3.3.3 | GHSA-5866-49gr-22v4 | https://avd.aquasec.com/nvd/cve-2024-41946
MEDIUM | rexml | 3.2.5 | >= 3.3.6 | GHSA-vmwr-mc7x-5vc3 | https://avd.aquasec.com/nvd/cve-2024-43398
Solution is to update the site Gemfile
See following Jira ticket
CALCITE-6794
Related to PR#4159