alessandro trinca tornidor commited on
chore: mark project as archived/unmaintained, bump to 1.12.17
Browse filesAdd archive notice to README.md, update pyproject.toml description,
and bump the pinned gis-prediction base image tag in Dockerfile to
match, reflecting that this project is no longer actively maintained.
- Dockerfile +1 -1
- README.md +2 -0
- SUPPLY_CHAIN_TODO.md +35 -0
- pyproject.toml +2 -2
- uv.lock +1 -1
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM registry.gitlab.com/aletrn/gis-prediction:1.12.
|
| 2 |
|
| 3 |
ARG WORKDIR_ROOT="/var/task"
|
| 4 |
ARG MODEL_VARIANT="sam2.1_hiera_base_plus_uint8"
|
|
|
|
| 1 |
+
FROM registry.gitlab.com/aletrn/gis-prediction:1.12.17
|
| 2 |
|
| 3 |
ARG WORKDIR_ROOT="/var/task"
|
| 4 |
ARG MODEL_VARIANT="sam2.1_hiera_base_plus_uint8"
|
README.md
CHANGED
|
@@ -8,6 +8,8 @@ pinned: true
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
|
|
|
|
|
|
| 11 |
# About this README
|
| 12 |
|
| 13 |
I tested these instructions on macOS, but should work on linux as well.
|
|
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
+
β οΈ Archived / unmaintained. This project is part of the samgis-* line, which I'm no longer actively maintaining. Maintaining it has been unpaid work, and without real user feedback to justify the continued time investment, I'm redirecting my effort toward projects with a sustainable return. The code stays available as-is (MIT) β issues and PRs may go unreviewed. Forks are welcome.
|
| 12 |
+
|
| 13 |
# About this README
|
| 14 |
|
| 15 |
I tested these instructions on macOS, but should work on linux as well.
|
SUPPLY_CHAIN_TODO.md
CHANGED
|
@@ -14,6 +14,41 @@ Triggered 2026-04-06 by tomshw "code resurrection" article. Cross-cutting work t
|
|
| 14 |
- [ ] **Wire `pip-audit` into CI gate** β currently declared in dev group but not run on every build. Add to post-production / CI step.
|
| 15 |
- [ ] **Lockfile-diff guard** in pre-commit (one-line bash check via `/supply-chain` skill once shipped).
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
## Deferred β base image owns the real risk
|
| 18 |
|
| 19 |
The dependency installation surface for samgis-be lives in the **base image build pipeline**, not in this repo. The Dockerfile here only imports the prebuilt image and runs smoke tests.
|
|
|
|
| 14 |
- [ ] **Wire `pip-audit` into CI gate** β currently declared in dev group but not run on every build. Add to post-production / CI step.
|
| 15 |
- [ ] **Lockfile-diff guard** in pre-commit (one-line bash check via `/supply-chain` skill once shipped).
|
| 16 |
|
| 17 |
+
## Python `.pth` injection + runtime-exec hardening
|
| 18 |
+
|
| 19 |
+
Defense-in-depth against a compromised dependency planting a malicious `.pth` file in
|
| 20 |
+
site-packages β it executes arbitrary Python at every interpreter startup, a stealthy persistence
|
| 21 |
+
vector that `pip-audit`/Trivy/Syft do **not** detect (they treat packages as files, not as
|
| 22 |
+
executable code). Mirrors the `.pth` sentinel added to `devcontainer-guard` (MIASMA-3/MIASMA-5,
|
| 23 |
+
2026-07-02).
|
| 24 |
+
|
| 25 |
+
- [ ] **Dockerfile env hardening** (this repo): set `PYTHONNOUSERSITE=1` + `PYTHONPATH=` (empty) in
|
| 26 |
+
the samgis-be Dockerfile. Cheap, no runtime cost, independent of the base image.
|
| 27 |
+
- [ ] **Startup/healthcheck `.pth` sentinel** (design corrected 2026-07-02 after adversarial review).
|
| 28 |
+
site.py exec's any `.pth` line starting with `import `/`import\t` (single line; `from`-imports
|
| 29 |
+
inert). **Detection = an `import`-line that makes a call `(` or chains `;` is suspicious UNLESS
|
| 30 |
+
it matches a small safe-pattern allowlist.** Do NOT use a raw marker substring blocklist
|
| 31 |
+
(`os.system(`β¦) β trivially evaded by `import os as o; o.system(...)`, getattr/importlib
|
| 32 |
+
indirection, string-concat, `sys.path` manipulation; keep markers only as a secondary
|
| 33 |
+
escalator. Severity: unexpected name in system root β CRIT, in workspace/user venv β WARN;
|
| 34 |
+
suspicious content β CRIT; `.pth` > 4 KB β CRIT (weak size heuristic). Scan top-level of each
|
| 35 |
+
site dir only (site.py doesn't recurse).
|
| 36 |
+
- **β MANDATORY content-pattern allowlist**: `distutils-precedence.pth` ships with setuptools in
|
| 37 |
+
nearly every image (`import os; ...__import__('_distutils_hack').add_shim();`) and a naive scan
|
| 38 |
+
FAILs it. Allowlist by content pattern: (1) `distutils-precedence.pth`, (2) editable finders
|
| 39 |
+
`^import __editable___\w+_finder; __editable___\w+_finder\.install\(\)$` (regex, keep tight),
|
| 40 |
+
(3) `declare_namespace` lines.
|
| 41 |
+
- **Also scan (same pass)**: unexpected `sitecustomize.py`/`usercustomize.py` and
|
| 42 |
+
**`/etc/ld.so.preload`** (native LD_PRELOAD persistence; any content = CRIT). Note most
|
| 43 |
+
site-packages come from the `gis-prediction` base image β the sentinel scanning the *running*
|
| 44 |
+
image covers them regardless of install origin. Reference impl: `devcontainer-guard`
|
| 45 |
+
`scripts/_shared/pth_sentinel.py` once shipped (copy the inverted predicate + allowlist).
|
| 46 |
+
- [ ] **Base-image note**: most site-packages come from `gis-prediction` β the sentinel scanning
|
| 47 |
+
the *running* image covers those regardless of where they were installed. The env hardening
|
| 48 |
+
above is the only part that must live in this repo's Dockerfile.
|
| 49 |
+
- **Defer until**: pre-production hardening pass, or sooner if a dep audit flags a suspicious
|
| 50 |
+
package. HF Space is private / low public attack surface (see Notes) β not blocking.
|
| 51 |
+
|
| 52 |
## Deferred β base image owns the real risk
|
| 53 |
|
| 54 |
The dependency installation surface for samgis-be lives in the **base image build pipeline**, not in this repo. The Dockerfile here only imports the prebuilt image and runs smoke tests.
|
pyproject.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
[project]
|
| 2 |
name = "samgis"
|
| 3 |
-
version = "1.12.
|
| 4 |
-
description = "A backend for machine learning instance segmentation on geospatial data even without dedicated graphics cards."
|
| 5 |
authors = [
|
| 6 |
{ name = "alessandro trinca tornidor", email = "alessandro@trinca.tornidor.com" },
|
| 7 |
]
|
|
|
|
| 1 |
[project]
|
| 2 |
name = "samgis"
|
| 3 |
+
version = "1.12.17"
|
| 4 |
+
description = "A backend for machine learning instance segmentation on geospatial data even without dedicated graphics cards. (ARCHIVED - no longer maintained)"
|
| 5 |
authors = [
|
| 6 |
{ name = "alessandro trinca tornidor", email = "alessandro@trinca.tornidor.com" },
|
| 7 |
]
|
uv.lock
CHANGED
|
@@ -1299,7 +1299,7 @@ wheels = [
|
|
| 1299 |
|
| 1300 |
[[package]]
|
| 1301 |
name = "samgis"
|
| 1302 |
-
version = "1.12.
|
| 1303 |
source = { virtual = "." }
|
| 1304 |
dependencies = [
|
| 1305 |
{ name = "onnxruntime" },
|
|
|
|
| 1299 |
|
| 1300 |
[[package]]
|
| 1301 |
name = "samgis"
|
| 1302 |
+
version = "1.12.17"
|
| 1303 |
source = { virtual = "." }
|
| 1304 |
dependencies = [
|
| 1305 |
{ name = "onnxruntime" },
|