Skip to content

Latest commit

 

History

History
561 lines (394 loc) · 9.36 KB

File metadata and controls

561 lines (394 loc) · 9.36 KB

JanusKey Testing Report (ARCHIVED — 2025-12-29)

Warning

This report is a stale snapshot from 2025-12-29 and is retained for history only. It predates the 2026-04 readiness assessment, which graded the project D (Alpha, Unstable). Its "all tests passed / robust and functional" framing overstates the current state (homerolled attestation MAC, unimplemented asymmetric crypto, no fuzz/mutation/chaos testing).

For the current, authoritative test status see READINESS.md and .machine_readable/6a2/STATE.a2ml.

Executive Summary

This report documents the testing of the JanusKey project as of 2025-12-29, a reversible file operations system with cryptographic key management. The tests recorded here passed at that time; see the archival warning above for why this no longer reflects project status.

Metric Result

Build Status

PASSED (release mode)

Unit Tests

31/31 PASSED

Integration Tests

N/A (none defined)

CLI Tests

17/17 PASSED

Clippy Lints

3 warnings, 0 errors

Code Coverage

Not measured (no coverage tool configured)

Build Results

Release Build

$ cargo build --release
Finished `release` profile [optimized] target(s) in 5m 17s

Compiler Warnings (1):

  • src/keys.rs:187 - Field root_path is never read in KeyManager struct

Build Artifacts:

Binary Size Purpose

jk

1.8 MB

Main CLI for reversible file operations

jk-keys

1.4 MB

Cryptographic key management CLI

Unit Test Results

Test Summary

$ cargo test

running 23 tests (src/lib.rs)
... all passed

running 0 tests (src/main.rs)
... ok

running 8 tests (src/keys_cli.rs)
... all passed

test result: ok. 31 passed; 0 failed; 0 ignored

Test Breakdown by Module

Attestation Module (attestation.rs)

Test Name Result Duration

test_audit_log_init

PASSED

<1s

test_audit_log_events

PASSED

<1s

test_audit_log_chain_integrity

PASSED

<1s

test_key_history

PASSED

<1s

Content Store Module (content_store.rs)

Test Name Result Duration

test_store_and_retrieve

PASSED

<1s

test_deduplication

PASSED

<1s

test_content_hash

PASSED

<1s

test_store_compressed

PASSED

<1s

Metadata Module (metadata.rs)

Test Name Result Duration

test_metadata_store

PASSED

<1s

test_operation_metadata_creation

PASSED

<1s

test_last_undoable

PASSED

<1s

Operations Module (operations.rs)

Test Name Result Duration

test_modify_and_undo

PASSED

<1s

test_copy_and_undo

PASSED

<1s

test_delete_and_undo

PASSED

<1s

test_move_and_undo

PASSED

<1s

Transaction Module (transaction.rs)

Test Name Result Duration

test_cannot_begin_while_active

PASSED

<1s

test_transaction_commit

PASSED

<1s

test_transaction_lifecycle

PASSED

<1s

Keys Module (keys.rs)

Test Name Result Duration

test_key_manager_init

PASSED

<1s

test_key_generation_and_retrieval

PASSED

<1s

test_key_rotation

PASSED

<1s

test_wrong_passphrase

PASSED

~60s (intentional due to Argon2)

Note
The test_wrong_passphrase test takes ~60 seconds due to the intentional computational cost of Argon2id key derivation (OWASP-recommended parameters: 64MB memory, 3 iterations, 4 parallel lanes).

Library Tests (lib.rs)

Test Name Result Duration

test_init_and_open

PASSED

<1s

CLI Integration Tests

Test Script Execution

All 17 CLI integration tests passed successfully.

jk CLI Tests

Test Command Result

Version

jk --version

jk 1.0.0

Help

jk help

Full help displayed

Init

jk -C <dir> init

Directory initialized

Status

jk -C <dir> status

Status displayed

Delete

jk -C <dir> --yes delete file.txt

File deleted, reversible

History

jk -C <dir> history

History displayed

Undo

jk -C <dir> undo

Operation reversed

Move

jk -C <dir> --yes move src dst

File moved

Copy

jk -C <dir> --yes copy src dst

File copied

Transaction Begin

jk -C <dir> begin "name"

Transaction started

Transaction Preview

jk -C <dir> preview

Pending operations shown

Transaction Rollback

jk -C <dir> rollback

All operations reversed

Modify

jk -C <dir> --yes modify "s/old/new/" file

Content modified

jk-keys CLI Tests

Test Command Result

Version

jk-keys --version

