On branch main
Initial commit Changes to be committed: new file: README.md new file: abx/apply_nsx_tags_for_tiers/README.md new file: abx/apply_nsx_tags_for_tiers/action.py new file: abx/list_vcenter_vms/README.md new file: abx/list_vcenter_vms/action.py new file: abx/send_email/README.md new file: abx/send_email/action.py new file: blueprints/forms/vdefend-form.json new file: blueprints/vdefend-form-driven.yaml
This commit is contained in:
149
blueprints/forms/vdefend-form.json
Normal file
149
blueprints/forms/vdefend-form.json
Normal file
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"schemaVersion": "1",
|
||||
"layout": {
|
||||
"pages": [
|
||||
{
|
||||
"id": "page1",
|
||||
"title": "vDefend Policy Builder",
|
||||
"sections": [
|
||||
{
|
||||
"id": "sec-app",
|
||||
"label": "Application",
|
||||
"fields": [
|
||||
"app_name",
|
||||
"env_value",
|
||||
"requester_email"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "sec-vms",
|
||||
"label": "Select VMs",
|
||||
"fields": [
|
||||
"vm_web",
|
||||
"vm_app",
|
||||
"vm_db"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "sec-ports",
|
||||
"label": "Ports",
|
||||
"fields": [
|
||||
"ports_web_to_app_csv",
|
||||
"ports_app_to_db_csv"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "sec-endpoints",
|
||||
"label": "Endpoints",
|
||||
"fields": [
|
||||
"nsx_manager_url",
|
||||
"nsx_username",
|
||||
"nsx_password"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"fields": {
|
||||
"app_name": {
|
||||
"type": "string",
|
||||
"label": "Application Name"
|
||||
},
|
||||
"env_value": {
|
||||
"type": "string",
|
||||
"label": "Environment",
|
||||
"enum": [
|
||||
"prod",
|
||||
"test",
|
||||
"dev"
|
||||
]
|
||||
},
|
||||
"requester_email": {
|
||||
"type": "string",
|
||||
"label": "Requester Email"
|
||||
},
|
||||
"ports_web_to_app": {
|
||||
"type": "array",
|
||||
"label": "Ports (Web->App)",
|
||||
"hidden": true
|
||||
},
|
||||
"ports_app_to_db": {
|
||||
"type": "array",
|
||||
"label": "Ports (App->DB)",
|
||||
"hidden": true
|
||||
},
|
||||
"ports_web_to_app_csv": {
|
||||
"type": "string",
|
||||
"label": "Ports (Web->App) CSV",
|
||||
"default": "80,443",
|
||||
"computeScript": "return form.getValue('ports_web_to_app_csv').split(',').map(s=>Number(s.trim())).filter(n=>!isNaN(n));",
|
||||
"onChangeScript": "form.setValue('ports_web_to_app', eval(field.computeScript));"
|
||||
},
|
||||
"ports_app_to_db_csv": {
|
||||
"type": "string",
|
||||
"label": "Ports (App->DB) CSV",
|
||||
"default": "5432",
|
||||
"computeScript": "return form.getValue('ports_app_to_db_csv').split(',').map(s=>Number(s.trim())).filter(n=>!isNaN(n));",
|
||||
"onChangeScript": "form.setValue('ports_app_to_db', eval(field.computeScript));"
|
||||
},
|
||||
"vm_web": {
|
||||
"type": "array",
|
||||
"label": "Web Tier VMs",
|
||||
"dataSource": {
|
||||
"type": "action",
|
||||
"actionId": "list_vcenter_vms",
|
||||
"parameters": {}
|
||||
},
|
||||
"multiSelect": true
|
||||
},
|
||||
"vm_app": {
|
||||
"type": "array",
|
||||
"label": "App Tier VMs",
|
||||
"dataSource": {
|
||||
"type": "action",
|
||||
"actionId": "list_vcenter_vms",
|
||||
"parameters": {}
|
||||
},
|
||||
"multiSelect": true
|
||||
},
|
||||
"vm_db": {
|
||||
"type": "array",
|
||||
"label": "DB Tier VMs",
|
||||
"dataSource": {
|
||||
"type": "action",
|
||||
"actionId": "list_vcenter_vms",
|
||||
"parameters": {}
|
||||
},
|
||||
"multiSelect": true
|
||||
},
|
||||
"nsx_manager_url": {
|
||||
"type": "string",
|
||||
"label": "NSX Manager URL"
|
||||
},
|
||||
"nsx_username": {
|
||||
"type": "string",
|
||||
"label": "NSX Username"
|
||||
},
|
||||
"nsx_password": {
|
||||
"type": "string",
|
||||
"label": "NSX Password",
|
||||
"encrypted": true
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"fieldOrder": [
|
||||
"app_name",
|
||||
"env_value",
|
||||
"requester_email",
|
||||
"vm_web",
|
||||
"vm_app",
|
||||
"vm_db",
|
||||
"ports_web_to_app_csv",
|
||||
"ports_app_to_db_csv",
|
||||
"nsx_manager_url",
|
||||
"nsx_username",
|
||||
"nsx_password"
|
||||
]
|
||||
}
|
||||
}
|
||||
94
blueprints/vdefend-form-driven.yaml
Normal file
94
blueprints/vdefend-form-driven.yaml
Normal file
@@ -0,0 +1,94 @@
|
||||
formatVersion: 1
|
||||
name: vdefend-form-driven
|
||||
version: 1
|
||||
inputs:
|
||||
app_name:
|
||||
type: string
|
||||
title: Application Name
|
||||
description: Logical name used to prefix NSX groups and section.
|
||||
default: vdefend-app
|
||||
env_value:
|
||||
type: string
|
||||
title: Environment
|
||||
enum:
|
||||
- prod
|
||||
- test
|
||||
- dev
|
||||
default: prod
|
||||
requester_email:
|
||||
type: string
|
||||
title: Requester Email
|
||||
# vCenter inventory selection (populated via Custom Form using ABX data source)
|
||||
vm_web:
|
||||
type: array
|
||||
title: Web Tier VMs
|
||||
description: Select one or more VMs for the Web tier
|
||||
items:
|
||||
type: string
|
||||
vm_app:
|
||||
type: array
|
||||
title: App Tier VMs
|
||||
items:
|
||||
type: string
|
||||
vm_db:
|
||||
type: array
|
||||
title: DB Tier VMs
|
||||
items:
|
||||
type: string
|
||||
# Port lists (array of numbers; Custom Form will parse CSV input into arrays)
|
||||
ports_web_to_app:
|
||||
type: array
|
||||
title: Ports (Web -> App)
|
||||
items:
|
||||
type: number
|
||||
default:
|
||||
- 80
|
||||
- 443
|
||||
ports_app_to_db:
|
||||
type: array
|
||||
title: Ports (App -> DB)
|
||||
items:
|
||||
type: number
|
||||
default:
|
||||
- 5432
|
||||
# Endpoints / credentials (map these to Project Secrets in production)
|
||||
nsx_manager_url:
|
||||
type: string
|
||||
title: NSX Manager URL
|
||||
nsx_username:
|
||||
type: string
|
||||
encrypted: true
|
||||
nsx_password:
|
||||
type: string
|
||||
encrypted: true
|
||||
|
||||
resources:
|
||||
vdefendPolicy:
|
||||
type: Cloud.Terraform
|
||||
properties:
|
||||
providers:
|
||||
- name: nsxt
|
||||
source: vmware/nsxt
|
||||
version: ">= 3.9.0"
|
||||
module:
|
||||
# point to your Git content source that contains the module path below
|
||||
source: git::https://your.git/VCFA_Avi_vDefend_kit.git//terraform/vdefend_baseline_module
|
||||
variables:
|
||||
nsx_manager_url: ${input.nsx_manager_url}
|
||||
nsx_username: ${input.nsx_username}
|
||||
nsx_password: ${input.nsx_password}
|
||||
domain: "default"
|
||||
app_name: ${input.app_name}
|
||||
env_value: ${input.env_value}
|
||||
services_web_to_app: ${input.ports_web_to_app}
|
||||
services_app_to_db: ${input.ports_app_to_db}
|
||||
create_drop_others_rule: false
|
||||
|
||||
outputs:
|
||||
sectionPath:
|
||||
value: ${resource.vdefendPolicy.outputs.section}
|
||||
groups:
|
||||
value:
|
||||
web: ${resource.vdefendPolicy.outputs.group_web}
|
||||
app: ${resource.vdefendPolicy.outputs.group_app}
|
||||
db: ${resource.vdefendPolicy.outputs.group_db}
|
||||
Reference in New Issue
Block a user