Traffic capturing and exposure
You can configure Session Management Controller (SMC) to capture and send traffic packets as PCAP files. To do so, you must configure dedicated containers to capture traffic in the values.yaml files. Then, the rclone service can send these data to further destinations.
The following example sets up PCAP captures with a shared storage of 30GB, acting on the sx and rf interfaces with different options:
PCAP capturing setup
For each of the {NAME} interfaces in the pcap.interfaces property, the Helm chart sets up a separate container to gather PCAP files. You can customize it using the pcap.interfaces.{NAME}.{ENV_KEY} environment variables as mentioned in the configuration reference.
Note
Each PCAP container takes a maximum of 0.1 CPU and 128 MB memory.
rclone setup
To publish traffic captured by the PCAP container, enable rclone and pcap, and configure them using environment variables. Use RCLONE_REMOTE_NAME to specify the remote endpoint and RCLONE_REMOTE_PATH to specify the destination path.
rclone is defined generically through the container environment. To find the name of the environment variable that corresponds to a command line option or a config file entry, take the long option name, strip the leading --, change - to _, make upper case, and prepend RCLONE_ or RCLONE_CONFIG_, as explained in the rclone documentationOpens in a new tab.
All available endpoints are described in the official rclone documentationOpens in a new tab. The inotifyOpens in a new tab pattern watches for captures and moves them from the /data/finished directory.
This container example-configuration enables authorisation for SFTP through username and password:
SFTP can also be authorised using private keys. Setting useSSHkeyFile will look for the secret which name is configured by .Values.rclone.secretName in the appropriate namespace and mount it to /etc/ssh in the container's filesystem. Rclone will look for the file using RCLONE_CONFIG_SFTP_KEY_FILE - environment variable.
Note that this secret .Values.rclone.secretName is not created automatically when deploying this helm chart, but needs to be manually prepared by the user like so:
This container example-configuration enables authorization for S3 through access-key and secret-access-key. rclone.env becomes a ConfigMap, so keep the access key and secret access key out of it. Instead, set rclone.envSecretName to the name of a Secret in the same namespace; the chart merges that Secret into the rclone container's environment alongside rclone.env:
Both envSecretName and secretEnvFrom reference a Secret that must already exist in the same namespace — this chart only reads it.
A Secret's keys do not always already match the RCLONE_* env var names rclone expects. For example, a Secret named pcap-object-storage-credentials may expose keys named bucket, access_key_id, secret_access_key, public_endpoint, and direct_endpoint rather than RCLONE_REMOTE_PATH or RCLONE_CONFIG_S3_ACCESS_KEY_ID. For these, use rclone.secretEnvFrom instead of rclone.envSecretName: each entry maps one existing Secret key to one specific env var name, through valueFrom.secretKeyRef.
Configure an S3-compatible remote from such a Secret. If the storage provider exposes both a public and a private endpoint, use the private one (direct_endpoint here) so traffic to the bucket stays off the public network:
Note that a secretEnvFrom entry shadows a same-named key from rclone.env rather than replacing it: the chart still renders the rclone.env value into the ConfigMap consumed via envFrom, but Kubernetes gives a container's own env entries precedence over envFrom, so the secretEnvFrom value is what actually takes effect. In the example above, RCLONE_REMOTE_PATH from the Secret's bucket key wins over the chart's default rclone.env.RCLONE_REMOTE_PATH: "data", which remains in the ConfigMap unused. To avoid confusion, do not set the same key in both rclone.env and rclone.secretEnvFrom.
Note that using rclone_move implies that transferred files will be removed from the source path data/finished. This keeps the container's memory-footprint manageable and enables file-cycling. If the process crashes during transfer no garbage data will remain on the destination address and you will notice a Terminated in the container logs. When attempting to push duplicate files they will be removed from the source path but not overwritten/modified on the destination if MD5/SHAOpens in a new tab checksums and file-name are the same on both ends. Be aware this can cause data loss, if you were to lose the access to the data at the destination. Consider testing first using the --dry-run flag.