Skip to content
This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
wes edited this page May 11, 2019 · 3 revisions

Tokens are used for authorization. Tokens are managed by the cif-tokens tool.

Existing Tokens

When you run your cif instance for the first time, it will auto-generate an admin and smrt token for you.

Check to make sure either CIF_TOKEN is set in your environment (env | grep CIF), or your ~/cif.yml file has a token in it token: 1234.... If you don't have either of these, locate the /var/lib/cif/cifv4.db database and do a select * from tokens; to see what tokens were already generated for you.

List tokens

Run the cif-tokens tool with no extra command line switches

$ CIF_TOKEN=1234.. cif-tokens [--token 1234...]

username       groups   admin read write acl expires revoked token                                                           
csirtg-smrt    everyone              yes                       cbe063846786db05ebe494475f65efde533749ba516206c17c65580218b96a7b
admin          everyone  yes  yes                       ab284e119df6e40f55681d854a76dc4dc1c09b65ea8689d02d993e939c408460
...

Create a new User

$ cif-tokens --create --user john.smith@example.com
username               groups   admin read write acl expires revoked token                                                           
john.smith@example.com everyone       yes                            b76b0ac05393936c34aa3151f3d0a123f822e6c83f73c887fd0f3de96c15797b

Delete a user

cif-tokens --delete --username john.smith@example.com
[2015-03-25T11:54:22,932Z][INFO]: 1 tokens deleted...

Modify a user

The only things you can modify to an existing user are:

  • generate a new token
  • remove a token
  • revoke a user / token

If you want to change the following properties you have delete the user and create a new user:

  • username
  • admin flag
  • expires date