Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/tls-trust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: TLS trust regression
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
trust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: sudo apt-get update && sudo apt-get install -y ca-certificates
- name: Verify the bootstrap OS trust store without bundled packages
run: python -S scripts/check_tls_trust.py
- name: Refresh installers and independently bundled certificates
run: python -m pip --cert /etc/ssl/certs/ca-certificates.crt install --upgrade 'pip>=26.2.2' 'certifi>=2026.10.19'
- run: python scripts/check_tls_trust.py
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM python:3.12-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& python -m pip --cert /etc/ssl/certs/ca-certificates.crt install --no-cache-dir --upgrade "pip>=26.2.2" "certifi>=2026.10.19"

WORKDIR /build
RUN python -m pip install --no-cache-dir build
Expand All @@ -9,6 +12,9 @@ ARG GNOMON_BUILD_COMMIT
RUN GNOMON_BUILD_COMMIT="$GNOMON_BUILD_COMMIT" python -m build --wheel

FROM python:3.12-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& python -m pip --cert /etc/ssl/certs/ca-certificates.crt install --no-cache-dir --upgrade "pip>=26.2.2" "certifi>=2026.10.19"

LABEL org.opencontainers.image.source="https://github.com/TensorLink-AI/Gnomon"
LABEL org.opencontainers.image.description="Evidence-backed local forecasting runtime"
Expand Down
38 changes: 38 additions & 0 deletions scripts/check_tls_trust.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Fail a build if Python's default or installed certifi stores retain affected roots."""
from __future__ import annotations

import hashlib
import importlib
import json
import ssl
import sys

AFFECTED_ROOTS = {
'7DD78D5F4F13459A83DFF9ABBBA62EDBAF6F2D102BF257FD712F4D9F2746ED8D',
'F2EDAAFF3D9B701FB4D14C9F285F8C0BAD90FC3BCC1FA07D47F4718EDABA34A5',
'D7A7A0FB5D7E2731D771E9484EBCDEF71D5F0C3E0A2948782BC83EE0EA699EF4',
'86A1ECBA089C4A8D3BBE2734C612BA341D813E043CF9E8A862CD5C57A36BBE6B',
}


def main():
contexts = {'system': ssl.create_default_context()}
for module_name in ['certifi', 'pip._vendor.certifi']:
try:
module = importlib.import_module(module_name)
except ImportError:
continue
contexts[module_name] = ssl.create_default_context(cafile=module.where())
results = []
for name, context in contexts.items():
found = sorted(AFFECTED_ROOTS & {
hashlib.sha256(cert).hexdigest().upper()
for cert in context.get_ca_certs(binary_form=True)
})
results.append({'store': name, 'affected_roots': found})
print(json.dumps({'python': sys.version.split()[0], 'stores': results}))
return int(any(row['affected_roots'] for row in results))


if __name__ == '__main__':
raise SystemExit(main())
6 changes: 6 additions & 0 deletions services/hosted/deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM python:3.13-slim AS build
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& python -m pip --cert /etc/ssl/certs/ca-certificates.crt install --no-cache-dir --upgrade "pip>=26.2.2" "certifi>=2026.10.19"
ARG GNOMON_BUILD_COMMIT
ENV GNOMON_BUILD_COMMIT=${GNOMON_BUILD_COMMIT}
WORKDIR /build/core
Expand All @@ -10,6 +13,9 @@ COPY services/hosted /build/hosted
RUN python -m pip wheel --no-cache-dir --wheel-dir /wheels . /build/hosted

FROM python:3.13-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& python -m pip --cert /etc/ssl/certs/ca-certificates.crt install --no-cache-dir --upgrade "pip>=26.2.2" "certifi>=2026.10.19"
ARG GNOMON_BUILD_COMMIT
LABEL org.opencontainers.image.source="https://github.com/TensorLink-AI/Gnomon" \
org.opencontainers.image.revision="${GNOMON_BUILD_COMMIT}"
Expand Down
Loading