Segregate secrets per Follower
You can control which secrets are replicated to which Follower using data segregation. By default, all of the data from a Leader replicates to each Follower in a Conjur cluster. To improve the security of this data, you can segregate the data on a per-Follower basis to replicate only the sets of data that each specific Follower needs. For example, in a geographically distributed environment, an organization can limit region-specific data only to Followers that serve that region.
How it works
Data segregation uses replication sets to replicate specified sets of data only to certain Followers. Replication sets are defined in Conjur policy and use Conjur role-based access controls (RBAC) to add Conjur secrets to each set.
A replication set is assigned to a Conjur Follower during the Follower's initial configuration. The Follower replicates only the secrets that are included in that replication set.
Leader configuration creates a default replication set named Full, which replicates all secrets. If no other replication set is assigned when a Follower is created, it uses the Full replication set and replicates all data from the Leader.
You use the evoke utility command
evoke replication-set create to create named replication sets, which indicate the specific sets of data to replicate to a Follower. When you create a Follower seed, you assign a named replication set using the evoke command
evoke seed follower --replication-set. For more information about the evoke commands, see Evoke command reference.
You can review the data replicated to each Follower using the Conjur UI. For instructions, see View replicated data.
Data segregation configuration example
This section provides an example of segregating data in order to replicate only a set of data to a Conjur Follower. This example assumes that you have configured the environment for your Conjur cluster appropriately, deployed the Leader, and loaded policy with variables defined.
Before you begin
Before you create a Follower to associate with a specific set of data, you must:
Determine whether the default user name for the internal account, system, is already in use in your environment. If another account named system already exists, you can use the
--internal-accountflag for the
evoke configure mastercommand to specify a unique name for this account. For more information, see Evoke command reference.
Load policy with variables defined. For more information, see Load and manage policy.
Deploy the Conjur CLI and be familiar with its use. For more information, see Conjur CLI.
Prepare your environment and configure containers for your Conjur cluster. For more information, see Prepare Conjur environment for Docker or Podman deployment.
Deploy the Conjur Leader. For more information, see Configure the Conjur cluster.
Step 1: Create a replication set
On the Leader, use the
evoke replication-set create command to create a replication set:
docker exec conjur-leader evoke replication-set create example-replication-set
Step 2: Add a secret to the replication set
To add a secret to a replication set, add the replication set to a role that has access to the secret.
# policy/permit-example-replication.yaml # This policy is an example of adding a role to a replication set, which # cascades to any secrets this role has permissions to. - !grant role: !host example-app member: !group account: system id: conjur/replication-sets/example-replication-set/replicated-data
docker run -it --rm \ --network conjur \ --volume "$PWD/cli-leader:/root" \ cyberark/conjur-cli:8 \ init \ --account=my-org \ --url=https://conjur-leader
docker run --rm \ --network conjur \ --volume "$PWD/cli-leader:/root" \ cyberark/conjur-cli:8 \ login \ --username \ --password="$(<admin_password)"
docker run --rm \ --network conjur \ --volume "$PWD/cli-leader:/root" \ --volume "$PWD/policy:/policy" \ cyberark/conjur-cli:8 \ policy -b root -f /policy/permit-example-replication.yaml
Step 3: Create the Follower
Create the Follower seed and ensure that you use the
--replication-setflag to specify the replication set for the Follower:
docker exec conjur-leader bash -c 'evoke seed follower --replication-set example-replication-set conjur-follower-example > /seed/follower-example.tar'If you do not use the
--replication-setflag with the
evoke seed followercommand to assign an existing replication set to the Follower, the Follower is automatically assigned to the full replication set, which replicates all secrets to the Follower.You can assign a replication set to a Follower only during Follower seed creation. To change the replication set associated with a Follower, you must delete the existing Follower and redeploy with a new seed file.
Unpack the seed and configure the Follower. For more information, see Deploy the Conjur Follower.
Step 4: Update the secret
docker run --rm \ --network conjur \ --volume "$PWD/cli-leader:/root" \ cyberark/conjur-cli:8 \ variable set -i id -v value
You can view the data that is replicated to each Follower using the Export Replicated Data page in the Conjur UI.
To view the replicated data, you must be granted the !user admin role.
- !grant role: !user admin members: - !user admin1
View replication data
In the left navigation, go to Secrets > Replicated Data.
If a data export link already exists for your current configuration, click the link under the Export Data button to download the CSV file.
If no exported data link is available or you want to generate a new data export, click the Export Data button to generate a CSV file containing the replication data.
This process might take several minutes. When the exported data is ready to download, a timestamped link to the CSV file appears under the Export Data button.
Click the link to download the file.
The CSV file lists each Follower with its corresponding replication set and the policies and variables assigned to that replication set.
For more information about the Conjur UI, see User interface.
Troubleshoot data segregation
To test and troubleshoot issues with data segregation, see Troubleshoot data segregation.
Kubernetes and OpenShift Followers do not support data segregation.