cc/td/doc/product/access/acs_soft
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

CiscoSecure ACS Database Structure

CiscoSecure ACS Database Structure

This appendix presents information on the CiscoSecure Access Control Server (ACS) database structure. It provides programmers and system administrators with database information they can use to write custom programs which access the ACS.

This appendix includes the following sections:

The database structure consists of three main entities: group or user profile, accounting information, and internal dictionary data. (The internal dictionary data is not provided here because the information it contains cannot be changed.)

The database structure provides valuable data regarding the location of passwords, attributes, accounting data, and other related information, as shown in the data models in this appendix. This appendix also provides information you need to locate key information so that you can act on it later (modify, sort, redistribute it, and so forth), as your needs determine. For example, you might want to extract information contained in the accounting file and transfer it to a spreadsheet for billing purposes.

This section provides the structure of the database tables stored in a database, such as SQLAnywhere, that came bundled with your CiscoSecure ACS. Other supported databases include Oracle and Sybase SQL Server.

Group or User Profile Data

Because the group profile and user profile share a common set of attributes, a parent entity "profile" is created to factor out the common set. Group profiles and user profiles exist to store an attribute that could be unique to a particular profile, or to store an attribute that could be accessed frequently.

Password and privilege are treated as separate entities, because they are both multivalued attributes. They form a dependent relationship to the profile. Each profile could have any number (including zero) of instances of each dependent entity.


Note Only one profile should exist for each dependent entity.

Any attribute not stored as a separate column in the database is stored in a blob column. The attributes in the blob column have limitations in that they cannot be used in a query condition.

A lock entity keeps track of locks on group or user profiles. The data table cs_user_profile stores user profile information. See .


Table F-1: cs_user_profile
Column Description
profile_id Unique identification number for a user profile. The number is a 4-byte signed integer number greater than 0. Primary key is created on this column.
user_name Username. Variable length character column up to 255 bytes. Unique index is created on this column.
failed_login_count Current count of failed log in attempts for a user.
cycle_number Sequence number is a 4-byte integer to keep track of updates on a profile. The number starts at 0.

The data table cs_group_profile stores group profile attributes. See Table F-1.


Table F-2: cs_group_profile
Column Description
profile_id Unique identification number for a group profile. The number is a 4-byte signed integer number greater than 0. Primary key is created on this column.
group_name Group name. Variable length character column up to 255 bytes. Unique index is created on this column.
cycle_number Sequence number is a 4-byte integer to keep track of updates on a profile. The number starts at 0.

The data table cs_profile stores group and user profile attribute values. This table represents a super entity profile that is used to factor out the common set of attributes in users and groups. See Table F-2.


Table F-3: cs_profile
Column Description
profile_id Unique identification number for a user or a group profile. The number is a 4-byte signed integer number greater than 0. Primary key is created on this column.
member Member name to which this profile belongs. Variable length character column up to 255 bytes. NULL if no membership is specified.
expire_date Date after which this profile is expired. NULL if no date is specified.
valid_date Date after which this profile becomes valid. NULL if no date is specified.
profile_status Status of this profile. Either enabled or disabled. NULL if nothing is specified.
max_session Maximum number of login sessions allowed. Currently, this only applies to user profile.
blob_data Contains all the attribute values that are not stored as a separate column in the database.

The data table cs_password stores password information of a user or a group profile. See Table F-4. Note that multiple entries can exist for a user or a group profile.


Table F-4: cs_password
Column Description
profile_id Unique identification number for a user or a group profile. The number is a 4-byte signed integer number greater than 0. Unique composite index is created on profile_id and pwd_type.
pwd_type Password type. Variable length column up to 32 bytes. Should be specified.
pwd_value Password itself or external file specification. Variable length column up to 255 bytes. NULL if not specified.
pwd_from_date Date on which the password becomes valid. NULL if no date is specified.
pwd_until_date Last date the password is valid. NULL if no date is specified.
pwd_opaque Any other data specified after password until date on the password attribute value list. Up to 255 bytes. NULL if nothing specified.

The data table cs_privilege stores privilege information of a group or a user profile. See Table F-5.


Note Multiple entries for a group or user profile can exist.

Table  F-5: cs_privilege
Column Description
profile_id Unique identification number for a user or a group profile. The number is a 4-byte signed integer number greater than 0. Unique composite index is created on profile_id, priv_type, and priv_value.
priv_type Privilege password type. Variable length column up to 32 bytes. Required.
priv_value Privilege password or external file specification. Variable length column up to 255 bytes. NULL if not specified.
priv_level Privilege level. Integer between 0 and 15. Required.
nas_name NAS name. Variable length column up to 255 bytes. NULL if not specified.
port Port name. Variable length column up to 255 bytes. NULL if not specified.
remote_address Remote address. Variable length column up to 255 bytes. NULL if not specified.
priv_from_date Date on which the privilege password becomes valid. NULL if not specified.
priv_until_date Last date the privilege password is valid. NULL if not specified.
priv_opaque Any other data specified after privilege until date on the privilege attribute value list. Up to 255 bytes. NULL if nothing is specified.

The data table cs_lock keeps track of all locks held on group or user profiles. See Table F-6.


Table F-6: cs_lock
Column Description
profile_id Unique identification number for a group or user profile. The number is a 4-byte signed integer number greater than 0. Primary key is created on this column.
profile_type Profile type. Either group or user.
profile_name Either username or group name of a locked profile. Variable length column up to 255 bytes.
timestamp Date and time this lock was last issued.
session_id ID number of session in which this lock is obtained.
lock_owner Name of the end user who requested the lock, or NULL if unknown.
lock_type Either read lock or write lock. The write lock is internally generated.
dbserver_name Name of the dbserver on which this lock was issued.
host_name Name of the host machine on which the database server is running.

Accounting Data

Two entities exist for storing accounting data. The first, the accounting_log entity, contains each accounting record as it is passed to the database server. The blob_data attribute, contains the actual accounting record.

The user_accounting entity contains user accounting information for start and stop time as well as other information extracted from the raw accounting data. This entity maintains start_logid and stop_logid to the actual accounting log records in the accounting_log.

The data table cs_accounting_log stores all the accounting raw data as passed to the database server. See Table F-7. This includes user accounting data as well as system accounting data.

When accounting records in the cs_user_accounting and cs_accounting_log tables are exported and deleted by the 'AcctExport' tool, a temporary table - cs_accnt_tmp - is created if there are any active sessions. The temporary table is removed when the export is done.


Table F-7: cs_accounting_log
Column Description
log_id Unique identification number for an accounting raw record. The number is a signed 4-byte integer greater than 0. Primary key is created on this column.
blob_data Raw accounting data record.

The data table cs_user_accounting stores accounting information related to start time and stop time of a user session. It also stores log_ids of the raw accounting data in the cs_accounting_log table for start or stop events. See Table F-8.


Table F-8: cs_user_accounting
Column Description
record_id Unique identification number for an accounting raw record. The number is a signed 4-byte integer greater than 0. Primary key is created on this column.
record_status Status in short integer value:

1 .active-user

2 .closed-user

3 .closed-system shutdown

4 .closed-system reload

5 .closed-dangling

Index is created on this column.

nas_name NAS name. Variable length column up to 255 bytes.
user_name User name. Variable length column up to 255 bytes.
port Port name. Variable length column up to 255 bytes.
address Protocol address information. Variable length column up to 255 bytes.
start-time Timestamp for session start.
stop_time Timestamp for session stop.
task_id Task ID. Variable length column up to 255 bytes.
start_logid Log_id of raw accounting record in cs_accounting_log table for start event.
stop_logid Log_id of raw accounting record in cs_accounting_log table for stop event.

Dictionary Data

The dictionary tables listed in this section identify the mapping between attributes and database objects. Only the table names of the dictionary entities are listed here because the data contained in them is internal to CiscoSecure ACS and cannot be modified. The dictionary data tables are:

Figure F-1 shows the conceptual data model and Figure F-2 shows the physical tables and columns that are created on a supported database.


Figure F-1: Database Structure: Conceptual Data Model


Figure F-2: Physical Tables and Columns Created on Oracle V7 Database

Backing Up the SQLAnywhere Database

This section defines the separate procedures to perform an offline and online backup of the SQLAnywhere database.

Offline Backup

As an offline solution, the SQLAnywhere database file can be copied to any standard backup media, or to a directory designated for backup files as follows:

Step 1 Shut down the database by entering the following command:

Step 2 Copy the database file, csecure.db, to your specified backup media or directory.

The csecure.db file is located within the database directory that you specified when you initially installed the CiscoSecure ACS. For example, if you specified the database directory as /usr/CiscoSecure/database, you would copy /usr/CiscoSecure/database/csecure.db to your designated backup location.


Step 3 Copy the transaction log file, csecure.log, to your specified backup media or directory.

Like the database file, the csecure.log file is located within the database directory that you specified when you initially installed the CiscoSecure ACS.


Step 4 After backing up the transaction log (csecure.log), delete it; otherwise the log file will continue to record transactions and grow indefinitely.

The transaction log is written by SQLAnywhere and is used for recovery purposes. However, because the database is already successfully shut down, the log file can be removed without any consequences.


Online Backup

This section defines the procedure to back up the SQLAnywhere database while the CiscoSecure ACS is up and running by executing the dbbackup command. The environment variables can be set once in the user's shell startup file like .profile to avoid setting them repeatedly, as follows:

Step 1 Set the proper SATMP environment variable as follows:

Step 2 Add SATMP to the $SQLANY/tmp path.

Step 3 Set the proper environmental variable, as follows:

Step 4 Add $SQLANY/lib to the LD_LIBRARY_PATH environment variable.

Step 5 Add $SQLANY/bin to the PATH environment variable.

Step 6 Execute the dbbackup command, as shown in the following example:

SQL is the default password for the database access account when the database was created. If this password has changed, then provide the new password. The target directory refers to the backup directory where you want to save the database. The -x option truncates the transaction log.


hometocprevnextglossaryfeedbacksearchhelp
Copyright 1989-1997 © Cisco Systems Inc.