Add Terraform Enterprise (Sentinel)
Table of Contents
Prisma Cloud Enterprise Edition
Expand all | Collapse all
-
- Quick Start for Beginners
- Enable Application Security on Prisma Cloud
- Application Security Licenses
- Manage Roles and Permissions
- Generate Access Key
-
-
- Add Azure Repos to Prisma Cloud Application Security
- Add Bitbucket to Prisma Cloud Application Security
- Add Bitbucket Server to Prisma Cloud Application Security
- Add GitHub to Prisma Cloud Application Security
- Add GitHub Server to Prisma Cloud Application Security
- Add GitLab Self-Managed to Prisma Cloud Application Security
- Add GitLab to Prisma Cloud Application Security
-
- Add AWS Code Build to Prisma Cloud Application Security
- Add CircleCI to Prisma Cloud Application Security
- Add Checkov to Prisma Cloud Application Security
- Add GitHub Actions to Prisma Cloud Application Security
- Add Jenkins to Prisma Cloud Application Security
- Add Terraform Cloud (Sentinel)
- Add Terraform Cloud (Run Tasks)
- Add Terraform Enterprise (Sentinel)
- Add Terraform Enterprise (Run Tasks)
-
- Pre-receive Hooks
- Set up IaC Tag and Trace
- Setup Drift Detection
- Secrets Scanning
- Manage Workspaces
- Create and Manage Code Category views
Add Terraform Enterprise (Sentinel)
Integrate Prima Cloud with Terraform Enterprise (Sentinel) to enforce the policy as a code framework for Terraform workspaces that use Sentinel language with a predefined enforcement level that prevents any risky Terraform run. With the integration of Terraform Enterprise, Prisma Cloud will scan your Terraform frameworks for misconfiguration for Prisma Cloud default policies, out-of-the-box policies and custom policies.
Terraform Enterprise is a self-hosted version of Terraform Cloud deployed either on-premises or in your public cloud. While locally, Terraform requires a working directory to manage a collection of infrastructure resources using Terraform CLI, Terraform Enterprise manages multiple collections through workspaces.
As an administrator or operator of Terraform Enterprise, you can create multiple workspaces, each configured with a specific requirement through a policy set. Policy sets are groups of policies for workspaces that you can configure using any version control system (VCS). A policy set can be configured either for a select workspace or all workspaces in your enterprise. In addition to creating policy sets, you can plan runs for workspaces and customize runs for specific workspaces. Each Terraform run checks Sentinel policies for global and customized policy sets.
Create Terraform Enterprise Sentinel policy sets from your version control system as code. You need two files to ensure a Terraform policy set runs:
- A Sentinel configuration file (sentinel.hcl) A Sentinel configuration file contains the policy name, the enforcement level of the policy, and the source path of the policy. You are required to define the actual path for a policy source in the Sentinel configuration file.
- Policy file (policyname.sentinel) Policy file (policyname.sentinel) are individual policy files that are created in the same path as the Sentinel configuration file. The name of the policy file must be the same as the policy name in the configuration file with a .sentinel.
- Verify prerequisites.For Terraform Enterprise (Sentinel) integration with Prisma Cloud Application Security, you need access and information to multiple environments.
- Access KeyThe Prisma Cloud access key enables you to integrate Sentinel files with Prisma Cloud console and Terraform Enterprise console. If you do not have an access key, see generate access key.
- Secret KeyThe Prisma Cloud secret key generates with your access key. Save your secret key once it is generated, as you cannot view it again on Prima Cloud.The Access Key and Secret Key help initiate the integration from Prisma Cloud to Terraform Enterprise (Sentinel).
- Terraform Enterprise ConsoleAccess to Terraform Enterprise Console enables you to provide Admin user token, Terraform Enterprise URL, configure policy sets, and Sentinel Parameters. The Terraform Enterprise (Sentinel) User token or Team token authorizes Prisma Cloud to access to your workspaces and helps create sentinel configuration file and policy file. The user or team must either have theManage Workspacespermission at the organization level or admin permission on the workspace(s) being integrated.
- Cloud DatabaseAccess to the cloud database enables you to verify the Prisma Cloud integration through sentinel files.
- Integrate Terraform Enterprise (Sentinel) with Prisma Cloud.
- SelectSettings > Repositories > Add Repository.
- SelectTerraform Enterprise (Sentinel).
- AddTerraform Enterprise URL.Ensure an IP address and your Terraform Enterprise URL are on the allow list for Prisma Cloud. To know more about the allow list see enable access to the Prisma Cloud Console.
- AddTerraform Enterprise User / Team tokenand then selectNext.
- Create Sentinel files within your version control system.You need two Sentinel files — sentinel.hcl, which defines the relevant policies, and prismacloud.sentinel, which contains the actual policy logic - to ensure Terraform policy set runs with Prisma Cloud configurations.
- Create a sentinel.hcl file in your VCS (version control system).
- Copy and then paste the code from Prisma Cloud console in the new sentinel.hcl file.The code helps you define your policy and the enforcement level of the policy within Terraform Enterprise. The enforcement level can be set to one of three values:
- hard-mandatory means your Terraform cannot be applied until you resolve or suppress all failing Application Security policies.
- soft-mandatory means your Terraform runs are blocked but can be overridden to still apply the IaC
- advisory means Application Security will report and record policy violations but will not block a Terraform apply.
- Optionally, you can edit the default source path ./prismacloud.sentinel to the location of another sentinel file in the code and thenNext.We recommend using the default value ./prismacloud.sentinel.
- Create a prismacloud.sentinel file in your VCS (version control system).
- Copy and then paste the code from Prisma Cloud console in the new prismacloud.sentinel file (or another file if you are not using the default value), and then selectNext.
- Create Sentinel Policy Sets on Terraform Enterprise console.
- Access Terraform Enterprise console and then selectSettings > Policy sets > Connect a new policy set > Add new Sentinel parameters.
- Define the scope of the policy set.You can enforce policies for a single workspace or to all workspaces.
- Add the Prisma CloudAccess Keyand Prisma CloudSecret Keyand then selectSave policy set.
- Access the Prisma Cloud console and then selectNext.
- Connect Policy Set on Terraform Enterprise (Sentinel).
- On the Prisma Cloud console select the organization to integrate the policy set and then selectNext.
- Access Terraform Enterprise console and then selectWorkspaces > Workspace > Actions >Start new plan.
- SelectStart Planto run the new policy set for the resources.Terraform triggers the plan for the workspace.
- Verify the Terraform Enterprise (Sentinel) integration with Prisma Cloud.
- Access your cloud database to verify the Sentinel files (.sentinel `and `sentinel.hcl) integration.In this example, in your cloud database, you can verify the access_token that is your Terraform user or team token and domain strings that are auto populated based on your token entry.
- Access the Prisma Cloud console and then selectDone.AccessApplication Security > Projectsto view the latest integrated Terraform Enterprise (Sentinel) repository to Suppress or Fix the policy misconfigurations if any.