Authentication/Certificates
Authentication/Authorization#
Authentication is done via x509 SSL certificates When no token is available (missing or expired), the client will automatically create a token (AliEn side short lived certificate).
Certificate/token locations#
The location of user certificate can be customized by X509_USER_{CERT,KEY}
env vars (should point to files),
and if not set, the default location is ${HOME}/.globus/user{cert,key}.pem
The location of token certificate can be customized by JALIEN_TOKEN_{CERT,KEY}
env vars:
- can point to files
- or have the certificate content within the value (and the client will create some temporary files to be used).
If these are not set, the default files ${TMPDIR}/token{cert,key}_$UID.pem
will be used.
* if TMPDIR is not set, /tmp
will be used
Warning
On clusters like lxplus /tmp
is private to the node, so for each login the token will be lost.
Use/set a TMPDIR
relative to the ${HOME}
CA certificates locations#
There are a few locations where CA certificates can be found:
- Within O2 environment, there will be always present the env var $X509_CERT_DIR
- Outside of O2 environment, IF cvmfs is present and with
alienpy
installed withpip
, is highly recommended to do:
export X509_CERT_DIR=/cvmfs/alice.cern.ch/etc/grid-security/certificates
- If outside of O2, and no cvmfs present and with
alienpy
installed withpip
, one can do:
Certificate/token information/verification#
-
Information on certificate/token is printed by commands:
cert-info
/token-info
-
Verification against the known CA certificates is done by :
cert-verify
/token-verify
Tip
when certificate is known to be valid, this can check if the correct directory of CA certificates is seen.
- Checking the key against the certificate:
certkey-match
/tokenkey-match
Info
These operations does not require network connectivity.
Certificate/token information/verification - openssl#
-
Certificate information
-
Token information
-
Certificate verification against CA certificates
-
Certificate/key match verification
Token operations#
- alien-token-init is an alias to
alien.py token-init
token-init
can be used for token customizationalien.py token-init -h INFO: token is automatically created, use this for token customization usage: token-init [-options] options: -u <username> : switch to another role of yours -v <validity (days)> : default depends on token type -t <tokentype> : can be one of: job, jobagent, host, user (default) -jobid <job DN extension> : expected to be present in a job token -hostname <FQDN> : required for a host certificate
token-destroy
will delete the token files.
Tip
For programatic usage use token
command (same options as token-init
); print only command.
Allow usage like:
eval $(alien.py -json token | jq -r '.["results"][0] | "JALIEN_TOKEN_CERT=\"\(.tokencert)\"", "JALIEN_TOKEN_KEY=\"\(.tokenkey)\""')
JALIEN_TOKEN_CERT
and JALIEN_TOKEN_KEY
Role change#
user <username>
command will change the role of current user temporary. (like doing su <username>
)
Tip
use user
for temporary change of the role.
user token-init
to create a new token, for prolonged use of the alternate user name.