Data polices


The CLI allows you to manage the data policies configured on Lenses. The commands for these actions are shown in the table below.

CommandsDescription
createCreate a new data policy
deleteDelete an existing data policy
updateUpdate the configuration of a data policy
viewView the details of a data policy

View data policies 

lenses-cli policies

View a specific policy 

lenses-cli policy view --name [POLICY_NAME]

Create a policy 

Fields are set by specifying a comma-separated set of fields.

lenses-cli policy create \
    --name [POLICY_NAME] \
    --category [CATEGORY_NAME] \
    --impact HIGH \
    --redaction First-1 \
    --fields f1,f2,f3

You can create a data policy using a file. Additionally, you can pass part of the parameter through the CLI and another part in the file.

lenses-cli policy create --fields f1,f2,f3 ./policy.yaml

Example file:

name: [POLICY_NAME]
category: [CATEGORY_NAME]
impactType: HIGH
obfuscation: First-1

Update a policy 

Fields are set by specifying a comma-separated string to the field flag:

lenses-cli policy update \
    --id [POLICY_ID]\
    --name [POLICY_NAME] \
    --category [CATEGORY_NAME] \
    --impact HIGH \
    --redaction First-1 \
    --fields f2,f4

You can update a data policy using a file.

lenses-cli policy update --id [POLICY_ID] --fields f1,f2 ./policy.yaml

Example file:

name: [POLICY_NAME]
category: [CATEGORY_NAME]
impactType: HIGH
obfuscation: First-2

Delete a policy 

lenses-cli policy delete --id [POLICY_ID]
--
Last modified: July 3, 2024