Implement safe user-side acquisition and manual import #46

Closed
opened 2026-07-31 01:25:50 -04:00 by JackFrostbyte · 1 comment

Goal

Implement the minimum trusted acquisition layer that consumes reviewed declarative
recipes and writes only to the user-local overlay.

Initial supported modes

  1. manual_import

    • the user obtains the file through the publisher's normal workflow;
    • Arkive validates and imports the user-selected file locally.
  2. official_direct_download

    • HTTPS only;
    • reviewed, allowlisted official/publisher/institutional hosts;
    • bounded redirects to approved hosts;
    • no login, paywall, CAPTCHA, session-cookie harvesting, or access-control bypass.

Official authenticated APIs may be added later only through a dedicated reviewed
adapter and credential-handling design.

Required safeguards

  • Closed adapter allowlist; no arbitrary command execution.
  • HTTPS and hostname validation.
  • Redirect limits and redirect-host allowlist.
  • Timeouts, maximum compressed/uncompressed sizes, and content-type checks.
  • Checksum/signature verification when available.
  • Archive path-traversal, symlink, decompression-bomb, and nested-archive defenses.
  • Atomic writes and quarantine before validation.
  • No secrets in recipe files, logs, manifests, exceptions, or telemetry.
  • Dry-run/explain mode showing what Arkive would contact and store.
  • Refusal of expired, withdrawn, unsupported-jurisdiction, or contradictory recipes.
  • Clear user acknowledgement and local-only notice before acquisition.

Deliverables

  • Recipe validator and trusted adapters.
  • CLI for recipe inspection, dry run, direct acquisition, and manual import.
  • Local acquisition provenance record.
  • Unit and integration tests using local fixtures/test servers only.
  • Security documentation and threat model.

Acceptance criteria

  • No valid recipe can execute arbitrary code.
  • Network tests do not depend on live third-party sites.
  • Partial or invalid downloads never become approved local inputs.
  • Credentials and authenticated browser sessions are not scraped or persisted.
  • Withdrawn/expired recipes fail closed.
  • All successful outputs are created only in the user-local store.

Out of scope

  • Circumvention of any technical or contractual access control.
  • Browser automation for paid/login-bound content.
  • Public proxying, mirroring, or hosting of acquired files.

Roadmap clarification: individual incremental acquisition

  • On a repeated request for the same reviewed recipe/source, inspect the existing user-local artifact, pinned recipe snapshot, identifiers, hash, size, type and provenance before deciding whether it can be reused. Do not infer current eligibility solely from an old acquisition record.
  • Return a structured, actionable existing/changed/invalid/conflicting result without silently overwriting valid files, promoting partial files or weakening any new-acquisition policy checks. A newly published version or checksum change requires reviewed recipe evidence, never automatic trust.
  • Include the narrowly scoped validator correction and regression tests for the documented recipe-snapshot.json filename versus the validator's currently recognized recipe.json, without redesigning the prerequisite schemas. Stop for review if a larger prerequisite change is necessary.
  • Keep #46 focused on one source at a time; batch retries are specified in #72, maintainer source checking in #71, and the 10-source end-to-end pilot in #73. No processing or indexing is part of #46.

Additional acceptance criteria

  • Repeated acquisition can securely recognize and validate an already present artifact with its pinned recipe/provenance and report its disposition.
  • Conflicting or invalid existing artifacts fail safely without silent replacement.
  • Recipe-snapshot validation is consistent with the documented storage contract and has focused regression coverage.
