Skip to content

[Security] Pin Python dependencies and add lockfile#509

Draft
SeanMeyer wants to merge 2 commits intoDataDog:mainfrom
SeanMeyer:security/pin-python-deps
Draft

[Security] Pin Python dependencies and add lockfile#509
SeanMeyer wants to merge 2 commits intoDataDog:mainfrom
SeanMeyer:security/pin-python-deps

Conversation

@SeanMeyer
Copy link
Copy Markdown

Summary

  • Pin all unpinned dependencies in setup.cfg to exact versions:
    • certifi>=2022.12.7 -> certifi==2026.2.25
    • python-dateutil (bare) -> python-dateutil==2.9.0.post0
    • google-cloud-storage>=2.14.0 -> google-cloud-storage==3.10.1
    • azure-storage-blob>=12.19.0 -> azure-storage-blob==12.28.0
    • azure-identity>=1.15.0 -> azure-identity==1.25.3
    • setuptools>=67.6.0 -> setuptools==67.6.0
    • setuptools_scm (bare) -> setuptools_scm==8.3.1
  • Add requirements.in and requirements.txt.lock generated by pip-compile with SHA-256 hashes for all transitive dependencies

Motivation

Part of incident #51987 supply chain protection campaign. Pinning dependencies to exact versions and adding hash-verified lockfiles prevents supply chain attacks where a compromised package version could be silently installed during builds.

Test plan

  • Verify the lockfile installs cleanly: pip install -r requirements.txt.lock
  • Verify pip install -e . still works with the pinned versions
  • Run the test suite: tox or pytest

Pin all unpinned dependencies in setup.cfg to exact versions
(certifi, python-dateutil, google-cloud-storage, azure-storage-blob,
azure-identity, setuptools, setuptools_scm). Add requirements.in and
a pip-compile-generated lockfile with SHA-256 hashes for all
transitive dependencies.

Part of incident #51987 supply chain protection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The setup_requires pins (setuptools==67.6.0, setuptools_scm==8.3.1)
conflicted with pyproject.toml's build-system requires which resolve
to setuptools==82.0.1 and setuptools_scm==10.0.5. This caused two
errors: "backend dependencies conflict" and "'Configuration' object
has no attribute 'scm'".

Revert setup_requires to ranges matching pyproject.toml since the
build system (not setup.cfg) controls which versions get installed.
Also pin remaining unpinned deps in requirements.in to match
setup.cfg's install_requires for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant