Basic Authorization

 

FairCom provides basic and advanced security models for authorization. This document describes the basic authorization model (ACL), which is used by all FairCom servers before the 26.10 release. See the Advanced Authorization Model topic for details on FairCom's security model after the 16.10 release.

FairCom's basic authorization security follows an Access Control List (ACL) model which uses five set permissions to regulate table access to the three built-in table roles. 

Permissions are stored in each table's data file, meaning a group named READ_WRITE could potentially have read-write access to one file and delete access to another. For consistency, FairCom recommends assigning permissions to each data file that matches the Group assigned to the file. For example, if you assign a READ_WRITE_DELETE group to the file, you should always assign read, write, and delete permissions to that file. So, if an administrator wants users to read, write, and delete records in a table, they assign the READ_WRITE_DELETE group to the table's data file, set the file's GROUP permissions to Read, Write, and Delete, and assign the user to the READ, READ_WRITE, and READ_WRITE_DELETE groups. This approach makes it easy to know what permissions a group provides. 

 

Five permissions

Each table can assign any, all, or none of the following 5 permissions to its owner, group, and world roles.

READ - Allows the role to read records.

WRITE - Allows the role to insert and update records.

DEFINE - Allows the role to alter table structure and properties.

DELETE - Allows the role to delete records.

PASSWORDLESS READONLY - Allows the role to open the table in read-only mode without requiring a password.

 

Three roles

The 5 permissions control what can be done with the table through its three roles, the owner, group, and world. On each table, you can assign zero or more of the 5 permissions to each of the 3 roles.

OWNER - Each table can be assigned to one owner account. Initially, the account that created the table owns the table, but ownership, and thereby permissions, can be transferred to another account by an administrator. A table's owner can access the table according to the permissions assigned to the table's built-in OWNER role. 

GROUP - Each table can be assigned to one group. Any account assigned to that group can access the table according to the permissions assigned to the table's built-in GROUP role. Each group can be assigned a maximum of 128 users, and each user can be assigned a maximum of 128 groups. Group names are not case sensitive and can be up to 31 ASCII characters long. They may include any mix of letters, numbers, and punctuation, but may not include spaces.

WORLD - Any logged-in account can access the table according to the permissions assigned to the table's built-in WORLD role. For maximum security, assign no permissions to WORLD.

Note To protect an application from having all power, an application should use an application account, such as APP, instead of the built-in ADMIN account, and the administrator should assign the application account to be the owner of all tables.

 

FairCom's Legacy Security Administrator Application

The previous images refer to the athlete data file, which is the athlete table in the faircom database.

  • The File Permissions are single-letter bit codes and stand for Read, Write, deFine, Delete, and Passwordless readonly.
  • The file's owner is the APP account.
  • The file's owner permissions are READ, WRITE, DEFINE, and DELETE.
  • Because the file's owner is the APP account and file's owner permissions are read, write, define, and delete, the APP account can alter and delete the table and read, insert, update, and delete its records.
  • The file's world permissions are READ; thus, all logged-in users can read the table.
  • The file's group permissions are READ and WRITE.
  • The file's group is the READ_WRITE group.
  • Because the file's group is READ_WRITE and the file's group permissions are read and write, accounts assigned to the READ_WRITE group can read and write the table's records.

 

Use case

This basic model maximizes the abilities of the ISAM file access control system by allowing an administrator to assign a full set of permissions to the application owner account, assign a minimum set of permissions on each table for all users, and assign each table a maximum set of permissions that users in groups can be assigned to. The basic model is designed for the following scenario:

  • An application owns all tables and needs permissions to alter and delete the table and read, insert, update, and delete its records.
  • An application wants to let all logged-in users have a different set of minimal permissions on each table. 
  • An application wants to let specific users have additional permissions on each table.