## Goal Implement the minimum trusted acquisition layer that consumes reviewed declarative recipes and writes only to the user-local overlay. ## Initial supported modes 1. `manual_import` - the user obtains the file through the publisher's normal workflow; - Arkive validates and imports the user-selected file locally. 2. `official_direct_download` - HTTPS only; - reviewed, allowlisted official/publisher/institutional hosts; - bounded redirects to approved hosts; - no login, paywall, CAPTCHA, session-cookie harvesting, or access-control bypass. Official authenticated APIs may be added later only through a dedicated reviewed adapter and credential-handling design. ## Required safeguards - Closed adapter allowlist; no arbitrary command execution. - HTTPS and hostname validation. - Redirect limits and redirect-host allowlist. - Timeouts, maximum compressed/uncompressed sizes, and content-type checks. - Checksum/signature verification when available. - Archive path-traversal, symlink, decompression-bomb, and nested-archive defenses. - Atomic writes and quarantine before validation. - No secrets in recipe files, logs, manifests, exceptions, or telemetry. - Dry-run/explain mode showing what Arkive would contact and store. - Refusal of expired, withdrawn, unsupported-jurisdiction, or contradictory recipes. - Clear user acknowledgement and local-only notice before acquisition. ## Deliverables - Recipe validator and trusted adapters. - CLI for recipe inspection, dry run, direct acquisition, and manual import. - Local acquisition provenance record. - Unit and integration tests using local fixtures/test servers only. - Security documentation and threat model. ## Acceptance criteria - [ ] No valid recipe can execute arbitrary code. - [ ] Network tests do not depend on live third-party sites. - [ ] Partial or invalid downloads never become approved local inputs. - [ ] Credentials and authenticated browser sessions are not scraped or persisted. - [ ] Withdrawn/expired recipes fail closed. - [ ] All successful outputs are created only in the user-local store. ## Out of scope - Circumvention of any technical or contractual access control. - Browser automation for paid/login-bound content. - Public proxying, mirroring, or hosting of acquired files. --- <!-- arkive-overlay-roadmap-2026-09-27:issue-46:start --> ### Roadmap clarification: individual incremental acquisition - On a repeated request for the same reviewed recipe/source, inspect the existing user-local artifact, pinned recipe snapshot, identifiers, hash, size, type and provenance before deciding whether it can be reused. Do not infer current eligibility solely from an old acquisition record. - Return a structured, actionable existing/changed/invalid/conflicting result without silently overwriting valid files, promoting partial files or weakening any new-acquisition policy checks. A newly published version or checksum change requires reviewed recipe evidence, never automatic trust. - Include the narrowly scoped validator correction and regression tests for the documented `recipe-snapshot.json` filename versus the validator's currently recognized `recipe.json`, without redesigning the prerequisite schemas. Stop for review if a larger prerequisite change is necessary. - Keep #46 focused on **one source at a time**; batch retries are specified in #72, maintainer source checking in #71, and the 10-source end-to-end pilot in #73. No processing or indexing is part of #46. **Additional acceptance criteria** - [ ] Repeated acquisition can securely recognize and validate an already present artifact with its pinned recipe/provenance and report its disposition. - [ ] Conflicting or invalid existing artifacts fail safely without silent replacement. - [ ] Recipe-snapshot validation is consistent with the documented storage contract and has focused regression coverage. <!-- arkive-overlay-roadmap-2026-09-27:issue-46:end -->
Author
Owner

Completed — Issue #46

Implemented and merged through PR #74.

Arkive now has its initial secure, single-source acquisition foundation, supporting reviewed manual imports and official HTTPS downloads.

The implementation includes eligibility enforcement, trusted recipe loading, secure transport, quarantine, integrity verification, atomic storage, provenance, validated reuse and CLI operations.

Final validation: 616 passing tests, including 288 acquisition tests with external networking blocked. All quality checks passed.

The production acquisition catalogue intentionally remains empty until external sources receive formal approval.

Further development continues through the dedicated maintainer health-monitoring issue (#71), resilient batch acquisition (#72), and final ten-source pilot (#73).

Closing Issue #46 as completed.

### Completed — Issue #46 Implemented and merged through PR #74. Arkive now has its initial secure, single-source acquisition foundation, supporting reviewed manual imports and official HTTPS downloads. The implementation includes eligibility enforcement, trusted recipe loading, secure transport, quarantine, integrity verification, atomic storage, provenance, validated reuse and CLI operations. **Final validation:** 616 passing tests, including 288 acquisition tests with external networking blocked. All quality checks passed. The production acquisition catalogue intentionally remains empty until external sources receive formal approval. Further development continues through the dedicated maintainer health-monitoring issue (#71), resilient batch acquisition (#72), and final ten-source pilot (#73). Closing Issue #46 as completed.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Arkive/arkive#46
No description provided.