For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

NetCaptureStorage CR

NetCaptureStorage CR specifies the storage location for collected PCAP files. The supported locations are:

  • Local disk
  • SFTP server
  • S3 storage

The following sections describe all configurable parameters available in the NetCaptureStorage CR. For a step-by-step guide on how to perform the configuration, see the Configure PCAP capturing guide.

Local storage

You can store PCAPs locally in the Core Cluster. In this case, PCAPs are saved on the Kubernetes worker node disk, by default at /root/dumps. This path is mounted into the NetCap Sink pod, so the data stays available even if the pod restarts.

To define a subdirectory of /root/dumps, set spec.forProvider.local.path to your subdirectory name. The resulting local path will be /root/dumps/{SUBDIRECTORY_NAME}. To configure a local storage:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab and choose the Local Storage storage type.
  3. Enter the path for the subdirectory in the Path text field.
  4. Click Create to finalize.

SFTP server

To set an SFTP server as a location for your PCAP files, provide all required connection parameters in the spec.forProvider.sftp configuration section. NetCap uses rcloneOpens in a new tab to connect to an external SFTP server.

You can authenticate to the SFTP server in two ways:

NetCap supports all the rclone connection parameters. For the full set of fields, please take a look at the rclone SFTP documentationOpens in a new tab.

Plain user/password

You can provide the user and password as plain text in the NetCaptureStorage object. Follow the instructions:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab and choose the SFTP Server Connection storage type.
  3. Enter the username for the SSH connection in the User field.
  4. In the Authentication method fields, choose the Password type.
  5. Enter a plaintext password in the Password text field.
  6. Click Create to finalize.

Key-based authentication

You can use SSH keys to authenticate. To do this, provide the private SSH key in one of three ways:

  • As an existing Kubernetes Secret
  • In the NetCap Sink deployment
  • In the spec.forProvider.sftp.credentials.key_pem parameter within the NetCaptureStorage CR

Define a key as a Kubernetes Secret

You can store a PEM-encoded private key as a Kubernetes secret created in the cennso-system namespace. For example:

yaml

The secret name is sftp-admin-privkey with the SSH key stored under the testkey parameter.

Next, install the NetCap extension on a Core Cluster and embed the reference to your secret in the NetCapClusterDeployment resource. Follow the instructions:

  1. Create a new NetCap Cluster Deployment or edit the existing one.
  2. Go to the Specification tab, expand the SSH Keys parameter, and click the + Add button.
  3. Provide a name for your SSH key in the Name field.
  4. Enter a PEM-encoded private key in the Value field.
  5. Click Create to confirm.

Finally, provide a reference to your secret and the content of the private key in NetCaptureStorage:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab and choose the SFTP Server Connection storage type.
  3. Under the Authentication method field, choose the Key File type.
  4. Enter sftp-admin-privkey/testkey (a file path to your PEM-encoded private key) in the Key File text box.
  5. Click Create to finalize.

Define a key in the NetCap Sink deployment

You can add a secret private key directly in NetCapClusterDeployment:

  1. Create a new NetCap Cluster Deployment or edit the existing one.
  2. Go to the Specification tab, expand the SSH Keys parameter, and click the + Add button.
  3. Provide a name for your SSH key in the Name field.
  4. Enter a PEM-encoded private key in the Value field.
  5. Click Create to confirm.

The NetCap Sink deployment takes care of creating a Kubernetes secret in the cennso-system namespace.

Next, configure NetCaptureStorage by setting spec.forProvider.sftp.credentials.key_file with fromValues/testkey, for example:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab and choose the SFTP Server Connection storage type.
  3. Under the Authentication method field, choose the Key File type.
  4. Enter sftp-admin-privkey/testkey (a file path to your PEM-encoded private key) in the Key File text box.
  5. Click Create to finalize.

Define a key as plain text

Another option is to define the raw PEM-encoded private key in the spec.forProvider.sftp.credentials.key. See the example:

  1. Create a new NetCaptureStorage or edit the existing one.
  2. Switch to the Specification tab and choose a SFTP Server Connection storage type.
  3. Under Authentication method parameter, choose the Key PEM type.
  4. Paste the plain PEM-encoded private key in the Key PEM text field.
  5. Click Create to finalize.

Advanced configuration

