This guide will walk you through a basic Camblet scenario.
It will deploy Camblet into the kernel to assign strong identities to processes and transparently establish mTLS connections.
Simple NGINX server with cURL will be used for demostration.
In this scenario there will be a NGINX server which will work as an echo server.
On client side cURL will be used.
All commands must be run inside the virtual machine. To return to Lima:
Install NGINX server:
Configure agent
Camblet consist of two building blocks:
Kernel module: Handles transparent TLS and enforces policies.
Agent: Signs certificates and collects metadata for processes.
The agent configuration resides in /etc/camblet/config.yaml.
By default, it looks like this:
In this file, the agent can be configured to use a trust domain of your choice, along with the certificate time-to-live (certTTL).
Camblet support various metadata sources, those can be configured under the metadataCollectors block.
Camblet can utilize metadata from these sources to identify processes and enforce policies. The procfs, linuxos, and sysfsdmi are enabled by default.
Let’s gather metadata for the NGINX web server that was just installed.
The command prints out every available metadata for the specified process. These metadata can be used in policies to describe identities and related parameters.
Create policy for NGINX
The policy can be written by hand, but the Camblet CLI can do the work for you with the generate-policy command. There are two mandatory parameters, the PID of the process and the workload ID.
Let’s run the Camblet CLI to generate a policy and save it into the default policy directory as nginx.yaml.
Camblet will use the selectors to identify the NGINX server. The connection part configures the TLS settings where STRICT mTLS value means only clients with trusted certificates can communicate with it.
To verify that, let’s try connecting to NGINX with cURL.
The connection failed, as it was supposed to. Since Camblet now protects NGINX with mTLS, so nothing can communicate with it without a trusted client certificate.
The protection can be simply checked by openssl s_client.
Create policy for cURL
To create a new policy for cURL to communicate with the server, we need the PID of cURL. Since cURL is not running continuously like the server, a “dummy” command is needed to force it to run until the policy is generated.
Let’s generate a policy for cURL
This must be done before cURL times out and the process terminates.
Try to connect to NGINX with a certificate
Using this policy, cURL gets an identity and will use mTLS. Let’s try to communicate with the NGINX once again.
It still doesn’t work, one last piece of the puzzle is missing. Camblet must ascertain the target destination for the application of policies.
Enforcing policies on every egress connection implies that cURL won’t be able to reach destinations beyond the Camblet-managed environment.
Services has to be registered into the service registry through service definitions.
Sample Service discovery configuration file
Let’s ignore the labels part for now; it is meant for more advanced configuration.
The addresses section specifies the registered destination addresses to which the policies should be applied.
Let’s create our own services.yaml where we place the nginx server’s service IP and port number.
Try to connect to NGINX with a certificate and configured Camblet
With the service registry entry for NGINX in place, let’s check if its indeed fixed the error.