How policies apply to TVC
- A non-root user can run a TVC activity only when a policy allows it.
- A request that meets the root quorum is allowed before policies are evaluated.
- A policy can require consensus, so that a TVC activity needs approval from several users before it runs.
- A policy can be limited to a time window with the optional
timefield. See Time-based policies.
TVC activities
Target a TVC activity withactivity.kind, or target a group of them with activity.resource and activity.action.
The Policy parameters column lists the request fields each activity exposes to policy conditions through
activity.params. tvc_app_id identifies an app, and app_quorum_key identifies an app’s Quorum Key when re-encrypting a share. See Scope a policy to a specific app.
Scope a policy to a specific app
To write a policy that applies to one app, match its ID withactivity.params.tvc_app_id. This lets a single organization apply different rules to different apps. For example, if you run one app for production and another for testing, you can give the testing app a permissive policy while the production app stays behind stricter policies or consensus.
Limitations
tvc_app_id is available for two activity types only: ACTIVITY_TYPE_CREATE_TVC_DEPLOYMENT and ACTIVITY_TYPE_DELETE_TVC_APP_AND_DEPLOYMENTS. Activities that act on a deployment or a manifest, such as directing traffic, deleting or restoring a deployment, and approving a manifest, do not expose the app ID, so a policy cannot scope them to one app. If you need every activity separated between two apps today, create them in separate organizations.
Example policies
Replace the placeholders with your own user, user tag, app, and key values.Allow a user to create operators and Quorum Keys
Allow a user to create deployments for a specific app
Require two approvers to create a deployment for a specific app
This policy allows a new deployment for the app only after two users with the given tag approve it.Allow creating deployments for a specific app during business hours
Thetime field limits when this policy is active. CronSpan opens the window at 9:00 AM Eastern on weekdays and holds it open for 8 hours. Outside the window the policy is skipped.
Deny creating deployments for a specific app during a freeze window
This policy stops non-root users from creating deployments for the app between the two timestamps (UTC), even if another policy allows it. The window is start-inclusive and end-exclusive.Allow operators to approve deployment manifests
Manifest approvals do not expose the app ID, so this policy applies to every app in the organization.Allow share re-encryption for one Quorum Key
Re-encrypting a Turnkey-hosted operator’s Quorum Key share releases it to a deployment’s enclave. This policy limits a user to the Quorum Key of one app.app_quorum_key is the app’s Quorum Key public key.
Allow share re-encryption for one hosted operator
This policy limits a user to re-encrypting the share held by one Turnkey-hosted operator, identified by the operator’s encryption public key.Require two approvers to direct traffic to a deployment
Directing traffic does not expose the app ID, so this policy applies to every app in the organization.Deny deleting apps and deployments for users with a specific tag
Deny deleting a specific app
This policy stops non-root users from deleting the app and its deployments, even if another policy allows it.Related
- Policy language reference: every activity parameter available to policy conditions.
- Access control examples: general policy examples for users, tags, and consensus.
- Managing TVC apps and deployments: the operations these policies govern.