jk-keys 1.0.0

Help

jk-keys help

Full help displayed

Status

jk-keys -d <dir> status

Status displayed (not initialized)

Code Quality Analysis

Clippy Results

$ cargo clippy
warning: 3 warnings generated

Library Warnings:

  1. needless_borrows_for_generic_args (src/attestation.rs:187)

    &key can be simplified to key

  2. should_implement_trait (src/content_store.rs:30)

    Method from_str should implement std::str::FromStr trait

  3. dead_code (src/keys.rs:187)

    Field root_path is never read

Binary Warnings (jk):

  • 16 warnings related to ptr_arg (using &PathBuf instead of &Path)

  • 2 warnings for to_string_in_format_args

  • 1 warning for unnecessary_map_or

Binary Warnings (jk-keys):

  • 2 warnings for ptr_arg (using &PathBuf instead of &Path)

Dead Code Analysis

The following code is defined but never used:

Location Item Reason

src/keys.rs:187

KeyManager::root_path

Field stored but never accessed

src/keys.rs:373

KeyManager::retrieve()

Method implemented for future use

src/keys.rs:481

KeyManager::revoke_with_reason()

Method implemented for future use

src/attestation.rs:271

AuditLog::log_key_retrieved()

Method implemented for future use

Feature Coverage

Core Features Tested

Feature Unit Tests CLI Tests

File Deletion (reversible)

Yes

Yes

File Modification (reversible)

Yes

Yes

File Move/Rename (reversible)

Yes

Yes

File Copy (reversible)

Yes

Yes

Undo Operations

Yes

Yes

Transaction Support

Yes

Yes

Transaction Rollback

Yes

Yes

Content Store

Yes

N/A

Content Deduplication

Yes

N/A

Metadata Persistence

Yes

N/A

Operation History

Yes

Yes

Cryptographic Features Tested

Feature Status

Key Generation (AES-256-GCM)

Tested

Key Generation (Ed25519)

Tested

Key Generation (X25519)

Tested

Key Rotation

Tested

Key Revocation

Tested

Passphrase Derivation (Argon2id)

Tested

HMAC-SHA256 Attestation

Tested

Audit Log Chain Integrity

Tested

Untested Features

The following features exist in the codebase but lack dedicated tests:

  1. Delta Module (src/delta.rs)

    • Line-based diff computation

    • Block-based diff computation

    • Delta application

  2. Obliteration Module (src/obliteration.rs)

    • Secure file overwrite

    • GDPR Article 17 compliance proofs

    • Batch obliteration

  3. Garbage Collection (jk gc command)

    • Cleanup of old operations

    • Content store pruning

Performance Observations

Operation Observed Behavior

Build (release)

~5 minutes (includes dependency compilation)

Full test suite

~160 seconds total (dominated by Argon2 tests)

Single undo operation

<10ms

Transaction rollback (2 ops)

<50ms

Content store write

<5ms (small files)

Security Analysis

Cryptographic Standards

  • Key Derivation: Argon2id (OWASP-recommended parameters)

  • Encryption: AES-256-GCM with authenticated additional data

  • Hashing: SHA-256 for content addressing

  • Attestation: HMAC-SHA256 for audit log integrity

Secure Deletion

The obliteration module implements DoD 5220.22-M standard:

  • 3-pass overwrite (zeros, ones, random)

  • Cryptographic proof of deletion

  • Audit trail preservation

Recommendations

High Priority

  1. Add unit tests for delta.rs module

  2. Add unit tests for obliteration.rs module

  3. Fix clippy warnings to improve code quality

Medium Priority

  1. Remove or document unused fields (root_path, etc.)

  2. Implement std::str::FromStr for ContentHash

  3. Add integration tests for garbage collection

Low Priority

  1. Add code coverage measurement

  2. Add benchmarks for performance-critical paths

  3. Consider using &Path instead of &PathBuf in function signatures

Conclusion

JanusKey passes all defined unit tests (31/31) and CLI integration tests (17/17). The codebase demonstrates solid implementation of reversible file operations with cryptographic guarantees. The main areas for improvement are:

  1. Expanding test coverage to delta and obliteration modules

  2. Addressing dead code and clippy warnings

  3. Adding integration tests for edge cases

The project is suitable for production use with the caveat that the untested modules (delta, obliteration) should be exercised in staging environments before production deployment.

Appendix: Test Environment

Component Version/Details

Rust Toolchain

Stable

Platform

Linux 6.17.12-300.fc43.x86_64

Test Date

2025-12-29

Test Duration

~10 minutes (including builds)