8000 GitHub - SimOnPanw/azure-terraform-mass-onboarding
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

SimOnPanw/azure-terraform-mass-onboarding

Repository files navigation

Prisma Cloud Mass Azure Subscription Onboarding

This Terraform script automates the onboarding of multiple Azure subscriptions to Prisma Cloud. Follow the steps below to configure your credentials and execute the script.

Prerequisites

  • Terraform installed on your machine. (Download Terraform)
  • Prisma Cloud Access Key and Secret Key.
  • Azure Subscriptions and an Enterprise Application set up in Azure Active Directory.

Table of Contents

Setup

Configure Prisma Cloud Credentials

Create a .prismacloud_auth.json file in the root directory of the Terraform project with the following content:

{
    "url": "api.eu.prismacloud.io",
    "username": "<access_key>",
    "password": "<secret_key>",
    "protocol": "https"
}
  • Replace <access_key> with your Prisma Cloud access key.
  • Replace <secret_key> with your Prisma Cloud secret key.
  • Ensure the url matches your Prisma Cloud API endpoint (e.g., api.eu.prismacloud.io for the European region).

Note: Keep this file secure as it contains sensitive information.

Prepare the Azure Subscriptions CSV File

Copy the example CSV file and rename it:

cp azure_example.csv azure.csv

Edit azure.csv and fill in the details for each Azure subscription and Enterprise Application. The CSV should follow this format:

accountId,name,clientId,key,tenantId,servicePrincipalId
<subscription_id>,<subscription_name>,<application_id>,<application_secret>,<tenant_id>,<application_object_id>
  • accountId: Azure Subscription ID.
  • name: Name of the Azure Subscription.
  • clientId: Application (client) ID of the Enterprise Application.
  • key: Client secret of the Enterprise Application.
  • tenantId: Azure Active Directory Tenant ID.
  • servicePrincipalId: Object ID of the Enterprise Application.

Important: Ensure there are no extra spaces or line breaks in the CSV file.

Execution

1. Initialize Terraform

Initialize the Terraform working directory:

terraform init

2. Review the Terraform Plan

Review the actions Terraform will perform:

terraform plan

3. Apply the Terraform Configuration

Apply the Terraform configuration to onboard the Azure subscriptions:

terraform apply

Type yes when prompted to confirm the operation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0