Custom Properties

Custom Properties are used to provide properties to your asset install scripts that can be used for a variety of use cases:

  • Dynamically pass a git branch to an asset that clones source code
  • Set log level for an application
  • Provide credential information

Some Elastic Test Tools (ETTs) like Nessus and HP Fortify allow users to customize their scans using Custom Properties.

How to Set Custom Properties

How to Use Custom Properties

Custom properties are made available in the deployment properties files which exist on each system deployed by CONS3RT. When your asset install script runs, the environment variable DEPLOYMENT_HOME is available and points you to the location of these deployment properties files. There are 3 copies of the deployment properties files:

DEPLOYMENT_HOME/deployment.properties
DEPLOYMENT_HOME/deployment-properties.sh
DEPLOYMENT_HOME/deployment-properties.ps1
deployment.properties

The deployment.properties is a Java-compliant properties file and can be easily read in by any programming language in various ways.

  • Linux Bash: cat $DEPLOYMENT_HOME/deployment.properties | grep "cons3rt.deploymentRun.id" | awk -F = '{print $2}'
deployment-properties.sh

This is a Linux-friendly properties file that can be sourced. Any properties containing periods "." will be converted to underscores "_". To use:

  • Linux Bash: source $DEPLOYMENT_HOME/deployment-properties.sh; echo cons3rt_deploymentRun_id;
deployment-properties.ps1

This is a Windows Powershell-friendly properties file that can be sourced easily from a Powershell asset script as follows:

  • Windows Powershell: import-module $env:DEPLOYMENT_HOME\deployment-properties.ps1

Sample deployment.properties

# ==== Begin deployment.properties ====
#Mon Feb 23 09:59:25 EST 2015
#Mon Feb 23 10:07:30 EST 2015
#Properties file for Deployment 
cons3rt.deployment.id=1277
cons3rt.deployment.name=My Deployment
cons3rt.deploymentRun.id=5528
cons3rt.deploymentRun.name=DTL DEV TEST
cons3rt.fap.deployment.machine.hostname.RoleName=dr5528d1277v0
cons3rt.fap.deployment.machine.isMaster.RoleName=true
cons3rt.fap.deployment.machine.isProvisionable.RoleName=true
cons3rt.fap.deployment.machine.isVirtual.RoleName=true
cons3rt.fap.deployment.machine.osFamily.RoleName=UBUNTU
cons3rt.fap.deployment.machine.template.RoleName=vApp_ubuntu_14.04_x64
cons3rt.fap.deployment.numMachines=1
cons3rt.user=my.username
customProperty1=myvalue1
customProperty2=myvalue2
# ==== End deployment.properties ====