...
The Secure Properties key store can store any value, while it prevents sensitive credentials from being stored as plain text on disk.
Info |
---|
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 also create Secure Properties entries as part of its guided site configuration functionality, which can be launched using the slash-command, /sites add
.
Note |
---|
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 Appfire support cannot recover data stored in these files if you forget your password! |
Working with Secure Properties
...
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. This behavior can be overridden to no longer required the prefix, causing the key store to be consulted as a 4th possible search location, even when the secret:
prefix is not present. You can perform this override by setting ACLI_SECURE_PROPERTIES_SAFE_MODE=false
.
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 the Secure Properties is seta 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 a your key store, run the action setSecureProperty
, as shown in the example:
Code Block | ||
---|---|---|
| ||
$ 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>
Remember your password, it cannot be recovered!
Secure properties file created.
Value for key 'foo' set in secure properties file. |
The value for the --secret
parameter, provided in the example, is -
The value set to -
indicates that the value should be obtained via an interactive prompt (or read from stdin
if not connected to a tty).
We strongly recommend that you use this method to provide sensitive values to avoid they are not them being accidentally recorded in your shell history, where they would could end up existing in plain text anyway!
...
Because the key store is password-protected, the secret:
prefix allows you to only consult the key store for the Secure Properties key variables. To disable this requirement, set the environment variable ACLI_SECURE_PROPERTIES_SAFE_MODE=false
.
When disabled, the key store is consulted for variable names that are not found in the acli.properties
file or the environment, this may result in an interactive prompt requesting to supply a password!
...
Note |
---|
Setting your key store password as an environment variable may or may not be appropriate, depending on your risk tolerance. Doing so is a convenience that comes at a cost of reduced security. Advantage: Disadvantage: Whether you decide this is an acceptable risk is entirely at your discretion, and depends on considerations on the threat modelling modeling that you and your organisation organization use. Use this method at your own risk. |
...
The Actions and Examples table shows how you can work with the secure properties and provides examples.
Actions and Examples | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Code Block |
---|
$ acli system -a setSecureProperty --name my-jira.token --secret
Enter secure properties password: <password prompt>
Value for key 'my-jira.token' set in secure properties file. |
clearSecureProperties
This action clears the entire secure properties key store file. To ensure that a value is not accidentally removed, you are prompted for confirmation. If you add the --force
parameter, the secure property file is removed without confirmation.
To complete the action, you are prompted to insert the key store password.
Note |
---|
If you have forgotten the password, you must manually rename or delete the key store file (named We recommend renaming the file (rather than deleting it) if there’s any chance you might later remember the password and still need the contents of the file. |
Example: Clear all Secure Properties
Code Block | ||
---|---|---|
| ||
$ acli system -a clearSecureProperties
Enter secure properties password: <password prompt>
Enter CONFIRM to permanently clear all secure properties (CANNOT be undone): CONFIRM
Secure properties cleared. |
getSecureProperty
This action retrieves a secure property from the key store. By default, it only indicates whether the named entry exists in the key store. To retrieve the property value as well, use: --outputFormat 2
.
Example: Get Secure Property
Code Block | ||
---|---|---|
| ||
$ acli system -a getSecureProperty --name foo
Enter secure properties password: <password prompt>
Secure property 'foo' exists in the secure properties file. |
Example: Get Secure Property with value
Code Block | ||
---|---|---|
| ||
$ acli system -a getSecureProperty --name foo --outputFormat 2
Enter secure properties password: <password prompt>
Value of secure property 'foo': bar |
importSecureProperties
This action allows you to import secure properties from another key store file to your default key store. To do so, you need the password for both the source and destination key stores.
OPTIONS
Use the
--replace
parameter to avoid being asked to confirm overwriting properties during import.Use the
--include
and--exclude
parameters to filter the properties being imported.
Note that each of the imported properties, take a regular expression value that is evaluated against the list of keys in the source key store.
Note |
---|
This can be useful for sharing selected secure properties, just ensure to not store or transmit the key store password with the key store file! |
The following examples assume that both .acli.keystore
and import.keystore
contain entries for the keys foo
and bar
.
Example: Import Secure Properties
Code Block | ||
---|---|---|
| ||
$ acli system -a importSecureProperties -f import.keystore
Enter secure properties password: <destination password prompt>
Enter inbound secure properties password: <source password prompt>
Imported 0 secure properties.
Ignored: buz,foo. Use --replace to overwrite existing values. |
Example: Import select Secure Properties (via inclusion) with replacement
Code Block | ||
---|---|---|
| ||
$ acli system -a importSecureProperties -f import.keystore --include '(?i)^F' --replace
Enter secure properties password: <destination password prompt>
Enter inbound secure properties password: <source password prompt>
Imported 1 secure property: foo. |
removeSecureProperty
This action removes a secure property from the key store. To ensure that a value is not accidentally removed, you are prompted for confirmation.
If you add the --force
parameter, the secure property is removed without confirmation.
If after this operation the key store is empty, it is automatically removed.
Example: Remove a Secure Property
Code Block | ||
---|---|---|
| ||
$ acli system -a removeSecureProperty --name my-jira.token
Enter secure properties password: <password prompt>
Enter CONFIRM to permanently remove the secure property 'my-jira.token': CONFIRM
Removed value for key 'my-jira.token' from secure properties file. |
Example: Force remove a Secure Property (with deletion of empty key store)
Code Block |
---|
$ acli system -a removeSecureProperty --name my-jira.token --force
Enter secure properties password: <password prompt>
Removed value for key 'my-jira.token' from secure properties file.
Deleted empty keystore file. |
exportSecureProperties
This action allows you to export secure properties from your default key store to another key store file. To do so, you need the password for both the source and destination key stores.
OPTIONS
Use the
--replace
parameter to avoid being asked to confirm overwriting properties during export.Use the
--include
and--exclude
parameters to filter the properties being exported.
Note that each of the exported properties, take a regular expression value that is evaluated against the list of keys in the source key store.
The following examples assumes that both .acli.keystore
and import.keystore
contain entries for the keys foo
and bar
.
Example: Export select Secure Properties (via exclusion) with replacement
Code Block | ||
---|---|---|
| ||
$ acli system -a exportSecureProperties -f export.keystore --exclude '(?i)^F' --replace
Enter secure properties password: <source password prompt>
Enter outbound secure properties password: <destination password prompt>
Exported 1 secure property: buz. |
getSecurePropertyList
This action returns all secure properties from the key store. To retrieve the list of property values as well, use: --outputFormat 2
.
Example: Get Secure Property list
Code Block | ||
---|---|---|
| ||
$ acli system -a getSecurePropertyList Enter secure properties password:<password prompt> 2 secure properties in list "Name" "buz" "foo" |
Example: Get Secure Property list with values
Code Block | ||
---|---|---|
| ||
$ acli system -a getSecurePropertyList --outputFormat 2 Enter secure properties password:<password prompt> 2 secure properties in list "Name","Value" "buz","qux" "foo","bar" |
Locating your Secure Properties key store
Your key store is normally located in your home directory and is named .acli.keystore
. ACLI
displays the file path as part of the detailed Example: Display key store file path
|