This Terraform project is meant to be used as a template to demonstrate or build a test environment.
It creates an infrastructure composed of a North-hub and two spokes: one for the production and one for the staging.
In the North-hub, an Appsec Virtual Machine Scale-Set is created, and inside the spokes is created a container instance of a vulnerable application (Juice Shop).
The project creates the following resources and combine them:
- Resource Groups: for all the entities
- Vnet: the north-hub and the two Vnets for the spokes
- Subnets: inside the vNets
- Vnet peerings (as shown in the design below)
- Routing table: associated with the network in the spokes
- Appsec Infinity Gateway: a Virtual Machine Scale-Set of AppSec gateways
- Container Instances: in the spokes running a vulnerable application
Before you can start you would need to have an Appsec token that can be obtained with the following steps:
- Application Profile: Steps to create a new profile
- Obtaining the Token: Steps to obtain a Token from a profile
The only thing that you need to do is changing the terraform.tfvars file located in this directory.
# Set in this file your deployment variables
azure-client-id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
azure-client-secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
azure-tenant = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
azure-subscription = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
location = "France Central"
mydns-zone = "<yourzone>.com"
# Have you ever deployed an Appsec Virtual Machine Scale-Set in this Subscription?
appsec-vmss-agreement = true
# AppSec Variables
appsec-name = "vmss-appsec"
appsec-size = "Standard_DS2_v2"
admin-pwd = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
infinity-token = "cp-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
appsec-vmss-min = "2"
appsec-vmss-max = "3"
If you want (or need) to further customize other project details, you can change defaults in the different name-variables.tf files.
Here you will be also able to find the descriptions that explain what each variable is used for.
The project gives as outputs the FQDNs of the Staging and Production Application.
You will need to use them for the Infinity Portal configuration, in the INFINITY POLICY application.
If you don't have a Portal you can create one following this link: Register
With the following steps you can create your application with the FQDN provided by Terraform as output:
- Staging Application: How to create the Staging application
- Production Application: How to create the Production application
After you have created both application, the Enforce of the changes has to be done.