Browse Source

Changes to Terraform files and added AppSec files

main
kusum 1 year ago
parent
commit
eb5be1702b

+ 9
- 0
appsec-cli-lab/sec_config.json View File

@@ -0,0 +1,9 @@
{
"contractId": "W-KXID8R",
"description": "AppSec CLI Lab",
"groupId": "240742",
"hostnames": [
"<User ID>clilab.akaudevops.com"
],
"name": "<User ID>-clilab"
}

+ 47
- 0
appsec-cli-lab/sec_customrule.json View File

@@ -0,0 +1,47 @@
{
"operation": "AND",
"structured": true,
"conditions": [
{
"positiveMatch": true,
"type": "requestMethodMatch",
"value": [
"GET"
]
},
{
"positiveMatch": true,
"type": "requestHeaderMatch",
"name": [
"BlockMe",
"blockme",
"Blockme",
"blockMe"
],
"nameWildcard": true,
"value": [
"1",
"yes",
"true"
],
"valueCase": false,
"valueWildcard": true
},
{
"positiveMatch": true,
"type": "pathMatch",
"value": [
"/*"
],
"valueCase": false,
"valueWildcard": true,
"valueIgnoreSegment": true,
"valueNormalize": true
}
],
"description": "Custom rule for AppSec CLI Lab",
"name": "Blockme header custom rule",
"tag": [
"CLI"
]
}

+ 4
- 0
appsec-cli-lab/sec_policy.json View File

@@ -0,0 +1,4 @@
{
"policyName": "<User ID>JuiceShop",
"policyPrefix": "0001"
}

+ 0
- 1
appsec-cli-lab/test.txt View File

@@ -1 +0,0 @@
hello world

+ 10
- 4
terraform/ion.tf View File

@@ -11,10 +11,15 @@ data "akamai_property_rules_template" "template-update" {
type = "string"
}
variables {
name = "cpcode"
value = "${var.cpcode}"
name = "cpcodeId"
value = "${var.cpcodeId}"
type = "number"
}
variables {
name = "cpcodeName"
value = "${var.cpcodeName}"
type = "string"
}
}

resource "akamai_property" "ion_premier" {
@@ -23,7 +28,7 @@ resource "akamai_property" "ion_premier" {
contract_id = "ctr_${var.contract_id}"
group_id = "grp_${var.group_id}"
hostnames {
cname_from = "${var.prefix}${var.hostname}"
cname_from = "${var.prefix}${var.program}.${var.hostname}"
cname_to = var.edge_hostname
cert_provisioning_type = "CPS_MANAGED"
}
@@ -42,6 +47,7 @@ resource "akamai_property_activation" "activation_staging" {
property_id = "${akamai_property.ion_premier.id}"
version = "${akamai_property.ion_premier.latest_version}"
network = "${var.network}"
contact = ["${var.prefix}@akamai.com"]
contact = ["${var.email}"]
note = "Automatic deployment for ${var.program} Lab"
auto_acknowledge_rule_warnings = true
}

+ 2
- 2
terraform/property-snippets/augment_insights.json View File

@@ -9,8 +9,8 @@
"name": "cpCode",
"options": {
"value": {
"id": "${env.cpcode}",
"name": "devOps-lab"
"id": "${env.cpcodeId}",
"name": "${env.cpcodeName}"
}
}
}

+ 9
- 1
terraform/vars.tf View File

@@ -18,9 +18,14 @@ variable "group_id" {
variable "origin" {
type = string
}
variable "cpcode" {
variable "cpcodeId" {
type = number
}

variable "cpcodeName" {
type = string
}

variable "secure" {
type = bool
}
@@ -38,3 +43,6 @@ variable "edge_hostname" {
variable "program" {
type = string
}
variable "email" {
type = string
}

Loading…
Cancel
Save