Using the basic authorization model, an administrator does the following to implement this use case:

  1. They use the c-treeACE Security Administrator GUI, the sa_admin CLI, or the ctadmn CLI to do the following steps.
    1. The c-treeACE Security Administrator Windows desktop application located in <faircom>/tools/gui/c-treeSecurityAdmin.exe.
      The sa_admin and ctadmn CLI tools are located in <faircom>/tools/.
    2. For each table, they set its OWNER permissions to READ, WRITE, DEFINE, and DELETE, and assign the application account to own the table.
  2. For each table that needs to be available to all logged-in users, they set each table's WORLD permissions to the desired access level, such as READ access. This defines the base level of permissions that the table grants to all authenticated users. Some tables may allow no access and others may allow READ, WRITE, and DELETE access to all authenticated users.
  3. They create four groups:
    READ
    READ_WRITE
    READ_WRITE_DELETE
    READ_WRITE_DELETE_DEFINE
  4. They select the data file assigned to each table.
  5. They assign one of these four groups to the file's GROUP. 
    1. This defines the maximum level of permissions that the table can potentially grant to users through groups. For example, if she assigns the READ_WRITE group to the table, the administrator can later assign users to the READ_WRITE group so they can read, insert, and update records in that table.
  6. They set the file's GROUP permissions to match the permissions implied by the name of the group. 
    1. For example, if she assigns the READ group to the file, she sets the GROUP permissions to READ. 
    2. For example, if she assigns the READ_WRITE_DELETE group to the file, she sets the GROUP permissions to READ, WRITE, and DELETE.
  7. They assign one or more of these four groups to each user. 
    1. For example, If she wants to give a user READ and WRITE permissions, she assigns the user's account to the READ and READ_WRITE groups.
    2. The administrator must assign groups to users in a cumulative way.
      1. In other words, if she wants a user to have READ, WRITE, DELETE, and DEFINE privileges, she must assign the READ, READ_WRITE, READ_WRITE_DELETE, and READ_WRITE_DELETE_DEFINE groups to the user.
      2. The basic model requires the cumulative approach.
        1. The READ group gives the user read access to the set of tables assigned to the READ group. 
        2. The READ_WRITE group gives the user read and write access to the set of tables assigned to the READ_WRITE group.
        3. The READ_WRITE_DELETE group gives the user read, write, and delete access to the set of tables assigned to the READ_WRITE_DELETE group.
        4. The READ_WRITE_DELETE_DEFINE group gives the user read, write, delete, and define access to the set of tables assigned to the READ_WRITE_DELETE_DEFINE group.
        5. If the administrator only assigned a user to the READ_WRITE_DELETE_DEFINE group, the user would only get access to the tables assigned to the READ_WRITE_DELETE_DEFINE group. The user would not be able to read tables in the READ group, would not be able to read or write to tables in the READ_WRITE group, and would not be able to read, write, and delete to tables in the READ_WRITE_DELETE group.
        6. This approach is required because only one group can be assigned to a table.
  8. If an administrator does not want any user to alter (define) the structure of any table, they do not create the READ_WRITE_DELETE_DEFINE group.

 

Basic Model Caveats

The advanced model does not have these limitations of the basic model.

A group name like "READ ONLY" implies that it controls permissions, but it does not. You control permissions by assigning them to each data file's group role.

Each account can be assigned to no groups or up to 128 groups. This is not an issue if you use the cumulative group strategy explained in the use case.

Only the built-in ADMIN account has full power to manage all other accounts and groups. It can view, create, and delete groups. It can add and remove any user from any group. Only the ADMIN account can add and remove accounts from the ADMIN group, which is the only way to turn an ordinary account into an administrator account. Only the ADMIN account can add and remove an administrator account from a group.

An administrator account is any account in the built-in ADMIN group. An administrator account can do the following:

  1. It can view, create, and delete groups. 
  2. It can add and remove any user from any group (except for the ADMIN group).
  3. It can change user passwords.
  4. It cannot change the ADMIN account's password.

A non-administrator account cannot view, create, update, or delete groups and users.

The basic model applies only to ISAM, CTDB, and JSON API file access. None of the basic model table permissions affect SQL access For example, you can assign basic model permissions to a data file to control access at the ISAM, CTDB, and JSON API layer, but it has no effect on the same table in the SQL layer.

None of the SQL permissions affect ISAM, CTDB, and JSON API access. For example, you can grant permissions in SQL to a table, but these permissions have no effect at the ISAM, CTDB, and JSON API layer. 

In contrast, the advanced model affects all layers the same.

 

How to enable and disable RBAC Advanced Authorization

FairCom supports both the basic and advanced authorization models.

You can turn on the advanced model, by including the following configuration line in ctsrvr.cfg:  RBAC YES

You can turn off the basic model, by including the following configuration line in ctsrvr.cfg: RBAC NO

You can comment out the RBAC line by adding the ; character before it, such as ;RBAC YES, and the server will use its default setting of RBAC NO.