An example configuration using terraform to create a magento site on gcp with fastly in front of it.
- creates a virtual machine on google cloud, installs magento and the fastly magento plugin
- attaches an ngwaf@edge deployment to the service
- spools up some attack tooling to generate traffic and graph data
flowchart LR
puppeteer --> site[site-name.freetls.fastly.net]
randomhack --> site
site --> varnish[varnish service]
varnish --> ngwaf
ngwaf --> origin[origin vm]
- a fastly account with the following feature flags enabled
io_entitlement
- a sigsci account (corp)
- a GCP account with access to the SE development project
chose one of the following three options for where to run this from
- click the green "Code" button at the top of the github repo
- click the Codespaces tab within the modal
- click the green "Create codespace..." button
- watch and wait for it to setup (takes ~5m)
- install the devcontainer extension in vscode
- open this folder in the devcontainer
- wait for it (takes ~5m)
- open another terminal to work in
- create a fastly api token for your user (creating api tokens)
- configure the fastly cli with it
fastly profile create
- configure the google terraform provider's access
gcloud auth application-default login
- click on the file named
terraform.tfvars
in the left menu and populate its values- use the same fastly api key from the cli (
fastly profile token
) - populate the two
magento_repo
variables (see here for how to get them) - populate the three
sigsci_
variables (see here for how to create an api key) - if enabling hyva configure the location of the private key that matches the public you uploaded to (hyva's gitlab)
- use the same fastly api key from the cli (
terraform apply
- click the links
terraform destroy
- in the same github web modal that you created the codespace you will now see it listed with a random name
- click the "..." next to it
- click Delete