k6's REST API is a test control surface with no safe public default
k6 executes load tests from scripts and can expose a REST API for controlling a running test. The official documentation says the REST API server is off by default starting in k6 v2.0.0 and describes it as an accessible API outside the supported stability surface. A test runner may also use a Grafana Cloud token or a local output endpoint.
That combination creates a management boundary. A public REST API can let an unauthorized user start tests, change options, or inspect run state. A cloud token can authorize test execution or result uploads against a shared account. The runner should be treated as automation infrastructure, not as a public web application.
A product name is weak evidence
The title k6 is short and ambiguous. A title query can match documentation, a dashboard, a product with k6 in its marketing text, or an unrelated page. Use it only as a lead. Compare the response with a confirmed application fingerprint if one exists, and record the exact host.
No live count was collected for this run. A query result does not prove that the REST API is enabled or that a test token is present. The run inventory should include the API port, bind address, authentication mode, and expected operators.
Protect the runner
Keep the REST API on localhost or a private test network. If remote control is required, place it behind strong authentication and TLS, and expose only the required endpoints. Do not publish a test runner on the same public hostname as a production application.
Store Grafana Cloud or output tokens in a secret manager, not in a script or repository. Limit token scope and rotate it after a shared runner is rebuilt. Separate the account used for test results from the account used to administer production dashboards.
Review --web-host, --address, and equivalent options in the actual command line. Inspect container port mappings and Kubernetes services as well as the k6 configuration. A runner that binds to localhost inside a pod can still be made public by a service.
Review test impact
A load test can create real traffic and real cost. Record approval for target URLs, request rate, duration, and stop conditions. Do not allow an API caller to change the target to a third-party system. Use a network policy that allows the runner to reach only approved test endpoints.
If the control API was exposed, terminate the test, rotate tokens, and review cloud or target logs for unexpected load. Check whether results were uploaded to an unauthorized destination. Inspect the runner for modified scripts or extensions.
Limits
k6 may not expose the REST API at all. A title match is especially weak because the name is short. A private test result does not prove that the runner is safe, and a public result does not prove that the API is reachable.
Top comments (0)