If you need to pass any additional parameters to your SFTP configuration, use the spec.forProvider.sftp.advanced map. For example:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab and choose the SFTP Server Connection storage type.
  3. Scroll down and expand SFTP Advanced Connection Parameters.
  4. Click the + Add button and add key and value for your advanced options.
  5. Click Create to finalize.

For the full set of fields, take a look at the rclone SFTP documentationOpens in a new tab.

S3 storage

To set S3 as a storage location for your PCAP files, provide all required connection parameters in the spec.forProvider.s3 configuration section. NetCap uses rcloneOpens in a new tab to connect to an external S3 server.

You can provide the S3 credentials in three ways:

The following example uses plain values:

yaml

Configuration parameters

For a detailed description of configuration parameters for S3 connection defined in spec.forProvider.s3, go to the rclone s3Opens in a new tab documentation.

Read parameters from Kubernetes Secrets

You can read S3 parameters from Kubernetes Secrets created in the Management Cluster and keep plain-text values out of the NetCaptureStorage CR. Use the spec.forProvider.s3.fromSecret list. Each entry in the list sets one S3 parameter from one key of one Secret and takes the following fields:

  • name is the S3 parameter to set, for example access_key_id.
  • secretRef.name is the name of the Secret that holds the value.
  • secretRef.namespace is the namespace of the Secret.
  • secretKey is the key inside the Secret data. This field is optional. If you skip it, NetCap Provider uses the value of name as the key.

Create the Secrets on the Management Cluster, in the namespace you set in secretRef.namespace.

Important

Parameters from fromSecret take precedence over the plain-text fields in spec.forProvider.s3. If you set the same parameter in both places, NetCap Provider applies the value from the Secret.

The NetCaptureStorage CRD requires spec.forProvider.s3.endpoint and spec.forProvider.s3.provider. To read the endpoint from a Secret, keep the endpoint field in the CR and set it to an empty value.

NetCap Provider watches the referenced Secrets. When you update a Secret, NetCap Provider reads the new values and updates the traffic capture configuration.

If the Secret or the key does not exist, NetCap Provider reports an error and keeps the previous configuration.

To read S3 parameters from Secrets:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab.
  3. Choose the S3 storage storage type.
  4. Expand Parameters From Secrets.
  5. Click the + Add button.
  6. In the Parameter field, enter the name of the S3 parameter, for example access_key_id.
  7. In the Name and Namespace fields under Secret, point to the Secret that holds the value.
  8. In the Secret Key field, enter the key inside the Secret data. If the key has the same name as the parameter, leave the field empty.
  9. Repeat steps 5 to 8 for every parameter you want to read from a Secret.
  10. Click Create to finalize.

NetCap Provider reads the S3 parameters from the Secret on the next reconciliation.

Read credentials from the container environment

Set spec.forProvider.s3.env_auth to true to keep the AWS credentials out of the NetCaptureStorage CR. NetCap Sink then takes them from the environment of its container. It reads the standard AWS credential variables, such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. When no variables are set, it falls back to instance metadata, which covers deployments that authenticate through an Identity and Access Management (IAM) role.

Important

spec.forProvider.s3.env_auth applies only when spec.forProvider.s3.access_key_id and spec.forProvider.s3.secret_access_key are both empty. If either parameter holds a value, including a value supplied through fromSecret, NetCap Sink uses that value and ignores the environment.

Supply the variables with spec.sinkEnv on the NetCapClusterDeployment CR. Any Secret they reference must exist in the cennso-system namespace of the Core Cluster, where NetCapClusterDeployment deploys NetCap Sink. For the deployment-side configuration, see NetCap Sink environment variables and volumes.

To read the credentials from the container environment:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab.
  3. Choose the S3 storage storage type.
  4. Select the Env Auth checkbox.
  5. Leave the Access Key ID and Secret Access Key fields empty.
  6. Click Create to finalize.

NetCap Sink takes the credentials from its container environment on the next reconciliation.

Advanced configuration

If your S3 configuration requires to pass any additional parameters, use the spec.forProvider.s3.advanced map, for example:

  1. Create a new NetCapture Storage or edit the existing one.
  2. Switch to the Specification tab and choose the S3 storage storage type.
  3. Scroll down and expand S3 Advanced Parameters.
  4. Click the + Add button and add key and value for your advanced options.
  5. Click Create to finalize.

For the full set of fields, take a look at the rclone S3 documentationOpens in a new tab.