MCPcopy Index your code
hub / github.com/cossacklabs/acra

github.com/cossacklabs/acra @0.96.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.96.0 ↗ · + Follow
7,851 symbols 26,516 edges 516 files 3,288 documented · 42% updated 2mo ago0.96.0 · 2024-09-09★ 1,48214 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Acra: database security suite Database protection suite with field level encryption and intrusion detection.


GitHub release Circle CI Coverage Status godoc

Server platforms Client platforms Install on DigitalOcean

Acra Engineering Examples Documentation and tutorials Installation Acra feedback

What is Acra

Acra — database security suite for sensitive and personal data protection.

Acra provides application-level encryption for data fields, multi-layered access control, database leakage prevention, and intrusion detection capabilities in one suite. Acra was specifically designed for distributed apps (web, server-side and mobile) that store data in one or many databases / datastores.

Perfect Acra-compatible applications Typical industries
Web and mobile apps that store data in a centralised database or object storage
  • Healthcare, patient apps
  • Finance, fintech, neobanking
  • SaaS
  • Critical infrastructures
  • Apps with > 1000 users
IoT apps that collect telemetry and process data in the cloud
High-load data processing apps

Acra gives you tools for encrypting each sensitive data record (data field, database cell, json) before storing them in the database / file storage. And then decrypting them in a secure compartmented area (on Acra side). Acra allows to encrypt data as early as possible and operate on encrypted data.

Acra's cryptographic design ensures that no secret (password, key, etc.) leaked from the application or database will be sufficient for decryption of the protected data. Acra minimises the leakage scope, detects unauthorised behavior, and prevents the leakage, informing operators of the incident underway.

This is Acra Community Edition, it's free for commercial and non-commercial use, forever.

Major security features

  • Application-level encryption
  • encryption on client-side and/or Acra-side – each data field is encrypted using unique encryption keys.
  • Selective encryption
  • you select which columns to encrypt to balance good security and performance.
  • Fast and reliable crypto
  • two crypto-envelopes: AcraBlocks and AcraStructs. AcraBlocks are fast symmetric containers, use them by default. AcraStructs are asymmetric containers, use them for client-side encryption.
  • Searchable encryption
  • search through encrypted data without decryption. Designed for exact queries, based on AES-GCM and blind index.
  • Masking / anonymization
  • use full or partial masking to remove or mask sensitive data.
  • Tokenization
  • substitute sensitive data with a token and match it to original only when needed.
  • Basic key management tools
  • built-in tools for key generation, export, backup, rotation, etc.
  • Blocking suspicious SQL queries
  • through a built-in SQL firewall.
  • Intrusion detection
  • using poison records (honey tokens) to warn about suspicious behaviour.
  • Key rotation without data re-encryption
  • available for Acra Enterprise users.
  • KMS support
  • Cryptographically protected audit log
  • Acra delivers different layers of defense for different parts and stages of the data lifecycle. This is what defence in depth is – an independent set of security controls aimed at mitigating multiple risks in case of an attacker crossing the outer perimeter.

    Multiple ways to integrate

  • AcraServer: transparent SQL proxy
  • all Acra features packed into a database proxy that parses traffic between an app and a database and applies security functions where appropriate.
  • AcraTranslator: encryption-as-a-service API
  • API server, that exposes most of Acra’s features as HTTP / gRPC API with traffic protection.
  • AcraConnector: transport authentication and encryption
  • optional client-side service for authentication and transport encryption.
  • AnyProxy: use Acra with any database / datastore via SDK ᵉ
  • available for Acra Enterprise users.
  • AcraWriter: SDK for client-side encryption ᵉ
  • AcraReader: SDK for client-side decryption ᵉ
  • SDK for AcraTranslator: client-side SDK that encapsulates AcraTranslator's API ᵉ
  • Bulk API for AcraTranslator
  • Developer and DevOps friendly

  • Secure default settings
  • your infrastructure is secure from the start without additional configuring.
  • Cryptography is hidden under the hood
  • no risk of selecting the wrong key length or algorithm padding.
  • Automation-friendly
  • easy to configure and automate.
  • Quick infrastructure integration
  • via binary packages or Docker images.
  • Easy client-side integration
  • requires minimal changes in the application code.
  • Logging, metrics, tracing
  • throughout all Acra components; compatible with ELK stack, Datadog, Graylog, Prometheus, Grafana, Jaeger.
  • No vendor lock
  • rollback utilities to decrypt database into plaintext.
  • Demos and examples
  • numerous web-based and Docker-based example projects available.
  • DigitalOcean Acra 1-Click App
  • run AcraServer in your DigitalOcean cloud.
  • Managed solution available
  • we can setup and manage Acra for you.

    Cryptography

    Acra relies on our cryptographic library Themis, which implements high-level cryptosystems based on the best available open-source implementations of the most reliable ciphers. Acra strictly doesn't contain self-made cryptographic primitives or obscure ciphers.

    To deliver its unique guarantees, Acra relies on the combination of well-known ciphers and smart key management scheme. See Cryptography and key management.

    Default crypto-primitive source OpenSSL
    Supported crypto-primitive sources ᵉ BoringSSL, LibreSSL, FIPS-compliant, GOST-compliant, HSM
    Storage encryption (AcraBlocks) AES-256-GCM + AES-256-GCM
    Storage encryption (AcraStructs) AES-256-GCM + ECDH
    Transport encryption TLS v1.2+ or Themis Secure Session
    KMS integration Amazon KMS, Google Cloud Platform KMS, HashiCorp Vault, Keywhiz, etc

    ᵉ — available in the Enterprise version of Acra only. Drop us an email to get a full list of features and a quote.

    How does Acra work?

    Acra consists of several services and utilities. Acra services allow you to construct infinitely sophisticated data flows that are perfectly suited to your exact infrastructure. Depending on your architecture and use case, you might need to deploy only basic services or all of them.

    • Security enforcement components: services where "encryption happens". One of them is required: AcraServer, AcraTranslator, AnyProxy, or client-side SDKs.
    • Key storage: datastores where Acra keeps encrypted keys: Redis, table in your database, any KV store. One of them is required.
    • Master key storage: KMS, Vault. One of them is strongly recommended.
    • Additional services and utils: key management utils, data migration scripts, transport security service, policy management tools. Any of them are optional.

    Refer to Acra-in-depth / Architecture to learn more about Acra components. Refer to Acra-in-depth / Data flow to see more typical Acra-based dataflows and deployments.

    Protecting data in SQL databases using AcraServer

    Let's see [the simples

    Extension points exported contracts — how you extend this code

    Step (Interface)
    Step execute one step of flow [7 implementers]
    decryptor/postgresql/testutils/frontend.go
    QueryObserver (Interface)
    QueryObserver observes database queries and is able to modify them. Methods should return "true" as their second bool re [7 …
    decryptor/base/observers.go
    CertVerifier (Interface)
    CertVerifier is a generic certificate verifier [6 implementers]
    network/cert_verifier.go
    WrappedConnection (Interface)
    WrappedConnection interface implemented by connection wrappers to access to wrapped connection [8 implementers]
    network/connection.go
    ListenerWrapper (Interface)
    ListenerWrapper interface allows to access wrapped listener by another listener implementation [8 implementers]
    network/listenerWrapper.go
    DataEncryptor (Interface)
    DataEncryptor replace raw data in queries with encrypted [14 implementers]
    encryptor/dataEncryptor.go
    DBDataCoder (Interface)
    DBDataCoder encode/decode binary data to correct string form for specific db [11 implementers]
    encryptor/dbDataCoder.go
    TokenEncryptor (Interface)
    TokenEncryptor interface used by storage implementations to encrypt data before saving [14 implementers]
    pseudonymization/storage/storageTokenEncryptor.go

    Core symbols most depended-on inside this repo

    Column
    called by 438
    examples/cpp/libs/catch.hpp
    New
    called by 401
    decryptor/base/proxy.go
    Error
    called by 351
    sqlparser/sql.go
    Equal
    called by 323
    sqlparser/ast.go
    execute
    called by 276
    tests/base.py
    Run
    called by 207
    decryptor/postgresql/testutils/frontend.go
    Debug
    called by 190
    cmd/acra-translator/common/config.go
    Myprintf
    called by 187
    sqlparser/tracked_buffer.go

    Shape

    Method 4,403
    Function 1,945
    Class 599
    Struct 572
    Interface 200
    TypeAlias 84
    Enum 24
    FuncType 24

    Languages

    Go69%
    C++17%
    Python13%
    Java1%
    Ruby1%
    PHP1%

    Modules by API surface

    examples/cpp/libs/catch.hpp1,141 symbols
    tests/test.py371 symbols
    sqlparser/ast.go303 symbols
    sqlparser/ast_methods.go197 symbols
    cmd/acra-translator/grpc_api/api.pb.go192 symbols
    tests/test_common.py126 symbols
    cmd/acra-translator/grpc_api/api_grpc.pb.go115 symbols
    tests/base.py110 symbols
    tests/test_tokenization.py106 symbols
    tests/test_searchable_transparent_encryption.py101 symbols
    keystore/keystore.go91 symbols
    keystore/filesystem/server_keystore.go85 symbols

    Datastores touched

    (mysql)Database · 1 repos

    For agents

    $ claude mcp add acra \
      -- python -m otcore.mcp_server <graph>

    ⬇ download graph artifact

    Ask about this repo answers extend the page