Skip to content

Encryption at rest in Drizzle Storage module #2662

@ankita-p17

Description

@ankita-p17

Earlier while using Askar for record storage, encryption at rest was handled inherently by the built-in encrypted wallet storage, ensuring that sensitive records/ details in the records(connections keys, credentials details, messages etc.) are encrypted automatically without requiring additional implementation effort.

However, when using the Drizzle Storage Module, encryption at rest is not inherently provided by the storage layer. Data is stored in plaintext unless the implementer adds custom encryption logic.

This creates a security gap compared to the Askar-based setup.

Implementing an optional, configurable field-level encryption at rest in the Drizzle Storage module would help address this gap and improve the overall security posture.

Proposal -

  1. Field-Level Encryption
  • Only configured columns are encrypted
  • Avoids encrypting queryable/indexed fields
  • Supports selective protection of sensitive attributes
  1. Transparent Operation
  • Automatic encryption on save and update
  • Automatic decryption on get, find etc.
  1. Use this feature configuration based
  • Enable this while configuring agent; get from agentContext or from DrizzleStorageModule

Sample configuration -

DrizzleStorageModule({
  encryption: {
    key: process.env.STORAGE_ENCRYPTION_KEY,
    fields: {
      DidCommConnectionRecord: ['metadata', 'invitation'],
      CredentialExchangeRecord: ['metadata'],
      BasicMessage: ['content']
    }
  }
})

I would appreciate feedback and thoughts on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions