Pilot · Password-protected archives: ask for the password and decrypt; refuse 7z/rar clearly #370

Closed
opened 2026-09-25 07:59:05 +00:00 by sharang · 0 comments
Owner

Part of #338.

Problem

There is no way to scan a password-protected archive, and some uploads fail or pass silently:

  • Encrypted zip as a source archive: extraction calls by_index (compliance-agent/src/ingest/archive.rs:144-146), which fails with "Password required to decrypt file". The run fails, and the only hint is that raw message. ingest_all stops at the first failing artifact (ingest/mod.rs:98-101), so the target's other artifacts are dropped too.
  • PLC archives: encrypted entries are skipped silently (pipeline/plc/sbom.rs:79-80).
  • 7z and rar: not recognised (archive.rs:78-90). They are scanned as one opaque file, and the scan ends "completed" with nothing found.
  • No password field exists in the model (compliance-core/src/models/onboarding.rs) or in the wizard.

Decision (2026-09-25)

Add an optional archive password, and refuse 7z/rar with a clear message.

Done when

  • An archive artifact can carry a password, stored encrypted like git tokens (never returned by the API) and editable later.
  • The wizard asks for it. An upload that turns out to be encrypted, with no password or a wrong one, gets a clear German/English message and a way to enter it.
  • Zip ZipCrypto and AES entries are decrypted with the password (by_index_decrypt), within the existing ExtractLimits. PLC archives use the same path.
  • 7z and rar are refused at upload with a clear message.
  • One failing artifact no longer drops the target's other artifacts.
  • Tests: ZipCrypto, AES, wrong password, missing password, 7z refused, one bad artifact among good ones.
Part of #338. ## Problem There is no way to scan a password-protected archive, and some uploads fail or pass silently: - **Encrypted zip as a source archive:** extraction calls `by_index` (`compliance-agent/src/ingest/archive.rs:144-146`), which fails with "Password required to decrypt file". The run fails, and the only hint is that raw message. `ingest_all` stops at the first failing artifact (`ingest/mod.rs:98-101`), so the target's other artifacts are dropped too. - **PLC archives:** encrypted entries are skipped silently (`pipeline/plc/sbom.rs:79-80`). - **7z and rar:** not recognised (`archive.rs:78-90`). They are scanned as one opaque file, and the scan ends "completed" with nothing found. - No password field exists in the model (`compliance-core/src/models/onboarding.rs`) or in the wizard. ## Decision (2026-09-25) Add an optional **archive password**, and refuse 7z/rar with a clear message. ## Done when - An archive artifact can carry a password, stored encrypted like git tokens (never returned by the API) and editable later. - The wizard asks for it. An upload that turns out to be encrypted, with no password or a wrong one, gets a clear German/English message and a way to enter it. - Zip ZipCrypto and AES entries are decrypted with the password (`by_index_decrypt`), within the existing `ExtractLimits`. PLC archives use the same path. - 7z and rar are refused at upload with a clear message. - One failing artifact no longer drops the target's other artifacts. - Tests: ZipCrypto, AES, wrong password, missing password, 7z refused, one bad artifact among good ones.
sharang added this to the Production MVP milestone 2026-09-25 07:59:05 +00:00
sharang added the enhancementonboardinghigh labels 2026-09-25 07:59:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#370