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.3.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.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hb_client-0.5.3.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.3.tar.gz
Algorithm Hash digest
SHA256 d4d2a28dc4af0b3303c1ebfda51d90234831dd4e02e1c3417a20fd76d9544425
MD5 f26fe0e1f0470f1f4233954bc3b6de82
BLAKE2b-256 3c042ed57f5d50fcb3af493747a3b09ec7074ca3d2948053e09f5a29c9792386

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hb_client-0.5.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee961e489d65233dd719f87be84f633963773bf4916117adf68f655a1c87cb2
MD5 c71159992f19f3d1d9d7275faca4f4d0
BLAKE2b-256 13803257eb03ca1b3f7b11c9890aa93104a02a28c5dcb39fe54ab8df5ba1596e

See more details on using hashes here.

Provenance

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