Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8353

Replace Product SHA with Release Manager's Public Key ID in Dockerfile for Official Docker Image

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      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:

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            burcham Bill Burcham
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: