[
https://issues.apache.org/jira/browse/GEODE-8353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17193973#comment-17193973
]
Owen Nichols commented on GEODE-8353:
-------------------------------------
Regarding these concerns:
>1. folks looking at the Geode source code do not see the correct
>{{Dockerfile}} source unless they know to look for it on the {{master}} branch
There is a correct Dockerfile on each released support branch. There is no
such thing as "correct" in any other context (such as develop). Perhaps it
would clear things up to replace misleading placeholder values like version=1.9
with something that makes it clearer it's a placeholder like
version=putversionhere.
>2. the release process has extra steps to maintain the {{Dockerfile}} on the
>master branch
Actually, the release process steps are to maintain the Dockerfile on the
support branch. Geode's practice of maintaining master as a snapshot of the
latest release tag is independent of that (and is totally optional if we want
to get rid of master entirely).
>3. inescapably, revisions to the the {{Dockerfile}} on the master branch
>follow a linear progression whereas the sources of that file are following a
>tree-structured one
I'm not sure I understand this concern. Again, Geode's practice of maintaining
master as a snapshot of the latest release tag is an optional convenience.
Dockerhub's link to Geode's Dockerfile now directs people to the latest support
branch (not master). It was actually a mistake that Dockerfile changes were
getting pushed to master at all, that will be fixed next release onward.
>4. it isn't possible to validate the product SHA the way you could a public
>key. About all a developer can do is read the SHA from the {{Dockerfile}} and
>compare it to a SHA on an apache.org site. But that depends on the security of
>that apache.org site.
Sure, we could validate the .asc signature as well as the .sha256. The
checksum validation is sufficient to safeguard against download issues. Most
consumers of the apachegeode/geode docker image will only ever be pulling the
layers pushed by the Geode Release Manager. Anyone taking the Dockerfile to
build their own image is free to add or remove any level of validation as
needed (signature information is publicly available in the source repo
([https://github.com/apache/geode/blob/develop/KEYS)] so I am unclear how it
would help to duplicate that into another file in the same repo).
> Replace Product SHA with Release Manager's Public Key ID in Dockerfile for
> Official Docker Image
> ------------------------------------------------------------------------------------------------
>
> Key: GEODE-8353
> URL: https://issues.apache.org/jira/browse/GEODE-8353
> Project: Geode
> Issue Type: Bug
> Reporter: Bill Burcham
> Priority: Major
>
> We would like to protect developers building/rebuilding images from the
> official Geode {{Dockerfile}} from inadvertently downloading/using
> inauthentic software. The risk is that somehow a bad actor gains access to
> apache.org servers and puts malicious software there.
> The current approach to securing the {{Dockerfile}} for the official Geode
> Docker image is to include the product SHA in the file. As a result, the
> source code of the {{Dockerfile}} used to produce the official Docker image,
> for publication on Docker Hub, is not part of the source code covered by the
> Geode product SHA. This is known as the "chicken-and-egg" problem. Instead,
> the {{Dockerfile}} comes from the {{master}} branch.
> This presents a number of problems:
> 1. folks looking at the Geode source code do not see the correct
> {{Dockerfile}} source unless they know to look for it on the {{master}} branch
> 2. the release process has extra steps to maintain the {{Dockerfile}} on the
> master branch
> 3. inescapably, revisions to the the {{Dockerfile}} on the master branch
> follow a linear progression whereas the sources of that file are following a
> tree-structured one
> 4. it isn't possible to validate the product SHA the way you could a public
> key. About all a developer can do is read the SHA from the {{Dockerfile}} and
> compare it to a SHA on an apache.org site. But that depends on the security
> of that apache.org site.
> When this story is complete, Geode's official Docker image will not come from
> the {{Dockerfile}} on the master branch. Instead, the {{Dockerfile}} on
> {{develop}} and support branches, will contain the public key ID of the (a)
> release manager instead of a product SHA. Verification will proceed like this
> inside the {{Dockerfile}}:
> 1. download release manager's public key-cert from key server {{gpg
> --keyserver some.apache.key.server --recv-keys
> release-managers-key-id-from-dockerfile}}
> 2. download product checksums
> 3. download a signature for the checksums—signed by the release manager's
> private key
> 4. download product distribution
> 5. validate checksums (2) with signature (3) {{gpg --batch --verify
> signature-file downloaded-checkums-file}}
> 6. verify that locally-computed product checksums match downloaded ones
> If any of those steps fail, then the {{Dockerfile}} build fails.
> This is similar to the approach used in these {{Dockerfile}}s:
> * HashiCorp Consul: https://hub.docker.com/_/consul
> * Apache Web Server httpd: https://hub.docker.com/_/httpd
> The Apache httpd {{Dockerfile}} uses a slightly simpler approach than the
> Consul one. They sign the release tarball directly instead of signing a
> checksums file. That eliminates step (2). In (3) they download a signature of
> the tarball. In (5) they validate the checksum directly against the tarball.
> Release manager instructions will be updated to reflect these structural and
> procedural changes.
> Steps (2) and (3) may require additions to our release process. TBD if we
> already have a checksums file (2). I don't think we have a signature (3) over
> that file.
> Some validation steps cannot be done inside the Dockerfile. One is validating
> that the release manager's public key is trustworthy. (see _Validating
> Authenticity of a Key_ here: https://www.apache.org/info/verification.html)
> Ostensibly, the Geode community would ensure the validity of the public key
> ID in the Dockerfile in the release branches of the public Git repo.
> Developers using the {{Dockerfile}} could see the release managers public key
> ID and could validate that.
> As for validating Docker _images_ e.g. hosted on Docker Hub, that is out of
> scope for this story.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)