Skip to content

Security: Add checksum verification for downloaded binaries in Python 3.12 images #1241

Open
@coderabbitai

Description

@coderabbitai

Summary

The new Python 3.12 notebook images download external binaries (OpenShift CLI and ROCm components) without checksum verification, which poses a security risk. We should add checksum verification to ensure the integrity and authenticity of downloaded components.

Security Concern

Downloaded binaries without checksum verification could potentially be compromised, leading to supply chain attacks. This is particularly important for production environments where these images will be deployed.

Affected Components

Based on the Python 3.12 implementation:

OpenShift CLI (oc)

  • Downloaded in multiple Dockerfiles without checksum verification
  • Used across minimal, datascience, and pytorch variants

ROCm Components

  • ROCm runtime and development packages installed via package manager
  • While using official repositories, additional verification would strengthen security posture

Recommended Implementation

  1. For OpenShift CLI:

    • Obtain SHA256 checksums from official releases
    • Add checksum verification after download
    • Example: echo "<expected_sha256> oc-client.tar.gz" | sha256sum -c
  2. For ROCm packages:

    • Verify GPG signatures of repository metadata
    • Consider pinning specific package versions with checksums

Code Locations

The downloads occur in the following Python 3.12 Dockerfiles:

  • jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu
  • jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda
  • jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm
  • jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu
  • jupyter/pytorch/ubi9-python-3.12/Dockerfile.cuda

Context

This issue was identified during the review of PR #1230 which introduces Python 3.12 support. The implementation is otherwise excellent, but this security enhancement should be added in a follow-up.

Backlinks:

Priority

Medium - Security enhancement that should be addressed before production deployment of Python 3.12 images.

Acceptance Criteria

  • Add SHA256 checksum verification for OpenShift CLI downloads
  • Implement GPG signature verification for ROCm repository setup
  • Update all affected Python 3.12 Dockerfiles
  • Document the security verification process
  • Test that builds still work with verification enabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions