Skip to main content

omraade

Omraade ([ɔmroːdeː], normally spelled område), from the Swedish word for "area", is an application that injects secrets defined via references in environment variables securely from a backend secret store. By storing references to a secret's location within a secret store rather than its content itself, a secret's actual content cannot simply be read from the environment (or an .env file etc.) by other applications. Instead, omraade then requests the referenced content from the secret store.

The most common usage for injection is running another command while only resolving secret references during the command's execution (i.e., during its runtime), discarding the resolved environment afterwards.

Usage

This project provides a command-line application omraade, either as a Python application, or optionally as a compiled binary independent of a local Python environment.

The application supports a number of command-line arguments, which can be listed via --help. The application uses subcommands to dispatch specific functionality, and subcommand-specific arguments can be listed via <subcommand> --help:

usage: omraade [-h] [--scheme SCHEME] [--backend {keepass}] [--ask {password,keyfile} [{password,keyfile} ...]] [-d PATH] [-P PASSWORD] [-K KEYFILE] {git,run} ...

options:
  -h, --help            show this help message and exit

config:
  --scheme SCHEME       Omraade URI scheme, default: omraade
  --backend {keepass}   Omraade secret store backend, default: keepass
  --ask {password,keyfile} [{password,keyfile} ...]
                        Interactively get argument(s) from user input, default: []

keepass:
  -d, --database PATH   Keepass database path
  -P, --password PASSWORD
                        Keepass database password
  -K, --keyfile KEYFILE
                        Keepass database keyfile

subcommands:
  {git,run}
    git                 Act as a git credentials helper
    run                 Wrap command execution with resolved environment secrets

The application itself can also be configured via environment variables, which have to start with the prefix OMRAADE_, followed by the option, with all parts of the variable separated by underscores (_). For example, to provide the database path via ENV, the following invocations are equivalent:

# Generic ENV via `export` followed by application call
export OMRAADE_DATABASE=/dev/shm/example.kdbx
omraade run --password "Example password" -- printenv
# In-line ENV during application call
OMRAADE_DATABASE=/dev/shm/example.kdbx omraade run --password "Example password" -- printenv
# Explicit command-line argument during application call
omraade run --database /dev/shm/example.kdbx --password "Example password" -- printenv

If both an environment variable and a command-line argument are present, CLI arguments take precedence and override applicable ENVs. Arguments that can be specified multiple times can be provided via ENVs as well; in this case, elements can be separated with semicolons (;), e.g., OMRAADE_ASK='password;keyfile'.

Certain arguments (namely those related to secret store credentials) can also be supplied interactively. This mode is enabled by passing --ask=<argument>, e.g. --ask=password --ask=keyfile, to request interactive input from the user, instead of outright providing credentials on the command-line or via ENV.

Subcommands

The following subcommands are currently available:

command description
git Act as a git credentials helper (providing username/password to git)
run Wrap command execution with resolved environment secrets

Example

Let's assume that secrets are stored in a local Keepass database. The database's filename can be specified via --database <filename>, and its password via --password. With this information, omraade is able to find and decrypt the database.

References to secrets contained within this database can then be stored as arbitrary environment variables, referencing the omraade URI scheme, e.g.:

export TEST_FOO="omraade:/First/Second/Push#token"

This instructs omraade to look for a secret with the title Push, located in the nested groups First -> Second. The URI fragment further instructs omraade to return the value from the token attribute (if no fragment is specified, omraade will return the password attribute for Keepass secrets).

In order to wrap the command printenv by running omraade run --database <filename> --password <password> -- printenv, the omraade application first unlocks the relevant database, then replaces all valid omraade URIs with their resolved values from the Keepass database, and sets this as the active environment for the printenv command. The environment is not exported, so as soon as the wrapped command returns, omraade terminates, thus both discarding the resolved values in its temporary environment and closing the open database again.

Secret Stores

The following secrets stores are currently supported as omraade secret stores:

Backend Description Reference
Keepass An encrypted XML-based database format https://keepass.info/

Development

This project is written in python3. It uses uv for dependency management, pytest for testing, black for formatting, and nuitka for binary compilation.

Metadata

Release files for omraade 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for omraade 2.0.1
File Interpreter ABI Platform Actions
omraade-2.0.1-py3-none-any.whl Python 3 none any Details for omraade-2.0.1-py3-none-any.whl

Release files / omraade-2.0.1-py3-none-any.whl

Download URL omraade-2.0.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bd40cd855f75fba26514177cee34454c234556acfe774bf0e3dbf023351364a
BLAKE2b-256 checksum
How to use checksums
a9b18b46520644dde086ca771030a6a508c3743f9ed29918fd69ad72c2bdf922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.10

Security for omraade 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page