Configure separate S3 accounts for Control Tower and VDS
By default, Control Tower (CT) and VDS services use the same credentials for access to S3. It means that anyone with access to CT can get sensitive VDS data.
Let's assume that you have two teams working with the same CT instance, and you need to do the following:
- Eliminate the risk of incidental data sharing between the teams.
- Make sure that, during Business Process execution, each team retrieves their appropriate stored access and secret keys for the S3.
To meet the goals, create separate credentials and configure CT and VDS to use them. The configuration procedure is as described below.
Create bucket
Since each team should have its own bucket, create these buckets before you start the configuration. You can do this in the web interface, S3 browser, or console. If you use the console, run the following command:
minio-client mb {alias}/{bucket_name}
where:
aliasis the alias to the server configuration (by default,s3)bucket_nameis the unique bucket name that you choose for the team
Configure Control Tower policy
Access to Control Tower should be limited access since each team can get CT keys from the Business Process context. Due to this limitation, the Control Tower policy will include the following permissions:
- Read/Write access to the vds-models bucket
- Write access to the vds-resources bucket
The vds-resources bucket is restricted to Write only as, during model training, it contains documents from the training set.
minio-client admin policy add {alias} {policy_name} tower_policy.json
where:
aliasis the alias to the server configuration (by default,s3).policy_nameis the unique policy name that you choose for this case.
See sample tower_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Action": [
"s3:GetBucketLocation",
"s3:PutObject",
"s3:ListMultipartUploadParts"
],
"Resource": [
"arn:aws:s3:::vds-resources/*"
]
},
{
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::vds-models/*"
]
}
]
}
The VDS service is responsible for training. Since it does not share keys with any resources, restrict this access just in case. The service will have the following permissions:
- Read/Write access to vds-models bucket
- Read/Write access to vds-resources bucket
minio-client admin policy add {alias} {policy_name} vdf_policy.json
where:
aliasis the alias to the server configuration (by default,s3).policy_nameis the unique policy name that you choose for this case.
See sample vds_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::vds-resources/*",
"arn:aws:s3:::vds-models/*"
]
}
]
}
Configure team service policy
Each team should have its own policy. Basically, teams need to have access to their personal buckets only. Depending on the team needs, it can be one or more buckets. The instruction shows a sample configuration where each team has access to one bucket only.
minio-client admin policy add {alias} {policy_name} {team_policy_file_name}.json
where:
aliasis the alias to the server configuration (by default,s3).policy_nameis the unique policy name that you choose for this case.team_policy_file_nameis the name of the team policy file.
See sample team_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::team1-bucket/*"
]
}
]
}
To check that all policies were created successfully, use the following command:
minio-client admin policy list {alias}
where:
aliasis the alias to the server configuration (by default,s3).
Create new keys (users)
To create new keys, follow the steps below:
Run the following command:
minio-client admin user add {alias} {username} {password}where:
aliasis the alias to the server configuration (by default,s3).usernameis a unique username.passwordis a unique password.
Assign a policy to the user:
minio-client admin policy set {alias} {policy_name} user={access_key}where:
aliasis the alias to the server configuration (by default,s3).access_keyis a new user access key.policy_nameis the name of the policy applied to users.
Check the results:
minio-client admin user list {alias}where:
aliasis the alias to the server configuration (by default,s3).
Configure DB server
To configure the database (DB) server, follow the steps below:
On the DB server, populate the
INSTALL_DIR/secrets.ymlfile with the access and secret keys created for CT in the previous step.To check that the
INSTALL_DIR/distr/latest/secrets_overrides.ymlandPACKAGE_DIR/VAULT_PASSWORD.DELETE_MEfiles exist, run the following command:cd PACKAGE_DIR ./install.sh passwords_update db -e previous_secrets_file=INSTALL_DIR/distr/latest/secrets_overrides.yml --vault-password-file=VAULT_PASSWORD.DELETE_MERestart DB services:
wfmanager restart all
Finish configuration
To complete the configuration process, follow the steps below:
Copy
secrets.yml,secrets_overrides.yml, andVAULT_PASSWORD.DELETE_MEto the Master server and run the following command:./install.sh passwords_update app -e previous_secrets_file=<PATH>/secrets_overrides.yml --vault-password-file=<PATH>/VAULT_PASSWORD.DELETE_MERestart APP services:
wfmanager restart allOn the AutoML Master, update the following files with the credentials for VDS you set when you created buckets.
/opt/workfusion/minio_client_conf/config.json /opt/workfusion/s3cmd_conf/vds_s3cfg /opt/workfusion/vds-mesos-adapter/vds-mesos-adapter.properties /opt/workfusion/vds-scaling-service/vds-scaling-service.propertiesRestart all services on AutoML Master.
wfmanager restart all