Reading width
Wide uses the full column for everything, text, diagrams, code, and exercises. Narrow keeps the standard reading width.
Text size
Scales the body text. Headings and code blocks keep their size.
In this section
0.2 Trust Between a Server and Its Clients
Introduction
Every answer in remote live response rests on two kinds of trust. The client has to trust that the server sending it a query is the real server, because it will run whatever that server asks.
The server has to trust that the rows it receives came from the client they claim to come from, because a finding will name that host. Velociraptor builds both on a small set of keys and certificates that it generates when a deployment is created, and the security of the fleet is the security of those files.
This lesson takes them apart on the lab server: the authority that signs the server's identity, the certificate the client checks, the key each client makes for itself, and the configuration that lets a new machine join. It then shows what a client will do once it trusts the server, and how roles decide which people can make it do that.
Module 2 builds a hardened server on this ground; here the aim is to know which file is a credential and why.
The Configuration Is a Credential
How a client joinsA Velociraptor deployment starts as two configuration files. The server configuration holds everything the server needs, including its private keys.
The client configuration is generated from it and holds what every endpoint needs to find and trust the server: the server URLs, the CA certificate and a nonce that ties the client to this deployment. Instant mode writes both into the datastore folder. Here is what the lab's client configuration gives a client:
$ yq -r '.Client | keys | .[]' client.config.yaml | paste -sd ' ' | fold -s -w 92
ca_certificate darwin_installer level2_writeback_suffix local_buffer max_poll
max_upload_size nanny_max_connection_delay nonce server_urls server_version tempdir_darwin
tempdir_linux tempdir_windows use_self_signed_ssl windows_installer writeback_darwin
writeback_linux writeback_windows
$ yq -r '.Client.server_urls[], .Client.use_self_signed_ssl' client.config.yaml
wss://localhost:8000/
true
There is no private key in that file, and no account or password either. Counting the PEM markers in both files makes the difference plain:
$ grep -c 'PRIVATE KEY' client.config.yaml server.config.yaml
client.config.yaml:0
server.config.yaml:6 Enrollment in Velociraptor is zero-registration: clients are not pre-provisioned, and any machine that runs the client with a working configuration enrolls automatically. The security guide states it in those terms, and the lab shows what it means. A second machine, named ir-lab-2, started the same binary with a copy of the client configuration and its own empty writeback file, and within seconds it was in the client index:
SELECT client_id, os_info.hostname AS Hostname, os_info.system AS OS
FROM clients() ORDER BY HostnameThe client index after a second machine started Velociraptor with a copy of the client configuration. Nobody approved it.
No one approved it, and nothing in the server's interface was asked. That is the right design for a tool that has to reach thousands of endpoints from a software deployment package, and it is also the first thing to understand about the files: the client configuration is not a setting, it is a credential for joining the fleet.
Anyone who copies it from a deployment share can enroll a machine they control, and the rows that machine sends will look like any other client's.
It also explains a detail from lesson 0.1. Instant mode's client enrolled twice because the server has two orgs, and an org is where a client's configuration points it: a deployment with several orgs has a client configuration per org, and each one enrolls machines into that org. Copying the wrong one puts a machine in the wrong tenant, with whatever users and permissions that tenant has.
The countermeasures are operational. The client configuration belongs where credentials belong, enrollment can be closed once a fleet is built, and a client that should not exist is found by reviewing the client index rather than by assuming it is clean.
Three Kinds of Key
The CA, the server and each clientBehind the configuration files sit three kinds of key, each with a different owner and a different blast radius. The first is an internal certificate authority. When a deployment is created, Velociraptor generates a CA with its own certificate and private key, and that CA signs everything the server presents: its own certificate, the API keys and, where mutual TLS is used, a shared client certificate.
One authority signs everything the server presents, and every client carries that authority's certificate. Only the client keys are made somewhere else, on the endpoints themselves.
The second is the server's own certificate. It is always signed by the internal CA and always named VelociraptorServer, whatever host name the server has. Instant mode generated both on the lab server, and openssl reads them out of the server configuration:
$ yq -r '.Client.ca_certificate' server.config.yaml | openssl x509 -noout -subject -issuer -dates
subject=O = Velociraptor CA
issuer=O = Velociraptor CA
notBefore=Dec 2 18:48:48 2026 GMT
notAfter=Nov 29 18:48:48 2036 GMT
$ yq -r '.Frontend.certificate' server.config.yaml | openssl x509 -noout -subject -issuer -dates
subject=O = Velociraptor, CN = VelociraptorServer
issuer=O = Velociraptor CA
notBefore=Dec 2 18:48:48 2026 GMT
notAfter=Dec 2 18:48:48 2027 GMT
Two details are worth reading. The CA is valid for ten years and the server certificate for one, so a long-lived deployment rotates the server certificate while the CA stays put. And the server certificate's issuer is the CA, which is the chain every client checks.
The third kind is the client key. A client makes its own key pair the first time it runs and stores the private key in its writeback file, beside the client ID derived from it:
$ ls Velociraptor.writeback*.yaml
Velociraptor.writeback.ACME.yaml
Velociraptor.writeback.jJefrum98dY%3D.yaml
$ yq -r 'keys | .[]' Velociraptor.writeback.*.yaml | head -n 3
client_id
install_time
private_key
$ yq -r '.private_key' Velociraptor.writeback.*.yaml | head -n 1
-----BEGIN RSA PRIVATE KEY-----
Because the ID is derived from the key, it cannot be claimed by a machine that lacks the key, and the security guide recommends the client ID over the hostname as the identifier to trust for exactly that reason.
Hostnames are set by whoever controls the machine; ir-lab-2 could have called itself ir-lab. The writeback file is therefore also a credential, a narrow one: whoever copies it can impersonate that one client, and nothing more.
The card is also a schedule. The server certificate on the lab expires a year after it was made, and renewing it means signing a new one with the CA, which is the one routine moment the CA key has to be available. A deployment that takes the CA key offline plans for that moment rather than discovering it when clients start refusing a certificate that has expired.
How the Client Checks the Server
Pinning, and the modes that loosen itA client will run any query the server sends, so the most important check in the product is the one the client makes before it listens. In the default mode, the client fetches the server's certificate from /server.pem and verifies that it is named VelociraptorServer and chains to the CA certificate embedded in its configuration.
The guide calls this pinning the server's certificate in the client, and notes what it prevents: a client accidentally talking to a captive portal or a man-in-the-middle proxy.
The same check can be made by hand against the lab server. Save the CA certificate from the client configuration, fetch /server.pem from the frontend port as a client would, and verify one against the other; a TLS handshake on the same port shows what the connection itself negotiated:
$ yq -r '.Client.ca_certificate' client.config.yaml > ca.pem
$ curl -sk https://127.0.0.1:8000/server.pem -o server.pem && openssl x509 -in server.pem -noout -subject
subject=O = Velociraptor, CN = VelociraptorServer
$ openssl verify -CAfile ca.pem server.pem
server.pem: OK
$ openssl s_client -connect 127.0.0.1:8000 -brief </dev/null 2>&1 | grep -E 'Protocol|Ciphersuite|Peer certificate'
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_128_GCM_SHA256
Peer certificate: O = Velociraptor, CN = VelociraptorServer
The chain verifies, the certificate carries the pinned name, and the connection is TLS 1.3. If the verify line said anything other than OK, a client with this configuration would refuse to talk to that server, which is exactly the behavior a deployment should want from it.
That certificate is separate from the TLS certificate on the web listener. The connection itself is TLS, 1.3 by default, and in self-signed mode the same internal chain secures it; a deployment can instead put a publicly trusted certificate on the listener or route through an inspecting proxy. Each choice changes what the client accepts, and the client configuration records which one was made.
The lab's says use_self_signed_ssl is true and its only server URL is wss://localhost:8000/, the websocket form available since 0.72.
The last row of that card deserves its own sentence. Client.insecure_network_trace_file exists for debugging connection problems, and it disables TLS verification for the client's outbound connections. A client shipped with it set will talk to anything that answers on the server's address. The guide warns against deploying it, and checking for it is part of reviewing any client package before it goes out.
An inspecting proxy deserves a moment's thought before it is accommodated. Adding its CA to Client.Crypto.root_certs lets clients work through it, and it also means the proxy can read the outer layer of every exchange and any party holding that proxy CA's key can present a server certificate the clients will accept.
Many estates require it; the decision is better made knowingly than by a ticket that asks for the clients to start working.
Pinning has a cost that shapes every later decision. The CA certificate is baked into every client, so it cannot be replaced without redeploying the fleet. A deployment's CA is, in practice, permanent, which is why the decision about where its private key lives is made once and early.
Messages Inside the Connection
Why TLS is not the whole storyTLS protects the connection, and Velociraptor does not rely on it alone. Every message between a client and the server travels in an inner envelope of its own.
The payload, a list of messages carrying rows, logs and file uploads, is encrypted with a session key using aes_128_cbc. The session key travels in a separate cipher block that is encrypted to the receiver's public key and signed with the sender's private key.
The envelope every message travels in. The inner layers sign as well as encrypt, which is how the server knows which client a message came from.
The signature is the point.
The guide says the inner layer is there to sign the messages as well as to encrypt them, and the signature is what lets the server attribute a message to one client key, and so to one client ID, even if the outer TLS were terminated by a proxy. It is also why a stolen writeback file matters: the key in it is the key that signs that client's messages.
The guide is frank about the inner envelope's age: it uses SHA-1 for its RSA-OAEP padding and HMAC, which it considers acceptable because TLS provides the main protection and the inner layer's job is attribution. That is a sensible reading, and it is also a reason not to weaken the outer layer for convenience: the design assumes both layers are present.
For an investigator, the practical consequence is evidential. A row in a flow is tied to a client ID that is tied to a key that signed the message carrying it. That chain is what lets a report say this host returned this result, and it holds only while the keys behind it are where they should be.
What the Server Can Make a Client Do
Unrestricted VQL on the endpointTrust in Velociraptor runs one way and runs completely. The security guide puts it in a sentence that deserves rereading: as long as a user is able to schedule the collection on the client, the collection can do anything at all. Access checks are enforced on the server; on the client they are disabled, and VQL runs unrestricted on endpoints.
The plainest demonstration is the shell artifact. Linux.Sys.BashShell runs a command through the system shell on the client, and the lab server collected it with the command id; hostname:
SELECT Command, Stdout
FROM source(client_id='C.63286200a9fbf2ff', flow_id='F.DC86G7FRF9N7A',
artifact='Linux.Sys.BashShell')
WHERE Command OR StdoutLinux.Sys.BashShell collected on the lab client with the command id; hostname. The shell ran as root.
The client ran it as root, because Velociraptor clients normally run privileged: that is how they read the whole disk, raw devices and other users' files. Since release 0.77 the shell is a persistent session, so the flow stays in progress and later commands build on earlier ones, which is convenient for an analyst and equally convenient for anyone else who reaches that screen.
The shell is not special. It is only the most obvious artifact that does what every artifact can do: run VQL on the endpoint with the client's privileges. A custom artifact that deletes files, a VQL query that launches a program, an upload of credentials: each is one collection.
That is why the guide treats artifact writers as especially powerful, since writing an artifact is writing code that the fleet will run, and why it reserves the permission to launch programs, EXECVE, for administrators because it can be easily misused.
The same reasoning applies on the server itself. Server artifacts and notebook queries run with the server's privileges, and the guide lists combinations of permissions that amount to running anything there: writing a server artifact and then collecting it, or writing to the server's file system, which can overwrite the access control files that define everyone's roles.
Those permissions are administrator rights by another name, whatever the role that holds them is called.
The conclusion is structural rather than a matter of configuration. A Velociraptor server is the most privileged system in the estate it watches. Whoever controls it, or holds a role that can schedule the right collection, holds every endpoint it manages. The server's patching, its network exposure and its user list are fleet security decisions.
Roles Decide Who Can Ask
Permissions on the serverBecause the client enforces nothing, the server's roles are the only gate. Every user and API identity has roles, and each role is a set of permissions: to view collected data, to run arbitrary queries, to collect from clients, to launch programs, to administer the server.
The lab server had an administrator for the GUI, an administrator for the API and, added for this lesson, a responder with the investigator role and a reviewer with the reader role:
SELECT name, roles FROM gui_users()The lab server's users after two API identities were added for this lesson: a responder with the investigator role and a reviewer with the reader role.
The two new identities show the gate working. The responder scheduled the process list collection without trouble, which is what investigators are for. The same identity was refused the shell, and a reader was refused even a query against the client index:
$ velociraptor --api_config responder.yaml query -v \
"SELECT collect_client(client_id='C.63286200a9fbf2ff', artifacts='Linux.Sys.BashShell',
env=dict(Command='id')).flow_id AS FlowId FROM scope()" 2>&1 | grep collect_client
[INFO] 2026-12-02T18:49:12Z collect_client: PermissionDenied: While collecting artifact (Linux.…
$ velociraptor --api_config reviewer.yaml query "SELECT client_id FROM clients()"
velociraptor: error: query: rpc error: code = PermissionDenied desc = Permission denied: User r…
The server will also say what a role grants. The responder's record shows only its role; asked for its effective permissions, it lists them:
$ velociraptor --config server.config.yaml acl show responder 2>/dev/null
{"roles":["investigator"]}
$ velociraptor --config server.config.yaml acl show --effective responder 2>/dev/null | jq -c .
{"any_query":true,"read_results":true,"label_clients":true,"collect_client":true,"start_hunt":t…
Collecting from clients, starting hunts, running queries and editing notebooks are all there, and launching programs is not, which is the refusal above in the server's own terms. Each refusal names the permission it checked.
The investigator lacked EXECVE, which Linux.Sys.BashShell declares in its required_permissions; that field is how an artifact author demands more than ordinary collection rights, and it is also why the guide says artifact writers can bypass launch controls by editing an artifact's metadata. The reader lacked ANY_QUERY, the permission to run arbitrary VQL at all, which keeps a read-only reviewer to the views the GUI builds for them.
API identities need the same care as people. The lab's two were created with velociraptor config api_client, which writes a file holding a certificate and private key signed by the CA. That file is the identity: whoever has it acts with its role until it is removed, with no password and no second factor.
Automation that runs as an administrator through an API file is an administrator account stored on disk. On 0.77.4 there is one more step: the lab's API identity, created with the administrator role, was refused with requires permission ANY_QUERY until velociraptor acl grant gave it a policy naming both the role and any_query.
The role that can do everything else in the GUI does not, on this release, carry the right to send raw VQL through the API, so that right is now a deliberate grant to a named identity.
The guide adds a structural layer above roles. The root org is more privileged than the others, so access to it belongs only to trusted users, and on shared servers dangerous plugins can be removed entirely with denied_plugins. Least privilege in Velociraptor is therefore three decisions: which role, which org, and which artifacts carry a required_permissions line.
Protecting the Trust Anchor
What follows from all of thisEverything in this lesson converges on a short list. The CA private key mints the server identity the whole fleet trusts, and in a default deployment it sits in the running server's configuration. The guide's advice is to remove CA.private_key from the server configuration and keep it offline, bringing it back only to sign something new.
The client configuration enrolls any machine, so it is handled like a credential, and once a fleet is deployed, new enrollments can be stopped entirely by setting Frontend.resources.enrollments_per_second to -1, at the cost of a restart.
The last row is the one most often left for later. Server bugs in Velociraptor are fleet bugs, and 2026 brought several in exactly the area this lesson covers. The advisory for release 0.77.2 lists authorization fixes that include identity spoofing, impersonation in other orgs through the query plugin, and privilege escalation through a client monitoring artifact.
The release notes for 0.76 now carry a banner telling every server to move to 0.77.3 or later to address multiple CVEs, and 0.77.4, released on 23 November, tightened the same ground again: child orgs read only the secrets shared with them, impersonating artifacts are limited to their creator, and the filestore API requires DATASTORE_ACCESS.
The lab in this course runs 0.77.4, and Module 2 makes the habit behind that choice routine: reading each advisory as it appears, deciding what it exposes in a given deployment, and patching the server before anything else.
None of these controls makes the server less powerful. They make its power belong to fewer people, through fewer keys, on a server that is current. That is the whole of Velociraptor hardening in one sentence, and Module 2 turns it into a configured server.
Asking an Assistant
Turning hardening into a map of secretsAsked how to secure a Velociraptor server, an assistant gives a hardening checklist: single sign-on, TLS, patching, restricted ports, least privilege. Every item is reasonable and none of them answers the question an engineer actually has to settle first, which is which files must be protected and what each would give away.
- You
How do I secure my Velociraptor server?
- Assistant
Put the GUI behind single sign-on, use TLS, keep the server patched, restrict access to the admin port, and give users the least privileged role they need.
- You
I run Velociraptor 0.77.4. For server.config.yaml, client.config.yaml and the client writeback file, tell me what each one would let someone do if they copied it: impersonate the server, impersonate an existing client, or enroll a new client. Name the config keys involved, and tell me how I can check each answer on my own lab server.
- Assistant
server.config.yaml holds CA.private_key and the Frontend private key: with the CA key someone can sign a certificate named VelociraptorServer that every client will accept, so it impersonates the server for the whole fleet. The writeback file holds one client's private key and client ID, so it impersonates that client. client.config.yaml holds no private key, only the CA certificate, the server URLs and the nonce, but enrollment needs nothing more, so it enrolls a new client. To check the last one, copy client.config.yaml to a second machine, point its writeback at a new file and start a client: a new client ID should appear in clients().
- Velociraptor
SELECT client_id, os_info.hostname AS Hostname, os_info.system AS OS FROM clients() ORDER BY Hostnameclient_idHostnameOSC.63286200a9fbf2ffir-lablinuxC.58fa416421585bfair-lab-2linuxThe client index after a second machine started Velociraptor with a copy of the client configuration. Nobody approved it.
The second prompt worked because it named the three files, asked what copying each would allow, and asked how to check the answer. The assistant's reply sorted the files correctly, and it was specific enough to test: it predicted that a copied client configuration would enroll a new client, and the lab produced exactly that.
- Velociraptor 0.77.4pins the version, since config keys move between releases
- server.config.yaml, client.config.yaml and the client writeback filenames the three files that actually hold the keys
- if they copied itturns a general hardening question into a threat with a consequence
- impersonate the server, impersonate an existing client, or enroll a new clientgives three outcomes to sort each file into
- how I can check each answer on my own lab serverasks for the test, so the answer is not taken on trust
The assistant saved time on the part it is good at, naming configuration keys and connecting them to consequences. The part that made the answer usable was the check, because a claim about what a file allows is only as good as the moment someone tried it.
- HoldsThe server config holds the CA keyCA.private_key is present in the instant-mode server.config.yaml
- HoldsThe client config holds no private keyits Client section carries the CA certificate, URLs and nonce only
- HoldsA copied client config enrolls a new clientC.58fa416421585bfa appeared on ir-lab-2 with no approval
That decision is a configuration change and a handling rule, and both belong in the deployment plan before the first client is installed.
Practice
Who could act on this fleet? your own VelociraptorThe scenario holds what the lab deployment showed: its two certificates, the client configuration, the client index after a second machine joined, the shell collection and two refusals. Answer each question from the tabs.
Then try it on your own instant-mode server. Read the two certificates out of server.config.yaml with openssl, list the keys in client.config.yaml and confirm there is no private key in it, and find the writeback file and its client ID.
If you have a second machine or virtual machine, copy the client configuration to it, start a client with its own writeback path and watch a new client appear. Then add an API identity with the investigator role, as this lesson did, and try to collect the shell artifact with it.
A deployment's trust rests on one certificate authority, one server certificate the clients pin, one key per client, and a client configuration that enrolls whatever runs it.
Clients run whatever the server sends, so the server's roles, its CA key and its patch level decide who controls the fleet. Lesson 0.3 turns to what the server sends: VQL, and how to write a question as a query an endpoint can answer.
Resources
Velociraptor changes quickly; where its documentation and this lesson disagree, the documentation is newer.