Skip to main content

Prefect Keeper

A Prefect block for interacting with Keeper Security's Secrets Manager.

Description

This project provides a custom Prefect block that allows interaction with Keeper Security's Secrets Manager. It enables secure retrieval of secrets stored in Keeper by record UID or record title within Prefect workflows.

Features

  • Seamless integration with Keeper Security's Secrets Manager
  • Retrieve secrets by record UID or record title
  • Secure handling of KSM configuration
  • Easy configuration and intuitive usage

Installation

To install this package, use the following command:

uv add prefect-keeper

Usage

Configuration

Before using the block, ensure that you have a valid KSM (Keeper Secrets Manager) configuration. The configuration should be provided as a base64 encoded string.

Saving the Block

To save the Keeper block :

from prefect_keeper import Keeper
from pydantic import SecretStr

# Initialize the Keeper block with your KSM configuration
keeper = Keeper(ksm_config=SecretStr("your-base64-encoded-config"))

# Save the block
keeper.save("my-keeper-block", overwrite=True)

Loading and Using the Block

To load a previously saved block and use its methods:

from prefect import flow
from prefect_keeper import Keeper

@flow
def example_flow():
    # Load the saved block
    keeper = Keeper.load("my-keeper-block")
    
    # Retrieve a secret by record UID
    record = keeper.get_record_by_uid("record-uid-123")
    print(f"Record by UID: {record}")
    
    # Retrieve a secret by record title
    record = keeper.get_record_by_title("My Secret Title")
    print(f"Record by Title: {record}")

if __name__ == "__main__":
    example_flow()

Configuration

The block can be configured with the following parameters:

  • ksm_config: The KSM config provided as a base64 encoded string. This is a required field and should be provided as a SecretStr for security.

Configuration Example

from prefect_keeper import Keeper
from pydantic import SecretStr

keeper = Keeper(
    ksm_config=SecretStr("your-base64-encoded-config")
)

Development

Prerequisites

  • Python 3.10+
  • Uv for dependency management
  • Access to Keeper Security's Secrets Manager

Development Installation

  1. Clone the repository:
git clone https://github.com/patacoing/prefect-keeper.git
cd prefect-keeper
  1. Install dependencies:
uv sync

This project uses just as a way to save and run project-specific commands. You can go to justfile or run just -l to display all available recipes

Contribution

Contributions are welcome! Please open an issue or a pull request for any improvements or fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Metadata

Release files for prefect-keeper 0.1.1

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

Source distribution (sdist)

Source distribution for prefect-keeper 0.1.1
File Size Uploaded
prefect_keeper-0.1.1.tar.gz 162.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-keeper 0.1.1
File Interpreter ABI Platform
prefect_keeper-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 166.6 kB

Release files / prefect_keeper-0.1.1.tar.gz

Download URL prefect_keeper-0.1.1.tar.gz
Size 162.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d350f220490af12bf8f3e60f87f9cfa3a36d2f29a3203482cd3538d08864b73d
BLAKE2b-256 checksum
How to use checksums
f2d16c0d91ebd7d2690c7123963d610355865c2ed63a1d3b69eb0de4828307df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.29

Release files / prefect_keeper-0.1.1-py3-none-any.whl

Download URL prefect_keeper-0.1.1-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76b3cffcc5a4b6dafff0b722acc61f36b711a3f5f2774253af7b4ea2e6f4d52b
BLAKE2b-256 checksum
How to use checksums
9480bc982c5c605f51c948138808830b1222197898dac3f2fbe6ca42d1fe5193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.29

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

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