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 ====
#Fri Apr 19 14:31:55 EDT 2019
#Fri Apr 19 14:39:41 EDT 2019
#Properties file for Deployment 100614
cons3rt.cloud.linuxRepositoryUrl=https\://repo.milcloud.hanscom.hpc.mil/rhel-7
cons3rt.deploymentRun.id=97142
cons3rt.deploymentRun.name=RHEL 7 DEPLOYMENT
cons3rt.deploymentRun.project.id=38
cons3rt.deploymentRun.project.name=CONS3RT Development
cons3rt.deploymentRun.virtRealm.cons3rtNetwork=cons3rt-net
cons3rt.deploymentRun.virtRealm.remoteAccess.Ip=172.16.10.253
cons3rt.deploymentRun.virtRealm.type=VCloud
cons3rt.fap.deployment.machine.createdUsername.host1=MyUsername
cons3rt.fap.deployment.machine.defaultUsername.host1=root
cons3rt.fap.deployment.machine.hasGpu.host1=false
cons3rt.fap.deployment.machine.host1.0.internalIp=172.16.10.29
cons3rt.fap.deployment.machine.host1.0.isCons3rtConnection=true
cons3rt.fap.deployment.machine.host1.0.isPrimaryConnection=false
cons3rt.fap.deployment.machine.host1.0.mac=00\:50\:56\:01\:15\:87
cons3rt.fap.deployment.machine.host1.0.networkName=cons3rt-net
cons3rt.fap.deployment.machine.host1.1.internalIp=192.168.10.28
cons3rt.fap.deployment.machine.host1.1.isCons3rtConnection=false
cons3rt.fap.deployment.machine.host1.1.isPrimaryConnection=true
cons3rt.fap.deployment.machine.host1.1.mac=00\:50\:56\:01\:15\:88
cons3rt.fap.deployment.machine.host1.1.networkName=user-net
cons3rt.fap.deployment.machine.host1.cons3rt-net.interfaceName=0
cons3rt.fap.deployment.machine.host1.cons3rt-net.internalIp=172.16.10.29
cons3rt.fap.deployment.machine.host1.cons3rt-net.isCons3rtConnection=true
cons3rt.fap.deployment.machine.host1.cons3rt-net.isPrimaryConnection=false
cons3rt.fap.deployment.machine.host1.cons3rt-net.mac=00\:50\:56\:01\:15\:87
cons3rt.fap.deployment.machine.host1.cons3rtNetworkIp=172.16.10.29
cons3rt.fap.deployment.machine.host1.primaryNetwork=user-net
cons3rt.fap.deployment.machine.host1.primaryNetworkIp=192.168.10.28
cons3rt.fap.deployment.machine.host1.user-net.interfaceName=1
cons3rt.fap.deployment.machine.host1.user-net.internalIp=192.168.10.28
cons3rt.fap.deployment.machine.host1.user-net.isCons3rtConnection=false
cons3rt.fap.deployment.machine.host1.user-net.isPrimaryConnection=true
cons3rt.fap.deployment.machine.host1.user-net.mac=00\:50\:56\:01\:15\:88
cons3rt.fap.deployment.machine.hostname.host1=dr97142v0
cons3rt.fap.deployment.machine.isMaster.host1=true
cons3rt.fap.deployment.machine.isProvisionable.host1=true
cons3rt.fap.deployment.machine.isVirtual.host1=true
cons3rt.fap.deployment.machine.osFamily.host1=LINUX
cons3rt.fap.deployment.machine.packageManagement.host1=YUM
cons3rt.fap.deployment.machine.powerShellVersion.host1=NONE
cons3rt.fap.deployment.machine.serviceManagement.host1=SYSTEMD
cons3rt.fap.deployment.machine.template.host1=6ed1bebe-7d9e-444b-ad72-be0845eedca0
cons3rt.fap.deployment.numMachines=1
cons3rt.siteAddress=https\://app.hmc.hpc.mil
cons3rt.user.email=my.email@emailserver.com
cons3rt.user=my.username
customProperty1=myvalue1
customProperty2=myvalue2
Notable Deployment Properties

A deployment through cons3rt comes with a large list of default properties you may want to leverage in your assets as well. Some of the more notable ones are listed below:

  • cons3rt.deploymentRun.virtRealm.type=VCloud : Cloud type the deployment is launched into such as VCloud vs AWS. Can be used to detect environment types so that scripts can change behavior accordingly
  • cons3rt.fap.deployment.machine.host1.user-net.internalIp=192.168.10.28 : User-net IP address of the host. Can be used for configurations that require it, such as web servers.
  • cons3rt.fap.deployment.machine.createdUsername.host1=MyUsername : Name of the user created on the deployment.
  • cons3rt.fap.deployment.machine.packageManagement.host1=YUM : Type of package manager in use for deployed systems. Software assets can dynamically detect and use package managers on corrosponding systems.