Database users
Add a database login for a reporting or agency tool, rotate its password, and remove it when it is no longer needed.
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can add, change and delete its database users.
- Each environment has its own database users, up to 10: choose Production or Staging in the site header first.
- An Internal user connects from inside the site only: scheduled tasks, the terminal and the SSH tunnel. An External user needs external access.
Add a database user
Open Database
Go to Managed Websites, choose the site, then Database under Site settings. On the Database users card, choose Add user.
Name the user and choose its access
Enter a Username of 3 to 32 lower-case letters, digits and underscores, starting with a letter. Under Access, choose what the user may do.
Access The user can Read-only Read the environment's database. Read-write Also add, change and delete data. It cannot create or drop tables, create users, change grants or reach another database. Choose the password
Leave Password on Generate one for me, or choose Set my own and enter 12 to 64 characters.
Add the user and copy the password
Choose Add user; for Read-write, type
read-writeto confirm first. The password is shown once: copy it, then choose I've copied it.
The user joins the list. To connect from your computer, open the tunnel on Connection details.
Change, rotate or delete a user
Use the buttons on the user's row
Button What it does Edit Changes the access. The name and kind cannot change: delete the user and add a new one. Rotate password Sets a new password, shown once. The old one stops working at once, so update the tool that uses it straight after. The bin Deletes the user. The tool using it can no longer sign in, and this cannot be undone.
The site's own login, application, is always on the list and cannot be changed. Reveal on its row shows its username and password, and every reveal is logged.
Automate this
Adds a database user to the environment: an internal user connects from inside the site only, an external user through external access only.
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/database/users \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm_read_write": "read-write",
"kind": "external",
"max_statement_time": 30,
"max_user_connections": 5,
"password": {
"mode": "set",
"value": "example-password-not-a-secret"
},
"require_tls": true,
"scope": "read_write",
"username": "erp_sync"
}'Your assistant calls corestack_external_db_user_add.
{
"name": "corestack_external_db_user_add",
"arguments": {
"site_id": 4211,
"kind": "internal",
"username": "reporting_ro",
"scope": "read_only",
"password": {
"mode": "generate"
}
}
}