Application security · CASE STUDY

Cofre

Case study of a credential manager with encryption and access control.

The challenge

Study protected storage and access control for confidential information.

The solution

Masked credentials, optional multifactor authentication and access event logging.

Architecture

TypeScript application with PostgreSQL and authenticated server-side encryption.

  1. React / TypeScript
  2. Server / authentication
  3. PostgreSQL

Main features

  • Credential organization by project and personal area.
  • Masked secrets in the interface, controlled reveal and copy actions.
  • Optional multi-factor authentication and access event logging.

Technical decisions and limitations

  • Authenticated AES-256-GCM encryption takes place on the server, keeping the key away from the frontend.
  • Authorization distinguishes project credentials from personal records.
  • Sensitive operations are audited. Public registration remains closed.

Availability

Source code
Private
Demo
Not published
Case study
Available
Status
Personal use

Context and problem

Project and personal credentials end up in spreadsheets and notes. Cofre stores encrypted secrets and logs every view.

How it works

  1. Login (sign-up closed)
  2. Projects and Personal
  3. Masked secret
  4. Reveal or copy
  5. Audit event

Business rules

  • The first account becomes administrator only if the e-mail matches INITIAL_ADMIN_EMAIL.
  • Private credentials stay with the owner and administrators. Sharing respects individual grants.
  • A temporary password blocks the vault until a confirmed change.
  • The last administrator cannot be removed or demoted.

Technical challenges and solutions

  • Challenge: Never storing a secret in plain text. Solution: AES-256-GCM encryption on the server, with a master key independent of the auth secret and versioned (VAULT_MASTER_KEY_Vn).
  • Challenge: Auditing without losing consistency. Solution: The change and its audit event are written in the same transaction.
  • Challenge: Protecting login and account. Solution: Rate limiting on /sign-in/email, optional MFA/TOTP with recovery codes, and session revocation on password change.

Security and privacy

  • The master key never reaches the frontend, logs, URLs or commits.
  • Public sign-up is closed, with users provisioned internally.
  • Viewing and copying secrets produces an audit trail.

Tests and evidence

  • Five test files in scripts/: database backup, brand check, browser smoke verdict, authentication invariant and PWA plugin. Existence confirmed from the repository file listing; the tests were not run in this audit. This case study does not claim full coverage.

Lessons learned

  • Vault security is more about access policy and auditing than isolated encryption.
  • A single transaction for data and audit avoids an incomplete trail.

Current status

Personal use, with private code and no public sign-up. This presentation is not a certification or independent security audit. Vault records never appear here.

Documented evidence

The architecture and controls are documented in the private repository. This case study is not an independent security audit or certification.

Login screen, captured in an isolated test environment, no real data.
Empty project catalog, captured in an isolated test environment, no real data.