Installing and setting up the REST API
How to install and set up the REST API for IBM Storage Archive Enterprise Edition.
About this task
ltfsee-1.3.5.[fixlevel]-[buildlevel]-{product|upgrade}.bin
). Use the following
instructions to install and set up the REST server for IBM Storage Archive Enterprise Edition.Procedure
- Verify that the prerequisite software is installed, see REST API software requirements.
-
The filename structure for the REST API rpm file for IBM Storage Archive Enterprise Edition is
[name]-[version]-[buildlevel]-[platform].rpm
. Use the following command to install the REST API rpm file:yum localinstall ibmsa-rest-1.3.5.[fixlevel]-[buildlevel]-[platform].rpm
-
If you intend to use a python3 version that is not set as the default one (e.g. a python virtual environment),
you can set the environment variable
PYTHON_BIN
to the path of the python3 binary file you intend to use, if not set, the REST API will be installed for the system's default python3.
-
If you intend to use a python3 version that is not set as the default one (e.g. a python virtual environment),
you can set the environment variable
-
To set up the REST server edit
/etc/httpd/conf.d/ibmsa-rest.conf
, if needed. Theibmsa-rest-httpd.conf
file contains the following defaults:- The default port is 7100.
- The default protocol is http. If you need SSL/TLS, make the following
changes:
- Add the comment:
SSLEngine on
. - Comment in two lines to specify
SSL certificate
andprivate key
. - For this to work, the mod_ssl package is needed. For more information, see REST API software requirements
- Add the comment:
- The default language and locale is en_US.UTF-8.
-
For the REST API to work correctly some permissions need to be granted to the user running
httpd (default is apache), a script to facilitate this process is provided with the installation and
can be found in
/opt/ibm/ltfsee/rest/conf/apache-config.sh
, this script grants sudo permissions to run the following:- eeadm commands
- REST API's authorization module
- ssh-keygen to check the validity of the keys used
sudo -l -U *
to check if the user being authenticated has access to run eeadm commands- stdbuf to parse the output of the eeadm commands being run in the background
-
There are certain options that can be configured by the user by modifying the
/opt/ibm/ltfsee/rest/conf/config.ini
file, these are:- General settings:
- Token expiration
- Default is 8 hours, can be set to
False
to never expire but this is dangerous and should be avoided. - Needs to restart httpd to take effect
- Default is 8 hours, can be set to
- CSRF Protection
- Default is True, when enabled, a CSRF Token will be generated along with the Access Token and
both Tokens are needed to access the endpoints, to send the CSRF Token in the requests add the
X-CSRF-TOKEN
header to the request with the Token. - For more information about CSRF attacks see https://owasp.org/www-community/attacks/csrf
- Default is True, when enabled, a CSRF Token will be generated along with the Access Token and
both Tokens are needed to access the endpoints, to send the CSRF Token in the requests add the
- Log level
- Default is
INFO
, can be changed to:INFO
DEBUG
WARNING
ERROR
CRITICAL
- Does not need to restart httpd to take effect
- Default is
- Key settings:
- Secret
- Secret key only for symmetric key (when no asymmetric keys are configured). Adds a layer of security to the encoding and decoding of the access tokens without being as secure as using asymmetric keys.
These next options have to be set together, if one of them is not found or set incorrectly, they will both be ignored.
- Secret
- Private and Public keys
- Disabled by default, can be set to the path of a public and private key pair to generate more
secure access tokens. Must be readable by apache user.
- If set, the private key will be used to encode the access tokens and the public key will be used to decode them.
- Disabled by default, can be set to the path of a public and private key pair to generate more
secure access tokens. Must be readable by apache user.
- Key algorithm
- Disabled by default, Specify the algorithm of the private and public keys, can be set to:
HS256
- HMAC using SHA-256 hash algorithmHS384
- HMAC using SHA-384 hash algorithmHS512
- HMAC using SHA-512 hash algorithmES256
- ECDSA signature algorithm using SHA-256 hash algorithmES256K
- ECDSA signature algorithm with secp256k1 curve using SHA-256 hash algorithmES384
- ECDSA signature algorithm using SHA-384 hash algorithmES512
- ECDSA signature algorithm using SHA-512 hash algorithmRS256
- RSASSA-PKCS1-v1_5 signature algorithm using SHA-256 hash algorithmRS384
- RSASSA-PKCS1-v1_5 signature algorithm using SHA-384 hash algorithmRS512
- RSASSA-PKCS1-v1_5 signature algorithm using SHA-512 hash algorithmPS256
- RSASSA-PSS signature using SHA-256 and MGF1 padding with SHA-256PS384
- RSASSA-PSS signature using SHA-384 and MGF1 padding with SHA-384PS512
- RSASSA-PSS signature using SHA-512 and MGF1 padding with SHA-512EdDSA
- Both Ed25519 signature using SHA-512 and Ed448 signature using SHA-3
- For more information about these algorithms, see https://pyjwt.readthedocs.io/en/latest/algorithms.html
- Disabled by default, Specify the algorithm of the private and public keys, can be set to:
For the assymetric key settings to work, the cryptography package is needed. For more information, see REST API software requirements