Skip to main content

cliffracer-backdoor

A live debug console inside a running cliffracer service, and the client that connects to it.

from cliffracer import CliffracerService
from cliffracer_backdoor import BackdoorExtension

class Orders(CliffracerService):
    backdoor = BackdoorExtension(enabled=True, port=0)

Then, from a shell on the same host:

cliffracer-backdoor 127.0.0.1:<port>

port=0 asks the OS for a free port. The bound port is written to the logs and reported in /health under this extension's name.

Settings also come from the environment, with the prefix CLIFFRACER_BACKDOOR_: CLIFFRACER_BACKDOOR_ENABLED, _PORT, _PASSWORD.

Turning it on is a deliberate act

enabled defaults to False. The console evaluates arbitrary Python inside the service process, which makes it a remote code execution endpoint. Turn it on where you want that and leave it off elsewhere.

It binds the literal address 127.0.0.1. A name that resolves to both loopback families would make start_server bind two sockets, and under port=0 each would get a different ephemeral port, so the port reported in /health would answer on only one of them.

The client reports failure

cliffracer-backdoor host:port opens a socket to the endpoint before connecting. When nothing is listening it prints one line to stderr and exits non-zero.

The probe is what gives the command its exit status. BackdoorClient.connect shells out to nc and then telnet, and when both are missing it prints instructions and returns normally.

Inside the console

service is the live instance. inspect_service(), inspect_nats() and show_handlers() summarise it. await service.some_rpc() calls a handler directly. help_backdoor() lists the rest.

Extending it

ServiceInspector and NATSInspector build the console's namespace. Subclass either, or pass your own callables, to show an operator whatever your service should show.

Installed from PyPI, versioned in lockstep with cliffracer.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

cliffracer_backdoor-1.0.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file cliffracer_backdoor-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cliffracer_backdoor-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cliffracer_backdoor-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1076ac783e9df3500e75bb6ccb3b012f5a4a898a5f7f56e4b5f2d6133f1ddd3
MD5 a045c82ca5a916dc0a7efac889c57752
BLAKE2b-256 21f5bc2250f8e384cf7639d1e0a897649e5088bd9347b44275b5ae0c8ffd78ab

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 file

0.0.1

1 file

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