Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Controller Deployment Script

CommandObjectDocumentation
register / unregister / check

Standalone Controller

Controller Cluster

JS7 - Controller Cluster
JS7 - Initial Operation for Standalone ControllerJS7 - Management of Standalone Controllers
JS7 - Initial Operation for Controller Cluster, JS7 - Management of Controller Clusters

store-agent / delete-agent

Standalone Agent

Agent Cluster

JS7 - Agent Cluster
JS7 - Management of Standalone Agents
JS7 - Management of Agent Clusters
deploy-agent / revoke-agent
export-agent / import-agent
store-subagent / delete-subagentSubagent
store-cluster / delete-clusterSubagent Cluster
deploy-cluster / revoke-cluster
encrypt / decryptNoneEncrypt / decrypt strings and files


The script is offered for download and can be applied for frequently used deployment operations:

  • The script is available for Linux and MacOS® using bash shell.
  • The script terminates with exit code 0 to signal successful execution, with exit code 1 for command line argument errors and with exit code 4 for non-recoverable errors. Exit code 3 signals that no matching objects have been found.
  • The script is intended as a baseline example for customization by JS7 users and by SOS within the scope of professional services. Examples make use of JS7 Release 2.7.2, bash 4.2, curl 7.29.0 and jq 1.6.0.

...

Code Block
languagebash
titleExample for Exporting and Importing Agents
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# export Agents from their Agent ID
./deploy-controller.sh export-agent "${request_options[@]}" \
    --file=export_agents.zip --agent-id=StandaloneAgent,AgentCluster

# import Agents
./deploy-controller.sh import-agent "${request_options[@]}" --file=export_agents.zip

...

Using encrypted Passwords

Code Block
languagebash
titleExample for Encrypting and DecryptingUse of encrypted Password
linenumberstrue
# create Private Key
openssl ecparam -name secp384r1 -genkey -noout -out encrypt.key

# create Certificate Signing Request, adjust the subject to your needs
openssl req -new -sha512 -nodes -key encrypt.key -out encrypt.csr -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=Encrypt"

# create Certificate, adjust the validity period to your needs
openssl x509 -req -sha512 -days 1825 -signkey encrypt.key -in encrypt.csr -out encrypt.crt -extfile <(printf "keyUsage=critical,keyEncipherment,keyAgreement\n")


# encrypt athe secret such as a passwordpassword "root" using the Certificate, the encryption result will be returned and will look like: enc:BEXbHYa...
MY_JS7_PASSWORD=$(./deploy-controller.sh  encrypt --in="root" --cert=encrypt.crt)

# optionsstore the forenvironment connectionvariable to the JS7 REST API can specifyyour profile ($HOME/.bash_profile or similar) to make the encryptionencrypted resultpassword asavailable password andto the Private shell
# export MY_JS7_PASSWORD=enc:BEXbHYa...


# options for connection to the JS7 REST API can specify the encryption result as password and the Private Key for decryption
request_options=(--url=http://localhost:4446 --user=root --password="enc:BEXbHYa...$MY_JS7_PASSWORD" --key=encrypt.key --controller-id=controller)

 # for example, when exporting Agents the Private Key is used to decrypt the password on-the-fly for access to the REST API on-the-fly
./deploy-controller.sh export-agent "${request_options[@]}" --file=export_agents.zip --agent-id=StandaloneAgent,AgentCluster

# decrypt an encrypted secret using the Private Key
./deploy-controller.sh decrypt --in="enc:BEXbHYa..." --key=encrypt.key

Resources