How to use Secure Properties
Description
To ensure a higher level of credential security that may be required in specific industries, ACLI 11.0 introduces the Secure Properties functionality.
Secure Properties augments the acli.properties
file, mitigating any breach of security that could occur if the ACLI configuration files were to escape your system.
Solution
The Secure Properties in ACLI 11.0 provides a key-store-based credential storage solution using password based encryption (PBE). The specific key store format is the UBER format, provided by the excellent Bouncy Castle cryptography library for Java.
The Secure Properties key store can store any value, while it prevents sensitive credentials from being stored as plain text on disk.
The use of Secure Properties is optional.
Once you have configured the use of Secure Properties, ACLI will require the password before executing any actions. The password can be provided interactively each time ACLI is run, or via an environment variable.
The ACLI Shell can create Secure Properties entries as part of its guided site configuration functionality, which can be launched using the slash-command, /sites add
.
If you forget the password to a Secure Properties key store, the only solution is to manually rename or delete the file (we recommend renaming if there’s any hope you will later remember the password).
The key store file is named .acli.keystore
and can be found in your user home directory.
Appfire support cannot recover data stored in these files if you forget your password!
Working with Secure Properties
Secure Properties adds actions for creating, updating, reading, and deleting values in an encrypted key store. This key store can then act as a source of variable values that can be referenced in acli.properties
.
Prior to the introduction of secure properties, resolution of variables in the acli.properties
configuration file included a search of these locations:
other properties defined in
acli.properties
Java system properties
runtime environment variables
The Secure Properties key store adds a 4th location from which variables may be resolved. By default, this location is only consulted for values if the variable name contains the secret:
prefix.
Using Secure Properties consists of three main steps:
Creating a key store
When you create the key store file (named .acli.keystore
), it can be found in your home directory.
Each ACLI user on a given system has their own such file. Note that on a multi-user system, each user is required to maintain their own ACLI installation.
The key store file path can be overridden to point to an alternative location through the use of the environment variable ACLI_SECURE_PROPERTIES
. This can be useful if you need to work with multiple key stores or multiple installations of ACLI.
When a secure property is first added, ACLI:
First prompts for the value of the secret to be stored.
Prompts for the new key store file password (with confirmation).
To create your key store, run the action setSecureProperty
, as shown in the example:
$ acli system setSecureProperty --name my.secret --secret -
Enter secure value: <secret value prompt>
Secure properties file does not yet exist. Creating...
Enter new secure properties password: <new password prompt>
Confirm secure properties password: <new password prompt>
Secure properties file created.
Value for key 'foo' set in secure properties file.
Â
Referencing secrets in acli.properties
When in use, the key store file can be used to provide values to acli.properties
by way of substitution variables similar to the current method of referring to environment variables or other properties (i.e., using ${my.variable}
syntax).
The syntax for referring to key store values is a variation of the syntax of the form ${secret:my.secret}
(note the addition of the secret:
prefix).
Unlocking the key store
When the ACLI configuration refers to secure property values (i.e., using ${secret:...}
style variables in acli.properties
), each time that you run an ACLI command (including starting the ACLI Shell), you are prompted to unlock the key store.
Normally, this means that ACLI prompts you for your key store password before it continues (or reads it from stdin
when not connected to a tty). To short-circuit the prompting behavior, set the environment variable ACLI_SECURE_PROPERTIES_PASSWORD
with your password as a value.
Actions
Use ACLI actions, part of the ACLI system
client, to create, update, read, and delete key-value pairs stored in the Secure Properties key store.
To use a secure property in acli.properties
, follow the example as illustrated here:
my-jira = jiracloud -s https://myjira.atlassian.net -u me@example.com -t ${secret:my-jira.token}
The Actions and Examples table shows how you can work with the secure properties and provides examples.
Actions and Examples | |
---|---|
|
|
|
|
|
|
| Locating your Secure Properties key store Your key store is normally located in your home directory and is named Example: Display key store file path |
Â