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.5.tar.gz (21.8 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.5-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hb_client-0.5.5.tar.gz
  • Upload date:
  • Size: 21.8 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.5.tar.gz
Algorithm Hash digest
SHA256 125cef805ff92a29d9e0cc9d412e060ff5fa686a0956807497a3e386e72b6b22
MD5 e5e554e8f887bb535d843eb536340bc2
BLAKE2b-256 779c9d6b3419eae8911331dc3e68054d4314c7ff53f52076338698ce0a20c560

See more details on using hashes here.

Provenance

The following attestation bundles were made for hb_client-0.5.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: hb_client-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a982b5192ced3c490e1b363659a97a6b5ac990a3a4d2bc2426fbd20807168f32
MD5 31ebf7ad0f5781e5299034ac01c9296b
BLAKE2b-256 b619fda137f6f60eb62bb49e4bf75181be45299f70d50533935db372a9c392c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hb_client-0.5.5-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