Skip to main content

Secure heartbeat client for the Nuclei monitoring ecosystem

Project description

hb-client

A secure, high-reliability heartbeat client for monitoring your systems using hbserver and hbwatcher.

Project Scope

This repository contains only the Python client library and CLI for sending heartbeat packets and managing local enrollment keys.

Related repositories:

  • hbserver (hb_backend): API/authentication and key lifecycle services
  • hbwatcher (hb_watcher): monitoring process that evaluates heartbeat data

Installation

pip install hb-client

See MIGRATION.md if upgrading from older distribution or config paths.

This installs:

  • the Python package hb_client
  • the CLI command hbclient

Quick Start

As a library

from hb_client import HbClient, HbConfig

config = HbConfig(server="hb.example.com", serverport=8333)
client = HbClient(name="my-service", interval=60, config=config)
client.send(task="deployment-complete")
client.close()

From the CLI

hbclient --server-url https://hb.example.com:8333 login
hbclient --server-url https://hb.example.com:8333 status
hbclient send --app my-service --task deploy --interval 60

Features

  • AES-GCM encrypted UDP transport with CRC32 integrity
  • OAuth Device Flow for key management
  • Secure by default with strict_security=True
  • Transparent DNS resolution with configurable refresh intervals
  • Deterministic key rotation with jitter to prevent thundering herd
  • Atomic file I/O for crash-safe credential storage
  • Human-readable duration parsing (e.g., 6h, 2.5d, 3w)

Configuration

Enrollment keys are stored under:

  • Linux: $XDG_CONFIG_HOME/hbclient/ or ~/.config/hbclient/
  • macOS: ~/Library/Application Support/hbclient/
  • Windows: %APPDATA%/hbclient/

Security Mode (strict_security)

HbClient accepts strict_security (default: True). If enrollment is missing, construction raises RuntimeError with guidance to run:

hbclient --server-url https://hb.example.com:8333 login

CLI Reference

hbclient [--server SERVER] [--serverport PORT] [--server-url URL] COMMAND

Development

pip install -e ".[dev]"
make test
make pre-release

Releasing

pip install -e ".[release]"
cz bump
make pre-release
python -m twine upload dist/hb_client-<version>*

License

Apache-2.0 — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hb_client-0.5.6.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hb_client-0.5.6-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file hb_client-0.5.6.tar.gz.

File metadata

  • Download URL: hb_client-0.5.6.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hb_client-0.5.6.tar.gz
Algorithm Hash digest
SHA256 17f2be08578989eef6498f4f2eef8f438db71ba25ee1abf0e645f45acefef9f1
MD5 4a1827341d77a90734d0b02e300a8a9a
BLAKE2b-256 e9996279643049dd206cb968944d0e936a932e650c847830bea48c5715119ecf

See more details on using hashes here.

Provenance

The following attestation bundles were made for hb_client-0.5.6.tar.gz:

Publisher: release.yml on willp/heartbeat-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hb_client-0.5.6-py3-none-any.whl.

File metadata

  • Download URL: hb_client-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hb_client-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5806d59f5033011b398c92e356ecd034252fa249f16485f343f1fb6a5bfc663b
MD5 188c86e22d8e61b6174c884eb22d2c9c
BLAKE2b-256 ce4d7ecffb21c8d1144b1fdcbb53e88e69b66dfba0a52cfe5f3773e1935d1f80

See more details on using hashes here.

Provenance

The following attestation bundles were made for hb_client-0.5.6-py3-none-any.whl:

Publisher: release.yml on willp/heartbeat-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page