Securing the Sensor¶
Soveren Data-in-motion (DIM) and Data-at-rest (DAR) Sensors are currently deployed in a Kubernetes environment. Below is a description of specific security aspects and configuration options that you might want to consider.
Please also refer to the separate guide for configuration options that are not related to security. You may also want to check our current helm chart for all values that can be tuned for the Soveren Sensors.
Access to Kubernetes API¶
The Soveren Data-in-motion (DIM) Sensor subscribes to a significant amount of metadata from the Kubernetes API. A dedicated ServiceAccount is created for this purpose. This ServiceAccount is granted cluster-wide permissions (ClusterRoleBinding) to get, list, and watch several apiGroups.
Proxying the traffic¶
There may be instances when you want to route the traffic between the Soveren Sensor and the Cloud through a proxy. This could be for reasons such as gaining additional control over the traffic leaving your cluster.
To do this, simply specify the top-level value in your values.yaml:
Here, <PROXY_ADDRESS> and <PROXY_PORT> represent the address of your proxy service and the dedicated listening port, respectively.
<PROXY_ADDRESS> should include schema, i.e. it should begin with http://
You can also specify the top-level variable to allow some of your traffic to bypass the proxy:
Please mind that there are some defaults:
-
diggerorcrawlercalldetectionTooldirectly, bypassing the proxy; -
KUBERNETES_SERVICE_HOSTandKUBERNETES_SERVICE_PORTare recognized so thatdiggertalks to Kubernetes API directly.
The settings you specify in httpsProxyNoProxy will be added to defaults.
Soveren Sensors require access to the following addresses:
-
stats.soveren.io:443: The main endpoint for sending data to Soveren Cloud fromdiggerorcrawler; -
updates.soveren.io:443: The endpoint that provides information about ML model updates todetectionTool; -
https://storage.googleapis.com: The S3 bucket containing ML model updates, whichdetectionTooldownloads when they become available.
Network policy¶
You may want to specify the network policy for the Soveren Sensor. It is not enabled by default.
Here's how to do it:
DIM specific policies¶
You might need to specify the relevant port for the K8s API endpoint:
DAR specific policies¶
You might need to explicitly allow the DAR sensor to access data sources.
As name, use any generic label to mark the combination of host+port+protocol.
Containers¶
Generic container privileges¶
All containers of the Soveren Sensors, except for the Interceptors, have the following securityContext by default:
Interceptors privileges¶
Interceptors capture traffic by monitoring the virtual interfaces of the host.
To allow Interceptors to read from the host, the interceptor container needs to run in privileged mode. Hence, it is assigned the following securityContext:
Additionally, the interceptor container requires the following:
Modifying these settings will disrupt traffic interception.
Capabilities¶
You can use capabilities instead of the privileged mode. This heavily depends on how the underlying operating system is protected, e.g., whether there is AppArmor, special settings for SELinux, or similar protections.
Define the securityContext for interceptors like this:
Verifying image signatures¶
Ensure the authenticity and integrity of downloaded images by validating their digital signatures.
We use Cosign for image signing. Below is the public key you should use when verifying the signatures:
imagePullSecrets¶
If you store our images in your own private repository, you may want to use imagePullSecrets for each container:
Using secrets¶
Secrets basics¶
Under the hood, Soveren uses Kubernetes secrets to manage the deployment of components.
To use your own secrets with Soveren, you need to set the top-level useExternalSecrets to true:
By doing this, you are instructing Soveren to prioritize the environment variables set externally over those set by Soveren components themselves.
You can pass secrets to Soveren via environment variables. There are several ways to do this.
One way of setting the environment variables from secrets is via the containers' env[] sections of the chart, as described in the Kubernetes documentation:
Another way is by executing a script and exporting the relevant variables before the container starts.
DIM and DAR tokens¶
Good candidates for using secrets are the tokens of the sensors.
When using secrets for tokens, you must define the following environment variables:
-
For the DIM sensor:
SVRN_DIGGER_STATSCLIENT_TOKEN: token fordigger -
For the DAR sensor:
SVRN_CRAWLER_STATSCLIENT_TOKEN: token forcrawler
DAR data sources¶
Soveren Data-at-rest (DAR) sensor requires you to set up connections to data sources for monitoring. These connections usually include access credentials, so it is a good idea to store them in secrets.
The relevant environment variables to manage the DAR sensor connections are:
-
SVRN_CRAWLER_CRAWL_S3: S3 connectivity configuration for the DAR sensor (see the configuration guide) -
SVRN_CRAWLER_CRAWL_KAFKA: Kafka connectivity configuration for the DAR sensor (see the configuration guide) -
SVRN_CRAWLER_CRAWL_DATABASE_POSTGRES,SVRN_CRAWLER_CRAWL_DATABASE_MYSQLandSVRN_CRAWLER_CRAWL_DATABASE_MSSQL: database connectivity configuration for the DAR sensor (see the configuration guide)
Example configuration for PostgreSQL:
Example: secrets from Vault¶
You can store the secrets in a secrets management system like HashiCorp Vault and retrieve their values at runtime using various techniques. To do this, establish communication with the Vault and export the necessary environment variables.