Skip to content

As a security team, I need offline authentication to be secure #35

Description

@guimard

User Story

As the security team,
I need offline authentication to be cryptographically secure,
So that cached credentials cannot be easily compromised.

Acceptance Criteria

  • Argon2id for password hashing (memory-hard, resists GPU attacks)
  • AES-256-GCM for data encryption (authenticated encryption)
  • PBKDF2 for key derivation (standard, proven)
  • Secure random number generation for salts/IVs
  • Cache files with restricted permissions (0600)
  • Tamper detection via GCM auth tag
  • Unit tests for crypto operations

Technical Details

Crypto Specifications

Password Hashing (Argon2id)

  • Memory: 19 MiB (19456 KiB)
  • Iterations: 2
  • Parallelism: 1
  • Output: 32 bytes
  • OWASP recommended parameters

Key Derivation (PBKDF2-HMAC-SHA256)

  • Iterations: 100,000
  • Salt: 16 bytes (random per user)
  • Output: 32 bytes (AES-256 key)

Encryption (AES-256-GCM)

  • IV: 12 bytes (random per write)
  • Auth tag: 16 bytes
  • Already used by secret_store module

Security Mitigations

Threat Mitigation
GPU/ASIC attacks Argon2id memory-hard
Cache theft Encrypted, unusable without password
Tampering GCM authentication tag
Stale creds Configurable expiration
Weak passwords Minimum length enforcement
File access 0600 permissions, root only

Limitations

  • Compromised local password = access to cached data
  • No immediate revocation (must wait for expiration)
  • MFA not available offline
  • Should use short expiration for sensitive data

Tests to Implement

  • test_offline_cache.c
    • Hash/verify password
    • Encrypt/decrypt user data
    • Expiration checking
    • Tamper detection
    • Invalid password rejection

Component

Repo: llng-pam-module (C)
Files: tests/test_offline_cache.c (new)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpam-moduleChanges in the PAM module (C)phase-7Phase 7: Authentification Offlineuser-storyUser story

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions