Intersystem Cache Database Security Admin
Intersystem Cache Database Security Admin
Cach Security Administration Guide Cach Version 2012.1 01 February 2012 Copyright 2011 InterSystems Corporation All rights reserved. This book was assembled and formatted in Adobe Page Description Format (PDF) using tools and information from the following sources: Sun Microsystems, RenderX, Inc., Adobe Systems, and the World Wide Web Consortium at www.w3c.org.The primary document development tools were special-purpose XML-processing applications built by InterSystems using Cach and Java.
Cach WEBLINK, Distributed Cache Protocol, M/SQL, M/NET, and M/PACT are registered trademarks of InterSystems Corporation.
InterSystems Jalapeo Technology, Enterprise Cache Protocol, ECP, and InterSystems Zen are trademarks of InterSystems Corporation. All other brand or product names used herein are trademarks or registered trademarks of their respective companies or organizations. This document contains trade secret and confidential information which is the property of InterSystems Corporation, One Memorial Drive, Cambridge, MA 02142, or its affiliates, and is furnished for the sole purpose of the operation and maintenance of the products of InterSystems Corporation. No part of this publication is to be used for any other purpose, and this publication is not to be reproduced, copied, disclosed, transmitted, stored in a retrieval system or translated into any human or computer language, in any form, by any means, in whole or in part, without the express prior written consent of InterSystems Corporation. The copying, use and disposition of this document and the software programs described herein is prohibited except to the limited extent set forth in the standard software license agreement(s) of InterSystems Corporation covering such programs and related documentation. InterSystems Corporation makes no representations and warranties concerning such software programs other than those set forth in such standard software license agreement(s). In addition, the liability of InterSystems Corporation for any losses or damages relating to or arising out of the use of such software programs is limited in the manner set forth in such standard software license agreement(s). THE FOREGOING IS A GENERAL SUMMARY OF THE RESTRICTIONS AND LIMITATIONS IMPOSED BY INTERSYSTEMS CORPORATION ON THE USE OF, AND LIABILITY ARISING FROM, ITS COMPUTER SOFTWARE. FOR COMPLETE INFORMATION REFERENCE SHOULD BE MADE TO THE STANDARD SOFTWARE LICENSE AGREEMENT(S) OF INTERSYSTEMS CORPORATION, COPIES OF WHICH WILL BE MADE AVAILABLE UPON REQUEST. InterSystems Corporation disclaims responsibility for errors which may appear in this document, and it reserves the right, in its sole discretion and without notice, to make substitutions and modifications in the products and practices described in this document. For Support questions about any InterSystems products, contact: InterSystems Worldwide Customer Support Tel: +1 617 621-0700 Fax: +1 617 374-9391 Email: [email protected]
Table of Contents
About This Book .................................................................................................................................... 1 1 About Cach Security ......................................................................................................................... 3 1.1 Authentication: Establishing Identity ......................................................................................... 4 1.1.1 About Kerberos ................................................................................................................ 4 1.1.2 About Operating-SystemBased Authentication ............................................................. 5 1.1.3 About LDAP Authentication ............................................................................................ 5 1.1.4 About Cach Login .......................................................................................................... 5 1.1.5 About Delegated Authentication ...................................................................................... 5 1.2 Authorization: Controlling User Access ..................................................................................... 6 1.2.1 Authorization Basics ........................................................................................................ 6 1.2.2 Resources and What They Protect .................................................................................... 7 1.2.3 For More Information on Authorization ........................................................................ 10 1.3 Auditing: Knowing What Happened ........................................................................................ 10 1.4 Managed Key Encryption: Protecting Data on Disk ................................................................ 11 1.5 Managing Security with the Management Portal ..................................................................... 11 1.6 Notes on Technology, Policy, and Action ................................................................................. 12 1.7 A Note on Certification ............................................................................................................ 12 2 Authentication ................................................................................................................................... 13 2.1 Authentication Basics ............................................................................................................... 13 2.2 About the Different Authentication Mechanisms ..................................................................... 14 2.2.1 Kerberos Authentication ................................................................................................. 15 2.2.2 Operating-SystemBased Authentication ...................................................................... 15 2.2.3 Cach Login ................................................................................................................... 15 2.2.4 LDAP Authentication ..................................................................................................... 16 2.2.5 Delegated Authentication ............................................................................................... 16 2.2.6 Unauthenticated Access ................................................................................................. 16 2.3 About the Different Access Modes ........................................................................................... 16 2.3.1 About Local Access ........................................................................................................ 16 2.3.2 About Client/Server Access ............................................................................................ 17 2.3.3 About Web Access .......................................................................................................... 17 2.4 Configuring for Kerberos Authentication ................................................................................. 18 2.4.1 About Kerberos and the Access Modes .......................................................................... 18 2.4.2 Specifying Connection Security Levels ......................................................................... 20 2.4.3 Setting Up a Client ......................................................................................................... 21 2.4.4 Obtaining User Credentials ............................................................................................ 23 2.4.5 Setting Up a Secure Channel for a Web Connection ..................................................... 26 2.5 Configuring for Operating-Systembased Authentication ....................................................... 27 2.5.1 A Note on %Service_Console ........................................................................................ 28 2.5.2 A Note on %Service_Callin ........................................................................................... 28 2.6 Configuring for Authentication with Cach Login .................................................................. 28 2.6.1 Web ................................................................................................................................. 29 2.6.2 ODBC ............................................................................................................................. 30 2.6.3 Telnet and Cach Direct ................................................................................................. 30 2.7 Configuring for Two-factor Authentication .............................................................................. 31 2.7.1 Configuring the Server for Two-factor Authentication .................................................. 31 2.7.2 Configuring Web Applications for Two-factor Authentication ...................................... 34
2.7.3 Configuring Bindings Clients for Two-factor Authentication ........................................ 34 2.8 Other Topics ............................................................................................................................. 39 2.8.1 System Variables and Authentication ............................................................................. 39 2.8.2 Using Multiple Authentication Mechanisms .................................................................. 39 2.8.3 Cascading Authentication .............................................................................................. 40 2.8.4 Establishing Connections with the UnknownUser Account .......................................... 40 2.8.5 Programmatic Logins ..................................................................................................... 41 2.8.6 The JOB Command and Establishing a New User Identity ........................................... 41 3 Assets and Resources ........................................................................................................................ 43 3.1 About Resources ....................................................................................................................... 43 3.2 System Resources ..................................................................................................................... 44 3.2.1 Administrative Resources ............................................................................................... 44 3.2.2 The %Development Resource ........................................................................................ 46 3.3 Database Resources .................................................................................................................. 46 3.3.1 Database Resource Privileges ........................................................................................ 46 3.3.2 Shared Database Resources ........................................................................................... 47 3.3.3 Default Database Resource ............................................................................................ 47 3.3.4 Unknown or Non-Valid Resource Names ...................................................................... 47 3.3.5 Namespaces .................................................................................................................... 48 3.3.6 Databases that Ship with Cach ..................................................................................... 48 3.4 Application Resources .............................................................................................................. 49 3.5 Creating or Editing a Resource ................................................................................................ 50 3.5.1 Resource Naming Conventions ...................................................................................... 50 3.6 Using Custom Resources with the Management Portal ........................................................... 51 3.6.1 Defining and Applying a Custom Resource to a Page ................................................... 51 3.6.2 Removing a Custom Resource from a Page ................................................................... 51 4 Privileges and Permissions ............................................................................................................... 53 4.1 How Privileges Work ................................................................................................................ 53 4.2 Public Permissions ................................................................................................................... 53 4.3 Checking Privileges .................................................................................................................. 54 4.4 When Changes in Privileges Take Effect .................................................................................. 54 5 Roles ................................................................................................................................................... 55 5.1 About Roles .............................................................................................................................. 55 5.2 Roles, Users, Members, and Assignments ............................................................................... 56 5.2.1 An Example of Multiple Role Assignment .................................................................... 57 5.3 Creating a Role ......................................................................................................................... 58 5.3.1 Naming Conventions ...................................................................................................... 59 5.4 Managing Roles ........................................................................................................................ 59 5.4.1 Viewing Existing Roles .................................................................................................. 59 5.4.2 Deleting a Role ............................................................................................................... 60 5.4.3 Giving New Privileges to a Role .................................................................................... 60 5.4.4 Modifying Privileges for a Role ..................................................................................... 60 5.4.5 Removing Privileges from a Role .................................................................................. 60 5.4.6 Assigning Users or Roles to the Current Role ............................................................... 61 5.4.7 Removing Users or Roles from the Current Role .......................................................... 61 5.4.8 Assigning the Current Role to Another Role ................................................................. 61 5.4.9 Removing the Current Role from Another Role ............................................................ 62 5.4.10 Modifying a Roles SQL-Related Options ................................................................... 62 5.5 Predefined Roles ...................................................................................................................... 65
5.5.1 %All ............................................................................................................................... 66 5.5.2 Default Database Resource Roles .................................................................................. 66 5.6 Login Roles and Added Roles .................................................................................................. 66 5.7 Programmatically Managing Roles .......................................................................................... 67 6 Users ................................................................................................................................................... 69 6.1 Properties of Users ................................................................................................................... 69 6.1.1 About User Types ........................................................................................................... 70 6.2 Creating and Editing Users ...................................................................................................... 71 6.2.1 Creating a New User ...................................................................................................... 71 6.2.2 Editing an Existing User ................................................................................................ 72 6.3 Viewing and Managing Existing Users .................................................................................... 75 6.3.1 Deleting a User ............................................................................................................... 76 6.3.2 Viewing a User Profile ................................................................................................... 76 6.4 Predefined User Accounts ........................................................................................................ 76 6.4.1 Default Predefined Account Behavior ............................................................................ 77 6.4.2 Notes on Various Accounts ............................................................................................ 78 6.5 Validating User Accounts ......................................................................................................... 78 7 Services .............................................................................................................................................. 81 7.1 Available Services .................................................................................................................... 81 7.1.1 Notes on Individual Services ......................................................................................... 82 7.2 Service Properties ..................................................................................................................... 84 7.3 Services and Authentication ..................................................................................................... 85 7.4 Services and Their Resources ................................................................................................... 86 8 Applications ....................................................................................................................................... 87 8.1 Applications, Their Properties, and Their Privileges ................................................................ 87 8.1.1 Applications and Their Properties .................................................................................. 88 8.1.2 Associating Applications with Resources ...................................................................... 89 8.1.3 Applications and Privilege Escalation ............................................................................ 89 8.1.4 Checking for Privileges Programmatically .................................................................... 91 8.2 Application Types ..................................................................................................................... 92 8.2.1 Web Applications ........................................................................................................... 92 8.2.2 Privileged Routine Applications ..................................................................................... 93 8.2.3 Client Applications ......................................................................................................... 95 8.3 Creating and Editing Applications ........................................................................................... 95 8.3.1 Creating and Editing an Application: The General Tab ................................................. 96 8.3.2 Editing an Application: The Application Roles Tab ....................................................... 96 8.3.3 Editing an Application: The Matching Roles Tab .......................................................... 97 8.3.4 Editing an Application: The Routines Tab ..................................................................... 97 8.4 System Applications ................................................................................................................. 98 9 Auditing ............................................................................................................................................. 99 9.1 Basic Auditing Concepts .......................................................................................................... 99 9.1.1 Enabling or Disabling Auditing ..................................................................................... 99 9.2 About Audit Events ................................................................................................................ 100 9.2.1 Elements of an Audit Event .......................................................................................... 100 9.2.2 About System Audit Events ......................................................................................... 102 9.2.3 Enabling and Disabling System Events ....................................................................... 105 9.2.4 About User Events ........................................................................................................ 105 9.3 Managing Auditing and the Audit Database .......................................................................... 107 9.3.1 Viewing the Audit Database ......................................................................................... 107
9.3.2 Copying, Exporting, and Purging the Audit Database ................................................. 108 9.3.3 Encrypting the Audit Database .................................................................................... 110 9.3.4 General Management Functions .................................................................................. 110 9.4 Other Auditing Issues ............................................................................................................. 110 9.4.1 Freezing Cach If There Can Be No Audit Log Writes ............................................... 110 9.4.2 About Counters ............................................................................................................ 111 10 Managed Key Encryption ............................................................................................................ 113 10.1 Managing Keys and Key Files .............................................................................................. 114 10.1.1 Managing Keys .......................................................................................................... 114 10.1.2 Managing Key Files ................................................................................................... 118 10.1.3 Recommended Policies for Managing Keys and Key Files ....................................... 121 10.2 Using Encrypted Databases .................................................................................................. 122 10.2.1 Creating an Encrypted Database ................................................................................ 122 10.2.2 Establishing Access to an Encrypted Database .......................................................... 123 10.2.3 Closing the Connection to an Encrypted Database .................................................... 123 10.2.4 Moving an Encrypted Database Between Instances .................................................. 123 10.2.5 Configuring Cach Database Encryption Startup Settings ........................................ 123 10.2.6 Using Encrypted Databases with Mirroring ............................................................... 127 10.2.7 About Encrypting the Databases that Ship with Cach .............................................. 128 10.3 Using Data Element Encryption ........................................................................................... 128 10.3.1 Programmatically Managing Keys ............................................................................. 128 10.3.2 Data Element Encryption Calls .................................................................................. 129 10.3.3 Support for Re-Keying Data in Real Time ................................................................. 130 10.4 Emergency Situations ........................................................................................................... 131 10.4.1 If the File Containing an Activated Key is Damaged or Missing ............................... 131 10.4.2 If the Database-Encryption Key File Is Required at Startup and Is Not Present ....... 135 10.5 Other Information ................................................................................................................. 136 10.5.1 Performance Information ........................................................................................... 136 10.5.2 Key File Encryption Information ............................................................................... 137 10.5.3 Encryption and Database-Related Cach Facilities ................................................... 137 11 SQL Security ................................................................................................................................. 139 11.1 SQL Privileges and System Privileges ................................................................................. 139 11.2 The SQL Service .................................................................................................................. 140 11.2.1 CREATE USER ......................................................................................................... 140 11.2.2 Effect of Changes ....................................................................................................... 140 11.2.3 Required Privileges for Working with Tables ............................................................ 140 12 System Management and Security .............................................................................................. 143 12.1 System Security Settings Page ............................................................................................. 143 12.2 System-wide Security Parameters ........................................................................................ 143 12.2.1 Protecting Sensitive Data in Memory Images ............................................................ 145 12.3 Authentication Options ......................................................................................................... 145 12.4 Password Strength and Password Policies ........................................................................... 146 12.4.1 Suggested Administrator Password Strength ............................................................. 146 12.5 Protecting Cach Configuration Information ....................................................................... 147 12.6 Managing Cach Security Domains ..................................................................................... 147 12.6.1 Single and Multiple Domains .................................................................................... 147 12.6.2 The Default Security Domain .................................................................................... 148 12.6.3 Listing, Editing, and Creating Domains ..................................................................... 148 12.7 Security Advisor ................................................................................................................... 148
12.7.1 Auditing ...................................................................................................................... 149 12.7.2 Services ...................................................................................................................... 149 12.7.3 Roles ........................................................................................................................... 149 12.7.4 Users ........................................................................................................................... 150 12.7.5 CSP, Privileged Routine, and Client Applications ..................................................... 150 12.8 Effect of Changes ................................................................................................................. 150 12.9 Emergency Access ................................................................................................................ 151 12.9.1 Invoking Emergency Access Mode ............................................................................ 151 12.9.2 Emergency Access Mode Behavior ............................................................................ 153 13 Using SSL/TLS with Cach ......................................................................................................... 155 13.1 About SSL/TLS .................................................................................................................... 156 13.2 About Configurations ........................................................................................................... 156 13.2.1 Creating or Editing an SSL/TLS Configuration ........................................................ 157 13.2.2 Deleting a Configuration ............................................................................................ 159 13.2.3 Reserved Configuration Names ................................................................................. 160 13.3 Configuring the Cach Superserver to Use SSL/TLS .......................................................... 160 13.4 Configuring the Cach Telnet Service to Use SSL/TLS ...................................................... 160 13.4.1 Configuring the Cach Telnet Server for SSL/TLS ................................................... 161 13.4.2 Configuring Telnet Clients for SSL/TLS ................................................................... 161 13.5 Configuring .NET Clients to Use SSL/TLS with Cach ...................................................... 162 13.6 Configuring Java Clients to Use SSL/TLS with Cach ........................................................ 162 13.6.1 Determining the Need for a Keystore and a Truststore .............................................. 163 13.6.2 Creating a Client Configuration ................................................................................. 163 13.6.3 Specifying the Use of the Client Configuration ......................................................... 165 13.7 Configuring Cach to Use SSL/TLS with Mirroring ........................................................... 167 13.7.1 About Mirroring and SSL/TLS .................................................................................. 167 13.7.2 Creating and Editing SSL/TLS Configurations for a Mirror ..................................... 168 13.8 Configuring Cach to Use SSL/TLS with TCP Devices ...................................................... 170 13.8.1 Configuring a Client to Use SSL/TLS with a TCP Connection ................................. 170 13.8.2 Configuring a Server to Use SSL/TLS with a TCP Socket ........................................ 172 13.9 Configuring the CSP Gateway to Connect to Cach Using SSL/TLS ................................. 173 13.10 Establishing the Required Certificate Chain ...................................................................... 174 14 Using Delegated Authentication .................................................................................................. 177 14.1 Overview of Delegated Authentication ................................................................................ 177 14.1.1 How Delegated Authentication Works ....................................................................... 177 14.2 Creating Delegated (User-Defined) Authentication Code .................................................... 178 14.2.1 Authentication Code Fundamentals ........................................................................... 178 14.2.2 Signature .................................................................................................................... 179 14.2.3 Authentication Code ................................................................................................... 179 14.2.4 Setting Values for Roles and Other User Characteristics ........................................... 180 14.2.5 Return Value and Error Messages .............................................................................. 183 14.3 Setting Up Delegated Authentication ................................................................................... 184 14.4 After Delegated Authentication Succeeds ............................................................................ 184 14.4.1 The State of the System .............................................................................................. 185 14.4.2 Changing Passwords .................................................................................................. 185 15 Using LDAP Authentication ........................................................................................................ 187 15.1 Configuring Cach to Use an LDAP Server ......................................................................... 188 15.1.1 Specifying a Certificate File on Windows .................................................................. 189 15.1.2 Searching the LDAP Database ................................................................................... 189
15.2 Configuring the LDAP Server to Use Registered LDAP Properties .................................... 190 15.3 Setting Up LDAP-based Authentication .............................................................................. 191 15.4 After Authentication The State of the System ................................................................. 192 16 Using Delegated Authorization .................................................................................................... 193 16.1 Overview of Delegated Authorization .................................................................................. 193 16.2 Creating Delegated (User-defined) Authorization Code ...................................................... 193 16.2.1 Working from the ZAUTHORIZE.int Template ........................................................ 194 16.2.2 ZAUTHORIZE Signature .......................................................................................... 194 16.2.3 Authorization Code with ZAUTHORIZE .................................................................. 195 16.2.4 ZAUTHORIZE Return Value and Error Messages .................................................... 197 16.3 Configuring an Instance to Use Delegated Authorization .................................................... 198 16.3.1 Delegated Authorization and User Types ................................................................... 199 16.4 After Authorization The State of the System ................................................................... 199 Appendix A:Tightening Security for a Cach Instance .................................................................. 201 A.1 Enabling Auditing .................................................................................................................. 201 A.2 Changing the Authentication Mechanism for an Application ............................................... 202 A.2.1 Giving the %Service_CSP:Use Privilege to the CSPSystem User ............................. 203 A.2.2 Changing the Password of the CSPSystem User ........................................................ 204 A.2.3 Configuring the CSP Gateway to Provide a Username and Password ........................ 204 A.2.4 Configuring %Service_CSP to Require Password Authentication ............................. 205 A.2.5 Removing the Public Status of the %Service_CSP:Use Privilege .............................. 205 A.2.6 Configuring the Management Portal to Accept Password Authentication Only ......... 205 A.2.7 Specifying the Appropriate Privilege Level for the Instances Users .......................... 206 A.2.8 Making the Documentation or Samples Available ...................................................... 207 A.2.9 Beginning Enforcement of New Policies .................................................................... 208 A.3 Limiting the Number of Public Resources ............................................................................ 208 A.4 Restricting Access to Services ............................................................................................... 209 A.4.1 Limiting the Number of Enabled Services .................................................................. 209 A.4.2 Limiting the Number of Public Services ..................................................................... 210 A.4.3 Restricting Access to Services by IP Address or Machine Name ............................... 210 A.5 Restricting Public Privileges ................................................................................................. 211 A.6 Limiting the Number of Privileged Users ............................................................................. 211 A.7 Disabling the _SYSTEM User .............................................................................................. 212 A.8 Restricting Access for UnknownUser ................................................................................... 212 A.8.1 Potential Lockout Issue with the UnknownUser Account When Increasing Security . 213 Appendix B:Using the cvencrypt Utility .......................................................................................... 215 B.1 Converting an Unencrypted Database to be Encrypted ......................................................... 215 B.2 Converting an Encrypted Database to be Unencrypted ......................................................... 217 B.3 Converting an Encrypted Database to Use a New Key .......................................................... 218 B.4 Using Command-line Options with cvencrypt ...................................................................... 220 B.5 Using cvencrypt in Batch Mode on OpenVMS ..................................................................... 221 Appendix C:Frequently Asked Questions about Cach Security .................................................. 223 Appendix D:Relevant Cryptographic Standards and RFCs ......................................................... 225 Appendix E:Using Character-based Security Management Routines ......................................... 227 E.1 ^SECURITY .......................................................................................................................... 228 E.2 ^EncryptionKey ..................................................................................................................... 229 E.3 ^DATABASE ......................................................................................................................... 230 E.4 ^%AUDIT .............................................................................................................................. 231
List of Figures
Figure 11: Cach Security and Different Levels of the Computing Environment ................................ 3 Figure 12: Cach Auditing System ...................................................................................................... 10 Figure 21: Architecture of a Web Connection ..................................................................................... 17 Figure 22: Architecture of a Kerberos-Protected Web Connection ..................................................... 20
List of Tables
Table 21: Connection Tools, Their Access Modes, and Their Services ............................................... 19 Table 31: Database Privileges .............................................................................................................. 47 Table 32: %DB_%DEFAULT Privileges ............................................................................................. 47 Table 41: Default Public Privileges ..................................................................................................... 53 Table 51: Role Properties .................................................................................................................... 56 Table 52: Predefined Roles and Their Privileges ................................................................................. 65 Table 61: User Account Properties ...................................................................................................... 69 Table 62: User Profile Properties ......................................................................................................... 76 Table 63: Predefined Users .................................................................................................................. 77 Table 71: Services with Authentication Mechanisms .......................................................................... 85 Table 81: Protection/Escalation Matrix for Secured Applications ...................................................... 90 Table 82: Cach System Web Applications ......................................................................................... 98 Table 91: System Audit Events .......................................................................................................... 103 Table 131: Valid Certificate Distribution Schemes ............................................................................ 175 Table I1: Required Public Resources and Their Permissions ............................................................ 209
This books advanced topics are: SQL Security System Management and Security Using SSL/TLS with Cach Using Delegated Authentication Using LDAP Authentication Using Delegated Authorization
The books appendices are: Tightening Security for a Cach Instance Using the cvencrypt Utility Frequently Asked Questions about Cach Security Relevant Cryptographic Standards and RFCs Using Character-based Security Management Routines
For a detailed outline, see the Table of Contents. Other related topics in the Cach documentation set are:
The Cach Installation Guide, the Preparing for Cach Security appendix provides preliminary setup information for an instance that will use security. Using Cach Server Pages (CSP), the CSP Architecture chapter describes how to configure CSP applications, including security-related properties. Using Cach SQL, the Users, Roles, and Privileges chapter provides the SQL perspective on Cach security.
1
About Cach Security
Cach provides a simple, unified security architecture with the following features: It offers a strong, consistent, and high-performance security infrastructure for applications. It meets certification standards. It makes it easy for developers to build security features into applications. It places a minimal burden on performance and operations. It ensures that Cach can operate effectively as part of a secure environment and that other applications and Cach can work together well. It provides infrastructure for policy management and enforcement.
Figure 11: Cach Security and Different Levels of the Computing Environment
Cach security is based on authentication, authorization, auditing, and database encryption: Authentication verifies the identity of all users. It is described in the section Authentication: Establishing Identity. Authorization ensures that users can access the resources that they need, and no others. It is described in the section Authorization: Controlling User Access. Auditing keeps a log of pre-defined system and application-specific events. It is described in the section Auditing: Knowing What Happened. Managed key encryption protects information against unauthorized viewing. It is described in the section Managed Key Encryption: Protecting Data on Disk.
Note:
Cach SQL security uses the Cach authentication infrastructure. The tools for Cach security authorization are described in this book, while the Cach SQL security authorization system is described in the Users, Roles, and Privileges chapter of the Using Cach SQL book.
You can also allow all users to connect to Cach without performing any authentication. This option is appropriate for organizations with strongly protected perimeters or in which neither the application nor its data are an attractive target for attackers.
Scalable The Kerberos protocol minimizes the number of interactions with its Key Distribution Center (KDC); this prevents such interactions from becoming a bottleneck on larger systems. Fast As an open-source product, the Kerberos code has been scrutinized and optimized extensively over the years.
Underlying Kerberos authentication is the AES encryption algorithm. AES the Advanced Encryption Standard is a royalty-free, publicly-defined symmetric block cipher that supports key sizes of 128, 192, and 256 bits. It is part of the US Federal Information Processing Standard (FIPS), as chosen by United States National Institute of Standards and Technology (NIST). For detailed content, see Configuring for Kerberos Authentication in the Authentication chapter.
where Resource-Name is the specific resource for which permissions are being granted and Permission is one or more permissions being associated with the resource. For example, the granting of read and write permissions on the EmployeeInfo database is represented as:
%DB_EmployeeInfo:Read,Write
or
%DB_EmployeeInfo:RW
For most resource types, the relevant permission is Use; for databases, the permissions are Read and Write. Granting or revoking this permission enables or disables access to the resources action(s). For most resources, the name of a resource is <resource-type>_<specific-resource>, such as %Admin_Operate, %Service_SQL, or the %DB_SAMPLES database.
3.
A user connects to Cach to perform some set of tasks. A role describes a set of privileges that a user holds. Roles provide an intermediary between users and privileges. Instead of creating as many sets of privileges as there are users, roles allow you to create sets of task-specific privileges. You can grant, alter, or remove the privileges held by a role; this automatically propagates to all the users associated with that role. Instead of managing a separate set of privileges for each and every user, you instead manage a far smaller number of roles. For example, an application for a hospital might have roles for both a doctor making rounds (RoundsDoctor) and a doctor in the emergency room (ERDoctor), where each role would have the appropriate privileges. An individual user could be a member of just one of the two roles, or of both of them. Cach comes with a set of pre-defined roles: %Manager, %Operator, %Developer, %SQL, and a role for each of the initially-installed databases; the database-related roles have names of the form %DB_<database-name>. Cach also comes with a role called %All, which holds all privileges that is, all permissions on all resources. There is no way to reduce this roles privileges, and at least one user must always belong to this role. Each user has an associated $Roles variable, which contains the list of roles held. Once Cach authenticates a user (using one of the mechanisms described in the section Authentication: Establishing Identity ), it grants that user all associated roles. This set of initially granted roles is known as login roles. A users login roles establishes a default value for the $Roles variable. Once logged in, a user may temporarily be a member of additional roles either from a Cach application or from some part of the Cach system itself; these are reflected in the value of the $Roles variable. The set of roles that a user has at any particular moment is called that users active roles. If, at any point, a call sets the value of $Roles to NULL (""), then the value of $Roles reverts to the login roles. When Cach adds new items to the list of roles in the $Roles variable, this is known as escalating roles. The removal of roles from the list is known as role de-escalation.
Note:
Service resources Tools for connecting to or among Cach servers. See the section Service Resources for more information. Application resources User-defined applications, applications that come with Cach, an action in code, or a page in the Management Portal. See the section Application Resources for more information.
User account management Role management Resource management Starting and stopping services Database encryption tasks
%Admin_Manage Controls a set of tasks related to managing a Cach instance. In addition to those listed for %Admin_Operate and %Admin_Secure, these include
Configuration management Adding, modifying, and deleting databases Modifying namespace mappings Managing backup definition Performing database restores Performing journal restores
Using direct mode (the programmer prompt) Establishing Studio connections to a server Using the global, routine, class, table, or SQL capabilities of the Cach Management Portal. Access to global, routine, class, table, or SQL capabilities programmatically Cach debugging facilities
according to the privilege level specified by the users roles. (For services that support multiple authentication mechanisms, these are used in a pre-determined order.) There are a large number of services available as part of Cach. These include: Client/server services, such as for SQL Console, Telnet, and Terminal (for various kinds of terminal connections) A CSP connection service (for CSP and Zen web applications) Networking services, such as ECP
To use a service, you must hold the Use permission on the services resource.
For database resources, there are two permissions available: Read Allows viewing but not modification of content, and also running of routines Write Allows view and modification of content
In each database, all routines that begin with the % character are visible to all users of the entire Cach instance, regardless of their roles. Further, all these routines have read-write privileges on all globals in the database.
For example, Cach comes with the DocBook web application for displaying documentation; if you are reading this in a browser, then you are using the DocBook application right now. For more information on applications, see the Applications chapter. In addition to using Application resources to protect the application as a whole, you can also use these resources to perform authorization for a particular piece of code or with a particular Portal page. For more information on adding authorization code into an application, see the section Checking Privileges in the Privileges and Permissions chapter; for more information on authorization checks for a particular Portal page, see the section Using Custom Resources with the Management Portal in the Resources chapter.
The auditing facility allows you to enable logging for various system events, as well as user-defined events. Authorized users can then create reports based on this audit log, using tools that are part of Cach. Because the audit log can contain sensitive information, running an audit report itself generates an entry for the audit log. The included Cach tools support archiving the audit log and other tasks.
Different environments require different actions if the audit log becomes full. This is why Cach makes this behavior fully configurable. If it becomes impossible to write to the audit database, you can choose to either: Halt Cach
For example, in a critical-care medical environment, a doctor may need to get a medical history in a life-threatening situation. Here, it may be necessary to overwrite the oldest existing records. Otherwise, if this action is supposed to generate an audit entry and the audit database is full, the action will fail. No medical history will be available, with potentially disastrous results. (It is crucial to establish a protocol for unaudited operation, to ensure that an attacker does not intentionally generate a full audit database in order to penetrate a system without being noticed.) Alternatively, a system at a bank may consider auditing itself critical. Here, when the audit log becomes full and it becomes impossible to write to the audit database, then Cach halts. In this case, there can be no further transactions until logging is restored. In either case, it is incumbent on the local system administrator to make a reasonable estimation of how long it will take to fill the audit databases available space and perform maintenance operations in a timely manner.
2
Authentication
Authentication Basics About the Different Authentication Mechanisms About the Different Access Modes Configuring for Kerberos Authentication Configuring for Operating-Systembased Authentication Configuring for Authentication with Cach Login Configuring for Two-factor Authentication Other Topics
Cach supports authentication using user-defined code, which is known as delegated authentication. It also supports authentication using LDAP, the Lightweight Directory Access Protocol. Finally, for those sites that prefer no authentication at all, Cach supports unauthenticated access. The authentication mechanism is used by what are called connection tools. These specify the means by which users establish their connection with Cach. Each connection tool (such as the Cach Terminal, Java, or CSP) uses a Cach service that allows the administrator to specify the supported authentication mechanism(s). (A Cach service is a gatekeeper for connecting to Cach; for more information on services, see the chapter Services.)
Authentication
There are three categories of connection tools, each of which is known as an access mode. Each access mode has its own characteristics and has its own supported services. The access modes are: Local The user interacts directly with the Cach executable on the machine where that executable is running. Client/Server The user is operating a separate executable that connects to Cach. Web The user has a Web browser and is interacting with Cach through a Web-based application.
An end-user uses a connection tool to interact with Cach in a particular access mode using a particular authentication mechanism. Remember that the processes described in this chapter do not themselves establish authenticated access. Rather, they establish the infrastructure that an application uses when authenticating users via a particular mechanism in a particular access mode. It is recommended that each instance of Cach use only one authentication mechanism and that you choose the instances authentication mechanism prior to installing Cach. Once installation has occurred, you can then begin configuring Cach to use the selected mechanism. This involves several steps: With Kerberos, ensure that all Cach users are listed in the Kerberos KDC (Key Distribution Center) or Windows Domain Controller. With operating-systembased authentication, ensure that all Cach users appear in the operating system list. For all authentication mechanisms, configure all supported services to use only the selected authentication mechanism. For all authentication mechanisms, disable all unsupported services. For all authentication mechanisms, configure all applications to use only the selected authentication mechanism. Regardless of the selected authentication mechanism, during start-up and shut-down, operating system authentication is always used.
Note:
Heres how to use this chapter: 1. If you have already chosen an authentication mechanism, read about it; if you have not chosen an authentication mechanism, read about them all and choose one. The relevant section for this is About the Different Authentication Mechanisms. Read about those access modes that are relevant for your situation in the section About the Different Access Modes. Configure your environment according to the instructions in Configuring for Kerberos Authentication, Configuring for Operating-SystemBased Authentication, or Configuring for Authentication with Cach Login. To use an external mechanism for authentication, Cach includes support for LDAP authentication and delegated (user-defined) authentication. For all authentication mechanisms, Cach supports two-factor authentication. If you want to implement two-factor authentication, configure the instance according to the instructions in the section Configuring Two-factor Authentication.
2. 3.
4.
Authentication
All connection tools support authentication through Kerberos or Cach login except %Service_ComPort, which only supports authentication through Cach login. In each case, the server specifies the supported authentication type(s). When the client initiates contact with the server, it must attempt to use one of these supported types; otherwise, the connection attempt is rejected. Not all authentication types are available for all connection tools.
1. 2. 3. 4.
A user requests content or an action in a Web browser. The Web browser passes along the request to the Web server. The Web server is co-located with the CSP Gateway and passes the request to the Gateway. The Gateway passes the request to the Cach server.
When the Cach server provides content for or performs an action relating to the user, the entire process happens in the other direction.
Authentication
For the user to authenticate to Cach, a username and password must be passed down the line. Hence, this access mode is also known as a proxy mode or proxy connection. Once the information reaches the Cach machine, the arrangement between user and server is similar to that in the local access mode. In fact, the web access mode also uses in-process authentication.
5.
Setting up this information may involve configuring a Windows preferred server or some other configuration mechanism. See the section Setting Up a Client for more information. 6. Specify how the authentication process obtains user credentials. This is either by checking the users Kerberos credentials cache or by providing a Kerberos password prompt for the user. See the section Obtaining User Credentials for more information. To maximally secure web connections, set up secure channels for the following connections: Web browser to Web server CSP Gateway to Cach server On Windows, when logged in using a domain account, OS-based and Kerberos authentication are the same. When logged on locally, Kerberos is subject to a KDC spoofing attack and is therefore neither secure nor recommended.
7.
Important:
The following is a list of connection tools, their access modes, and their services:
2.4.1.1 Local
Kerberos authentication for a local service establishes that the user and Cach are both valid Kerberos principals. There is only one machine in use and only one process on that machine; hence, the configuration pages for these services in the Portal allow you to specify whether to use Kerberos prompting (labeled simply as Kerberos in the Management Portal) or Kerberos credentials cache. In this scenario, there is no connection between the user and Cach, since both are using the same process on the same machine. Because the two are sharing a process, there is no information being passed through an insecure medium and therefore no need to offer special protections for this data. (This situation is known as in-process authentication.)
2.4.1.2 Client/Server
Client/server applications include connections from ActiveX, C++, Java, JDBC, ODBC, Perl, Python, and through Cach Direct and Telnet. For a client/server application using Kerberos authentication, the user needs credentials to interact with Cach via the application. The server and client each require configuration. Server configuration specifies which type of connections are accepted; client configuration specifies what type of connection is attempted and may also specify how to obtain the users credentials. With client/server connections, Kerberos supports various connection security levels, which are configured on the Cach server machine: Kerberos Kerberos manages the initial authentication between the user and Cach. Subsequent communications are not protected. Kerberos with Packet Integrity Kerberos manages the initial authentication between the user and Cach; each subsequent message has a hash that provides source and content validation. This provides verification that each message in each direction is actually from its purported sender; it also provides verification that the message has not been altered in transit from sender to receiver. Kerberos with Encryption Kerberos manages initial authentication, ensures the integrity of all communications, and also encrypts all communications. This involves end-to-end encryption for all messages in each direction between the user and Cach.
Authentication
2.4.1.3 Web
When running a web application (using either CSP or Zen), the user does not interact directly with the Cach server. To protect all information from monitoring, you need to encrypt the connections between the user and Cach as follows: Configure the Web server so that it uses SSL to secure browser connections to it. Co-locate the Web server and the CSP Gateway, so there is no need to secure the connection between them. Configure the CSP Gateway to use Kerberos authentication and encryption. Use the Gateways Kerberos principal to establish such a connection.
This applies to both CSP and Zen, since Zen uses CSP for its underlying connection. The architecture is:
Any communications between the end-user and Cach occurs through SSL-encrypted or Kerberos-encrypted pipes. For Kerberos-secured connections, this includes the end-users Kerberos authentication. Because the Cach server cannot prompt the end-user for a password, it invokes an API that sends HTML content to the browser to prompt. The user completes this form that has been sent; it travels back to the Web server, which hands it to the CSP Gateway, which then hands it to the CSP server (which is part of Cach itself). The CSP server acts as a proxy on behalf of the user at the browser; this is why this kind of a connection is known as a proxy connection. At the same time, all information related to the user resides on the server machine (as with the local access mode); hence a web connection is also a form of in-process authentication.
For any Kerberos connection using one of these services, you must specify the connection security levels which the server accepts. To configure the services supported connection security levels, the procedure is: 1. On the Authentication Options page ([System] > [Security Management] > [System Security Settings] > [Authentication Options]), specify which connection security levels to enable for the entire Cach instance, where these can be:
Kerberos
For more information on the Authentication Options page, see the section Authentication Options in the chapter System Management and Security. 2. 3. On the Services page ([System] > [Security Management] > [Services]), click the service name (in the Name column); this displays the Edit Service page for the service. On the Edit Service page, specify which connection security levels to require as part of a Kerberos connection. After making this selection, click Save.
If a client attempts to connect to the server using a lower level of security than that which is specified for the server, then the connection is not accepted. If a client attempts to connect to the server using a higher level of security than that which is specified for the server, then the server connection attempts to perform authentication using the level of security that it specified.
2.4.3.1 Telnet and Cach Direct: Setting Up the Preferred Server for Use with Kerberos
With a Windows client, when establishing a connection using Cach Direct or Cach telnet for Windows, the client uses configuration information that has been stored as part of a remote server. Important: Cach has its own telnet server for Windows. When connecting to a non-Windows machine, there is no Cach telnet server available you simply use the telnet server that comes with the operating system. Once you have established the connection to the server machine, you can then start Cach using the %Service_Terminal service.
To configure a client connection coming in through telnet or Cach Direct, go to the client machine. On that machine, the procedure is: 1. 2. 3. 4. 5. Click on the Cach cube and select Preferred Server from the menu (the Preferred Server choice also displays the name of the current preferred server). From the submenu that appears, choose Add/Edit. To create a new remote server, click the Add button; to configure an already-existing server, choose the Cach server to which you are connecting and click the Edit button. This displays the Add Connection dialog. In the Authentication Method area on that dialog, click Kerberos. This expands the dialog to display a number of additional fields. If you are editing the values for an already-existing server, there should be no need to change or add values for the more general fields in this dialog, as they are determined by the server that you chose to edit. If you are adding a new server, the fields to complete are described in the section Define a Remote Server Connection of the Connecting to Remote Servers chapter of the Cach System Administration Guide. 6. In the dialogs Kerberos-related fields, specify values for the following fields: The connection security level, where the choices are Kerberos authentication only; Kerberos authentication with packet integrity; or Kerberos authentication, packet integrity, and encryption The service principal name. For information on setting up service principal names, see the section Names and Naming Conventions in the appendix Preparing for Cach Security of the Cach Installation Guide.
Authentication
If you are configuring a telnet connection to a Windows machine, check the box specifying that the connection use the Windows Cach Telnet server.
7.
The names of these variables must have spaces between the words. They are not case-sensitive. On a Windows client, you can specify connection information either through a GUI or programmatically: Through a GUI, there is an ODBC DSN configuration dialog. Cach provides options on the System DSN tab. This screen has associated help that describes its fields. The path on the Windows Start menu to display this screen varies by version of Windows; it may be listed under Administrative Tools. Important: On 64-bit Windows, there are two versions of odbcad32.exe: one is located in the C:\Windows\System32\ directory and the other is located in the C:\Windows\SysWOW64\ directory. If you are running 64-bit Windows, configure DSNs through the one in C:\Windows\SysWOW64\.
Programmatically, the SQLDriverConnect function is available, which accepts a set of name-value pairs. SQLDriverConnect is a C call that is part of the ODBC API and is documented at the Microsoft Web site. Its name-value pairs are the same as those for the initialization file available on non-Windows platforms.
2.
Note:
This program uses Java Generic Security Services (JGSS) to perform the following actions:
If necessary, modifies the java.security file. Creates or modifies the isclogin.conf file. Note: The parameters to the login module that appear in the isclogin.conf file depend on whether the server is using the Sun Java implementation or the IBM Java implementation. AIX and SUSE Linux use the IBM implementation; all other supported Cach platforms use the Sun implementation.
3.
The program then prompts you to create and configure the krb5.conf file. If the file exists, the command prompts if you wish to use the existing krb5.conf or replace it; if you choose to replace it, it prompts for the following information: a. b. c. Kerberos realm It offers the local domain in lowercase as a default value for the domain. Primary KDC You only need include the local machine name, as the program appends the Kerberos realm name to the machine name for you. Secondary KDC(s) You can specify the names of zero or more KDCs to replicate the content of the primary KDC.
4. 5.
After receiving this information, run the command a second time. (It instructs you to do this.) When prompted to replace krb5.conf, choose to leave the existing file. The command then tests the connection by prompting for the username and password of a principal in the specified Kerberos realm.
2.4.3.4 Setting Up a Client on C++, Perl, Python, and ActiveX for Use with Kerberos
To be able to establish a Kerberized connections through these bindings, you need only configure the Cach server to accept Kerberos connections. Once the server is properly configured, the application then can establish the connection by using the appropriate calls. For information on the appropriate language-specific calls, see the Cach Language Bindings books.
To specify how to get credentials, the procedure is: 1. 2. On to the Services page ([System] > [Security Management] > [Services]) and select the service from the Name column. This displays the Edit Service page for the service. On the Edit Service page, specify how to get credentials. Either select prompting (the Kerberos check box) or by using a credentials cache (the Kerberos Credentials Cache check box). Do not mark both. Click Save to use the settings.
Authentication
Note:
If you enable both Kerberos (prompting) and Kerberos credentials cache authentication for the service, then the credentials cache authentication takes precedence. This is behavior specified by Kerberos, not Cach.
On Windows with a Domain Controller (the likely configuration for Windows), logging in establishes a Kerberos credentials cache. On UNIX, OpenVMS, and Mac, the typical default condition is to have no Kerberos credentials, so that Cach is then configured to use Kerberos prompting; on these systems, the user can obtain credentials in either of the following ways: Running kinit before invoking the Cach Terminal Logging in to a system where the login process performs Kerberos authentication for the user
In the following discussions, the instance of the java.util.Properties class is referred to as the connection_properties object, where the value of each of its properties is set with a call to the connection_properties.put method, such as
For both implementations, credentials-related behavior is determined by the value of a parameter in the isclogin.conf file (see Setting Up a Java or JDBC Client for Use with Kerberos for more information on this file). There are two differences between the behavior of the two Java implementations: To specify credentials-related behavior, the parameter name to set in the isclogin.conf file differs for each implementation: For IBM, it is useDefaultCcache. For Sun, it is useTicketCache.
There are different behaviors available on each implementation. These are described in the following sections.
Specifying Behavior on a Client Using the IBM Implementation The options are: To use a credentials cache, set the value of the useDefaultCcache parameter to TRUE and do not set the values of the user or password properties. Note that if no credentials cache is available, then an exception is thrown. To use a username and password that are passed in programmatically, set the value of the useDefaultCcache parameter to FALSE and set the values of the user and password properties. To prompt for a username and password, set the value of the useDefaultCcache parameter to FALSE and do not set the values of the user or password properties. Because these properties do not have values set, classes from libraries supplied with Cach can be used to generate prompts for them.
Specifying Behavior on a Client Using the Sun Implementation The options are: To exclusively use a username and password that are passed in programmatically, set the value of the useTicketCache parameter to FALSE and set the values of the user and password properties. To exclusively prompt for a username and password, set the value of the useTicketCache parameter to FALSE and do not set the values of the user or password properties. Because these properties do not have values set, classes from libraries supplied with Cach can be used to generate prompts for them. To exclusively use a credentials cache, set the value of the useTicketCache parameter to TRUE. To prevent any further action, set the values of the user and password properties to bogus values; this prevents prompting from occurring and ensures the failure of any authentication attempt based on the properties values. To attempt to use a credentials cache and then fall through to using a username and password that are passed in programmatically, set the value of the useTicketCache parameter to TRUE and set the values of the user and password properties. If there is no credentials cache, then the properties values are used. To attempt to use a credentials cache and then fall through to prompting for a username and password, set the value of the useTicketCache parameter to TRUE and do not set the values of the user or password properties. If there is no credentials cache, then classes from libraries supplied with Cach can be used to generate prompts for them.
Authentication
2.4.5.1 Securing the Connection between a Web Browser and Web Server
The typical means of securing a connection between a Web browser and a Web server is to use SSL (Secure Sockets Layer) or TLS (Transport Layer Security), its successor. While Cach does not provide implementations of these technologies to accomplish this, various third-party products provide this capability.
The procedure is: 1. Determine or choose the name of the Kerberos principal that represents the Gateway. For Windows, this is the principal name representing the Gateway hosts network service session (that is, the name of the machine hosting the Gateway with the $ appended to it machine_name$, , such as Athens$). For other platforms, this is any valid principal name entered as the username in the Gateway configuration screen; this identifies the appropriate key in the key table file. 2. 3. 4. 5. Create a user in Cach with the same name as the Gateways Kerberos principal. To do this, follow the instructions in the section Creating a New User in the Users chapter. Give that user permissions to use, read, or write any required resources (these are also known as privileges). This is done by associating those privileges with a role and then associating the user with the role. Configure the %Service_CSP service. To do this, complete the fields described in the section Service Properties in the Services chapter. Configure the Gateway so that it can contact the server. The procedure is: a. b. c. From the Management Portal home page, select Configuration >> CSP Gateway Management. This displays the Web Gateway management page. On the Web Gateway management page, there are a set of choices on the left. Under Configuration, click Server Access. This displays the Server Access page. On the Server Access page, you can add a new configuration or edit an existing one. To add a new configuration, click the Add Server button; to edit an existing one, select it from the list on the left, select the Edit Server radio button, and click Submit. This displays the page for editing or configuring server access parameters. In addition to the general parameters on this page (described on its help screen), this page allows you to specify securityrelated parameters for the Gateway. For Kerberos connections, these are:
Connection Security Level Choose the kind of protection that you would like Kerberos to attempt to provide
this connection. (Note that this must match or exceed the type of security specified for the CSP service in the previous step.) The name of the Kerberos principal that represents the Gateway. (This must be the same principal as was used in the first step of this process.)
User Name
Do not specify a value for this. (This field is used when configuring the Gateway for use with Cach login.)
Password Product
The name of the principal that represents the Cach server. This is typically a standard Kerberos principal name, of the form cache/machine.domain , where cache is a fixed string indicating that the service is for Cach, machine is the machine name, and domain is the domain name, such as intersystems.com .
Service Principal Name Key Table When connecting to an instance of Cach on Windows, leave this field blank; for other operating
systems, provide the name of the keytab file containing the permanent key belonging to the CSP Gateway, including the full path. After entering all these values, click the Save Configuration button to save them. The CSP service is now ready to configured. This means that it can now provide the necessary underlying infrastructure to support a web application. When creating a secured web application, the application developer needs to: 1. 2. 3. Choose an authentication method. Configure the roles for the application. If required, make sure the browser-to-Web server connection uses SSL.
To set up the use of this type of authentication, the procedure is: 1. 2. 3. On the Authentication Options page ([System] > [Security Management] > [Authentication Options]), select Allow Operating System authentication. On to the Services page ([System] > [Security Management] > [Services]) and select the service from the Name column. This displays the Edit Service page for the service. On the Edit Service page, choose operating-systembased (the Operating System check box).
Authentication
Click Save to use the settings. This type of authentication requires no other configuration actions. Note: On Windows, when logged in using a domain account, OS-based and Kerberos authentication are the same.
For a service to use Cach login, you must configure it as follows: 1. 2. 3. 4. 5. On the Authentication Options page ([System] > [Security Management] > [Authentication Options]), enable authentication with Cach login by selecting Allow Password authentication). For the particular service, go to the Services page ([System] > [Security Management] > [Services]) and select that service, such as %Service_Bindings, in the Name column; this displays the Edit Service page for the service. On this page, choose Cach login, listed simply as Password from the list of authentication types. Click Save to save this setting. In addition to this basic procedure, certain services require further configuration. This is described in the following sections: Web ODBC Telnet and Cach Direct
2.6.1 Web
For web access, you can optionally require that the CSP Gateway authenticate itself to the Cach server through Cach login. To perform this configuration, the procedure is: 1. 2. 3. From the Management Portal home page, select System Administration >> Configuration >> CSP Gateway Management. This displays the Web Gateway management page. On the Web Gateway management page, there are a set of choices on the left. Under Configuration, click Server Access. This displays the Server Access page. On the Server Access page, you can add a new configuration or edit an existing one. To add a new configuration, click the Add Server button; to edit an existing one, select it from the list on the left, select the Edit Server radio button, and click Submit. This displays the page for editing or configuring server access parameters. In addition to the general parameters on this page (described on its help screen), this page allows you to specify security-related parameters for the Gateway. For Cach login connections, these are:
Connection Security Level
User Name The user name under which the Gateway service runs (the installation process creates the CSPSystem
user for this purpose). This user (CSPSystem or any other) should have no expiration date; that is, its Expiration Date property should have a value of 0.
Password Product
Cach or Ensemble, depending on which product you are using. Do not specify a value for this. (This field is used when configuring the Gateway for
Do not specify a value for this. (This field is used when configuring the Gateway for use with Ker-
beros.) After entering all these values, click the Save Configuration button to save them. It is important to remember that the authentication requirements for the Gateway are not directly related to those for an application that uses the Gateway. For example, you can require Cach login as the authentication mechanism for a web application, while configuring the Gateway to use Kerberos authentication or no authentication at all. In fact, choosing a particular authentication mechanism for the Gateway itself makes no technical requirement for the web application, and vice versa. At the same time, some pairings are more likely to occur than others. If a web application uses Kerberos authentication, then using any other form of authentication for the Gateway means that Kerberos authentication information will be flowing through an unencrypted channel, thereby potentially reducing its effectiveness. With a web application that uses Cach login, the username and password of the end-user are passed from the browser to the Web server, which then hands them to the co-located CSP Gateway. Since the Gateway has its own connection to the Cach server, it then passes the username and password to the Cach server. To establish its connection to the Cach server, the Gateway uses the CSPSystem account, which is one of the Cach pre-defined accounts. By default, all these transactions are unencrypted. You can use SSL to encrypt messages from the browser to the Web server. You can use Kerberos to encrypt messages from the Gateway to the the Cach server as described in the section Setting Up a Secure Channel for a CSP Connection; if you are not using Kerberos, you may prefer to physically secure the connection between the host machines, such as by co-locating the Gateway and Cach server machines in a locked area with a direct physical connection between them.
Authentication
2.6.2 ODBC
Cach supports Cach login for ODBC connections among all its supported platforms. This requires client-side configuration. The ways of configuring client behavior vary by platform: On non-Windows platforms, use the Cach ODBC initialization file to specify name-value pairs that provide connection information . This file is described generally in Using Cach ODBC. The file has the following variables relevant to Cach login: Authentication Method Specifies how the ODBC client authenticates to the DSN. 0 specifies Cach login; 1 specifies Kerberos. UID Specifies the name for the default user account for connecting to the DSN. At runtime, depending on application behavior, the end-user may be permitted to override this value with a different user account. Password Specifies the password associated with the default user account. If the end-user has been permitted to override the UID value, the application will accept a value for the newly specified users password.
On a Windows client, you can specify connection information either through a GUI or programmatically: Through a GUI, there is an ODBC DSN configuration dialog. Cach provides options on the System DSN tab. This screen has associated help that describes its fields. The path from the Windows Start menu to display this screen varies by version of Windows; it may be listed in the Windows Control Panel, under Administrative Tools, on the screen for Data Sources (ODBC). Programmatically, the SQLDriverConnect function is available, which accepts a set of name-value pairs. SQLDriverConnect is a C call that is part of the ODBC API and is documented at the Microsoft Web site. Its name-value pairs are the same as those for the initialization file available on non-Windows platforms, except that the password is identified with the PWD keyword.
Important:
When connecting to a non-Windows machine using telnet, there is no Cach telnet server available you simply use the telnet server that comes with the operating system. Once you have established the connection to the server machine, you can then connect to Cach using the %Service_Terminal service.
b.
Note:
Configuring each user to include a mobile phone number and mobile phone service provider. This is the phone number at which the user receives a text message containing the one-time security token.
Authentication
Important:
Configure users prior to configuring services. If a service uses two-factor authentication and a user does not have a mobile phone or cannot receive text messages on that phone, then it is impossible for that user to authenticate.
4.
Enabling two-factor authentication for each service that is going to use it. Services that support two-factor authentication are:
%Service_Bindings Connections that use language bindings, such as Java, C++, .NET, and xDBC. All
bindings connections require client-side configuration as described in the section Configuring Bindings Clients for Two-factor Authentication.
%Service_Console and %Service_Terminal Terminal connections (though the console or terminal,
depending on the operating system). For the Cach terminal or console,all that is required is server configuration.
%Service_CSP Web (CSP or Zen) connections. Web applications must be configured to support two-factor
authentication; this is described in the section Configuring Web Applications for Two-factor Authentcation.
server that is in use for the instance of Cach, such as smtp.example.com (required).
From (address)
Optional timeout in seconds for entering the one-time security token. A negative value for this property is equivalent to having a value of zero.
Timeout (in seconds) SMTP username Password
Optional username for SMTP authentication (if the SMTP server requires it).
Password options of: Allows for entering and confirming a new password
4.
Click Save.
This displays the Edit Phone Provider page for the selected mobile phone service provider. 2. On the Edit Phone Provider page, enter or change the value for each of the following fields:
Service Provider SMS Gateway
The name of the mobile phone service provider (typically, its company name).
The address of the server that the mobile phone service provider uses to dispatch SMS (short message service) messages.
You can also create a mobile phone service provider when editing a user, as described in the section Configuring a User for Two-factor Authentication.
3.
Authentication
The company that provides mobile phone service for the user. Either select a provider from those listed or, if the provider does not appear in the list, click Create new provider to add a new provider for the Cach instance. (Clicking Create new provider displays the Add Phone Provider window, which has fields for the Service Provider and the SMS Gateway, the purpose of which are identical to those described in the section Creating or Editing a Mobile Phone Service Provider.)
Mobile phone service provider Mobile phone number The users mobile phone number. This is the second factor, and is where the user receives
the text message containing the one-time security token. 4. Click Save to save these values for the user. Before enabling two-factor authentication for a service, you must configure the services users to be able to receive the one-time security tokens. Enabling it for the service requires that the instance have the mobile phone numbers and service providers for all authenticating users, so that the instance can send the onetime security tokens during the second phase of authentication.
Important:
For general information about the Edit Web Application page, see the CSP Application Options section of the CSP Architecture chapter of the Using Cach Server Pages (CSP) book.
Client-side code performs three operations: 1. 2. 3. After establishing a connection to the Cach server, it checks if two-factor authentication is enabled on the server. Typically, this uses a method of the clients connection object. It gets the one-time security token from the user. This generally involves user-interface code that is not specifically related to Cach. It provides the one-time security token to the Cach server. This also typically uses a connection object method. Studio, which connects to the Cach server using %Service_Bindings, does not support two-factor authentication.
Important:
2.7.3.1 C++
With C++, support for two-factor authentication uses two methods of the tcp_conn class:
bool tcp_conn::is_two_factor_enabled()
This method checks if two-factor authentication is enabled on the server. It returns a boolean; true means that twofactor authentication is enabled.
bool tcp_conn::send_two_factor_token(const wchar_t* token, Conn_err* err)
This method provides the two-factor authentication token to the server. It returns a boolean; true means that the user has been authenticated. It takes two arguments: token, the two-factor authentication token that the user has received. Note that the client application is responsible for obtaining the value of the token from the user. err, an error that the method throws if the user does not successfully authenticate. If two-factor authentication is enabled on the server and the client code does not implement two-factor authentication calls, then the server will drop the connection with the client.
Important:
The following example uses an instance of a connection called conn: 1. 2. It uses that instances methods to check if two-factor authentication is enabled. It attempts to provide the token to the server and performs error processing if this fails. Note that the sample code here assumes that the application code has stored the one-time security token in a variable of type std::string; it then uses the c_str method of the string class to extract the one-time security token as a null-terminated string to pass to the server.
// Given a connection called "conn" if (conn->is_two_factor_enabled()) { // Prompt the user for the one-time security token. // Store the token in the "token" variable of type std::string. Conn_err err; if (!conn->send_two_factor_token(token.c_str(), &err;)) // Process the error from a invalid authentication token here. }
Note:
Authentication
This method checks if two-factor authentication is enabled on the server. It returns a boolean; true means that twofactor authentication is enabled.
public void sendTwoFactorToken(String token) throws Exception
This method provides the one-time security token to the server. It takes one argument, token, the one-time security token that the user has received. The following example uses an instance of a connection called conn: 1. 2. It uses that instances methods to check if two-factor authentication is enabled. It attempts to provide the token to the server and performs error processing if this fails. If two-factor authentication is enabled on the server and the client code does not implement two-factor authentication calls, then the server will drop the connection with the client.
Important:
// Given a connection called "conn" if (conn.isTwoFactorEnabled()) { // Prompt the user for the two-factor authentication token. // Store the token in the "token" variable. try { conn.sendTwoFactorToken(token); } catch (Exception ex) { // Process the error from a invalid authentication token here. } }
2.7.3.3 .NET
For .NET, Cach supports connections with two-factor authentication with the managed provider and with ADO.NET. Support for two-factor authentication uses two methods of the tcp_conn class:
bool CacheConnection.isTwoFactorEnabledOpen()
This method opens a connection to the Cach server and checks if two-factor authentication is enabled there. It returns a boolean; true means that two-factor authentication is enabled.
void CacheConnection.sendTwoFactorToken(token)
This method provides the one-time security token to the server. It has no return value. It takes one argument, token, the one-time security token that the user has received. If there is a problem with either the token (such as if it is not valid) or the connection, then the method throws an exception. Important: A client application makes a call to isTwoFactorEnabledOpen instead of a call to CacheConnection.Open. The isTwoFactorEnabledOpen method requires a subsequent call to sendTwoFactorToken. Also, if two-factor authentication is enabled on the server and the client code does not implement twofactor authentication calls, then the server will drop the connection with the client. The following example uses an instance of a connection called conn: 1. 2. It uses that instances methods to check if two-factor authentication is enabled. It attempts to provide the token to the server and performs error processing if this fails.
2.7.3.4 ODBC
With ODBC, support for two-factor authentication uses two standard ODBC function calls (which are documented in the Microsoft ODBC API Reference):
SQLRETURN rc = SQLGetConnectAttr(conn, 1002, &attr, sizeof(attr), &stringLengthPtr);
The SQLGetConnectAttr function, part of the Microsoft ODBC API, returns the current value of a specified connection attribute. The Cach ODBC client uses this function to determine if the server supports two-factor authentication. The value of the first argument is a handle to the connection from the client to the server; the value of the second argument is 1002, the ODBC attribute that specifies whether or not two-factor authentication is supported; the values of the subsequent arguments are for the string containing the value of attribute 1002, as well as relevant variable sizes.
SQLRETURN rc = SQLSetConnectAttr(conn, 1002, unicodeToken, SQL_NTS);
The SQLSetConnectAttr function, also part of the Microsoft ODBC API, sets the value of a specified connection attribute. The Cach ODBC client uses this function to send the value of the two-factor authentication token to the server. The values of the four arguments are, respectively: The connection from the client to the server.
1002, the ODBC attribute that specifies whether or not two-factor authentication is supported.
Important:
If two-factor authentication is enabled on the server and the client code does not implement two-factor authentication calls, then the server will drop the connection with the client.
The following example uses an instance of a connection called conn: 1. 2. It uses SQLGetConnectAttr to check if two-factor authentication is enabled. It attempts to provide the token to the server with the SQLSetConnectAttr call and performs error processing if this fails. If SQLSetConnectAttr fails, the server drops the connection, so you need to reestablish the connection before you can attempt authentication again.
// Given a connection called "conn" SQLINTEGER stringLengthPtr; SQLINTEGER attr; SQLRETURN rc = SQLGetConnectAttr(conn, 1002, &attr, sizeof(attr), &stringLengthPtr); if attr { // Prompt the user for the two-factor authentication token. wstring token; SQLRETURN rc = SQLSetConnectAttr(conn, 1002, token, SQL_NTS); if !rc { // Process the error from a invalid authentication token. } }
2.7.3.5 Perl
With Perl, support for two-factor authentication uses two methods of the Intersys::PERLBIND::Connection class:
Authentication
is_two_factor_enabled()
This method checks if two-factor authentication is enabled on the server. It returns a integer; 1 means that two-factor authentication is enabled and 0 means that it is disabled.
send_two_factor_token($token)
This method provides the two-factor authentication token to the server. It returns a integer; 1 indicates success and 0 indicates failure. Its argument, $token, is the two-factor authentication token that the user has received and then entered at the client prompt. Note that the client application is responsible for obtaining the value of the token from the user. Important: If two-factor authentication is enabled on the server and the client code does not implement two-factor authentication calls, then the server will drop the connection with the client.
The following example uses an instance of a connection called conn: 1. 2. It uses that instances methods to check if two-factor authentication is enabled. It attempts to provide the token to the server and performs error processing if this fails.
// Given a connection called "conn" if ($conn->is_two_factor_enabled()) { # Prompt the user for the one-time security token. # Store the token in the "token" variable of type std::string. if (!$conn->send_two_factor_token($token)) { # Process the error from a invalid authentication token here. } else { # two-factor authentication succeeded } else { # Handle if two-factor authentication is not enabled on the server. }
Cach comes with sample programs that demonstrate two-factor authentication with Perl. These programs are in the install-dir\dev\perl\ directory, and are samples\two_factor.pl. For more information on Perl sample programs for use with Cach, see the Sample Programs section of the Cach Perl Binding chapter of Using Perl with Cach.
2.7.3.6 Python
With Python, support for two-factor authentication uses two methods of the intersys.pythonbind.connection class:
is_two_factor_enabled()
This method checks if two-factor authentication is enabled on the server. It returns a boolean; true means that twofactor authentication is enabled.
send_two_factor_token(token)
This method provides the two-factor authentication token to the server. It returns a boolean; true means that the user has been authenticated. It takes one argument, token, the two-factor authentication token that the user has received. Note that the client application is responsible for obtaining the value of the token from the user. Note: Python leaves carriage returns in input. This means that, when processing the one-time security token, it is necessary to strip any carriage returns out of it. If two-factor authentication is enabled on the server and the client code does not implement two-factor authentication calls, then the server will drop the connection with the client.
Important:
The following example uses an instance of a connection called conn: 1. It uses that instances methods to check if two-factor authentication is enabled.
Other Topics
2.
It attempts to provide the token to the server and performs error processing if this fails.
// Given a connection called "conn" if conn.is_two_factor_enabled(): # Prompt the user for the one-time security token. # Store the token in the "token" variable of type std::string. # Make sure that the carriage returns are stripped from the string. if !conn.send_two_factor_token(token): # Process the error from a invalid authentication token here. else: # two-factor authentication succeeded else: # Handle if two-factor authentication is not enabled on the server.
Cach comes with sample programs that demonstrate two-factor authentication with Python. These programs are in the install-dir\dev\Python\ directory; they are samples\two_factor.py for Python 2.6 and samples3\two_factor.py for Python 3.0. For more information on Python sample programs for use with Cach, see the Sample Programs section of the Cach Python Binding chapter of Using Python with Cach.
The $ROLES variable allows you to manage roles programmatically. For more information on this, see the section Programmatically Managing Roles in the Roles chapter.
Authentication
The use of multiple authentication mechanisms is often in conjunction with cascading authentication, described in the next section.
Note:
For example, if a service supports authentication through: 1. 2. 3. Kerberos cache OS-based Unauthenticated
If a user attempts to connect to Cach, then there is a check if the user has a Kerberos ticket-granting ticket; if there is such a ticket, there is an attempt to obtain a service ticket for Cach. If this succeeds, the user gets in. If either there is no initial TGT or a Cach service cannot be obtained, authentication fails and, so, cascades downward. If the user has an OS-based identity that is in the Cach list of users, then the user gets in. If the users OS-based identity is not in the Cach list of users, then authentication fails and cascades downward again. When the final option in cascading authentication is unauthenticated access, then all users who reach this level gain access to Cach. Note: If an instance supports cascading authentication and a user is authenticated with the second or subsequent authentication mechanism, then there have been login failures with any mechanisms attempted prior to the successful one. If the %System/%Login/LoginFailure audit event is enabled, these login failures will appear in the instances audit log.
Other Topics
where success is a boolean where 1 indicates success and 0 indicates failure username is a string holding the name of the account logging in password is a string holding the password for the username account
If the username and password are valid and the user account is enabled and its expiration date has not been reached, then the user is logged in, $USERNAME and $ROLES are updated accordingly, and the function returns 1. Otherwise, $USERNAME and $ROLES are unchanged and the function returns 0. No checking of privileges occurs as a result of executing $SYSTEM.Security.Login. As a result, it is possible that the process has lost privileges that were previously held. There is also a one-argument form of $SYSTEM.Security.Login:
set success = $SYSTEM.Security.Login(username)
It behaves exactly the same as the two-argument form except that no password checking is performed. The single-argument form of $SYSTEM.Security.Login is useful when applications have performed their own authentication and want to set the Cach user identity accordingly. It can also be used in situations where a process is executing on behalf of a specific user but is not started by that user. Note: The single-argument Login method is a restricted system capability as described in the section Special Capabilities in the Resources chapter.
Authentication
WHILE ConditionToTest { IF SomeThingToStart { DO Start(Routine, User) } } Start(Routine, User) { NEW $ROLES // Preserve $USERNAME and $ROLES // Try to change username and roles IF $SYSTEM.Security.Login(User) { JOB ... QUIT $TEST } QUIT 0 // Login call failed }
3
Assets and Resources
Once a user has authenticated, the available resources are determined by the authorization facilities in Cach security. Authorization protects Cach components from inappropriate use, and involves the following concepts: 1. 2. An asset is something that is protected. For instance, a Cach database is an asset, the ability to connect to Cach using SQL is an asset, and the ability to perform a backup is an asset. Assets are protected via resources. Sometimes there is a one-to-one correspondence between assets and resources, that is a single asset (such as a database) is protected by one resource. In other cases, multiple assets are protected by a single resource, in order to simplify security management. For instance, a variety of system management functions are protected by a single resource. A privilege grants permission to do something with one or more assets protected by a resource, such as being able to read the orders database. A privilege is written as a resource name followed by a permission separated by a colon, such as:
%DB_Sales:Read
3.
For more information on privileges, see the chapter Privileges and Permissions. Cach includes a set of resources for assets that it protects that is, to which it provides access for users based on the rights that they hold. You can also define your own resources. This chapter addresses issues related to resources and the assets that they protect. Topics include: About Resources System Resources Database Resources Application Resources Creating or Editing a Resource Using Custom Resources with the Management Portal
These resources are %Admin_Journal, %Admin_Manage, %Admin_Operate, %Admin_Secure, %Admin_Task, %Development, and %System_Callout. Database Resources For controlling read and write access to Cach databases. For more information on these resources, see the Database Resources section of this chapter. The database resources for a newly installed Cach instance are %DB_CACHE, %DB_CACHEAUDIT, %DB_CACHELIB, %DB_CACHESYS, %DB_CACHETEMP, %DB_DOCBOOK, %DB_SAMPLES, %DB_USER, and %DB_%DEFAULT. Service Resources For controlling the ability to connect to Cach using various Cach connection technologies. For more information on these resources and the functionality that they control, see the chapter Services. Not all services have associated privileges only those services for which Cach provides user-based access; other services, such as database shadowing, are not user-based and, as a result, do not have associated security resources. For more information on managing services, see the chapter Services. The service resources are %Service_CSP, %Service_CacheDirect, %Service_Callin, %Service_ComPort, %Service_Console, %Service_Login, %Service_Object, %Service_SQL, %Service_Telnet, and %Service_Terminal. DeepSee Resources For controlling the ability to use various aspects of DeepSee. For more information on these resources, see the Setting Up Security chapter in the DeepSee II Implementation Guide. Application Resources Either for controlling the whole of a user-defined application or for perform authorization checks anywhere in user code. For information on these resources generally, see the Application Resources section of this chapter. For information on creating these resources, see the Creating or Editing a Resource section of this chapter.
System Resources
Add databases, modify database characteristics, and delete databases. Modify namespace map. Perform database and journal restores. Set and clear the no-journaling process flag via the ENABLE^%SYS.NOJRN and DISABLE^%SYS.NOJRN entry points, respectively, in programmer mode in the Cach Terminal. Note that if you wish for a user to be able to perform this task without other managerial privileges, use the %Admin_Journal resource.
%Admin_Operate Most visibly, this resource controls access to various pages in the Management Portal. Specifically, it controls the ability to: Start and stop Cach. Examine and terminate processes. Mount and dismount databases. Perform integrity checks. Start, stop, and switch journals. Perform database backups. Examine and delete locks. Examine logs. Start and stop services.
The %Admin_Operate:Use privilege is required to mount a database, either explicitly (such as when using a Cach utility) or implicitly (such as when making a global reference to an un-mounted database). %Admin_Secure Most visibly, this resource controls access to various pages in the Management Portal. Specifically, it controls the ability to: Create, modify, delete users. Create, modify, delete roles. Create, modify, delete application definitions and application resources. Modify audit settings. Modify services.
%Admin_Tasks Most visibly, this resource controls the ability to create, modify, or run a task, such as through the Management Portals Task Manager ([Home] > [Task Manager]). Note that users holding privileges on %Admin_* resources can carry out administrative functions without having any database privileges (%DB_<database-name>:R/W). For example, a user (presumably a system operator) holding the %Admin_Operate:Use privilege can perform backups without holding privileges on any of the databases being backed up. This is as it should be, since there is no reason for an operator to have access to the contents of databases other than through applications such as the Cach database backup system.
The %Development:Use privilege works in conjunction with database privileges to control developer access to Cach as follows: For Cach Studio, the %Development:Use privilege is checked whenever the Studio connects to a server. In order to connect, the user must have the %Development:Use privilege for the server and be able to read the default global database for the namespace (that is, have the %DB_<database-name>:R privilege for it). In order to open a routine, class or other definition, the user must have the Read privilege for the database in which it is stored (which may or may not be the default routine database). In order to compile or save a definition, the user must have the Write privilege for that database. For the global, routine, or class capabilities of the Cach system manager utility, the user must have the Read or Write privileges for the database to access or modify globals. For the SQL capabilities of the Cach system manager utility, the user must have the appropriate SQL privileges for the tables, views, stored procedures, or other SQL assets. If you have some form of SQL access to a table in a database, you are also granted Read or Write access to that database.
To debug a Cach application, you need no specific database privileges. If you hold the %Development:Use privilege for the system, you can set a breakpoint in any routine stored in any database on that system. However, you must have the Read privilege for a database to: View routine source via the debugger Execute a routine
Database Resources
Read and Write permissions provide access to all contents of a database, including source and executable code as well as data. Cach security management utilities automatically grant the Read permission for any database resource where there is Write access. Database privileges do not enable protection of individual items, such as routines or globals, within a database. Rather, the same protection is applied to all items of a resource within a database. You can establish higher granularity of protection by storing globals and routines in separate databases. Cach namespace mapping allows you to do this without any application-level modifications. Note: SQL security grants table-level access, specifying which particular action can be performed, such as SELECT or UPDATE. For more information on SQL and security, see the chapter SQL Security.
While you can change the privileges associated with %DB_%DEFAULT resource, you cannot delete the %DB_%DEFAULT resource itself, since it must be available if an unnamed database is mounted.
an explicit mount attempt prompts you with the choice of creating the resource named in the database label or changing the database to use a valid resource.
3.3.5 Namespaces
Users and applications interact with Cach databases through namespaces. While there are no privileges associated with namespaces, access to a namespace is granted or denied based on the privileges associated with the underlying databases. More specifically, to access a namespace, you must hold the Read privilege on the default globals database associated with that namespace. This requirement is checked when: A process attempts to change to a different namespace, such as by using the $NAMESPACE special variable, the ZNSPACE command, or the %CD utility There is an attempt to connect to Cach using any service that connects to a namespace, such as an SQL connection or an object connection This requirement is not checked when a global or routine reference is made, implicitly or explicitly, to a namespace.
Note:
The fact that namespace privileges depend on privileges for the underlying databases can lead to unexpected behavior. For example, suppose that namespace NSCust refers to data in three databases: DBCust1, DBCust2, and DBCust3. Suppose also that the role AverageUser has the privileges %DB_DBCust1:R and %DB_DBCust3:R. Because the role has no privilege associated with DBCust2, any attempt to access data in that database fails (including if it is through the namespace).
Application Resources
Special Capabilities
There are special capabilities available to code located in the CACHESYS database. These capabilities are sometimes called restricted system capabilities. They are: Invoking protected VIEW commands and $VIEW functions Using protected class methods Modifying the roles of a process with SET $ROLES = ... Invoking the single-argument form of the $SYSTEM.Security.Login function (which is the Login method of the %SYSTEM.Security class) Invoking the two-argument form of the $SYSTEM.Security.ChangePassword function (which is the ChangePassword method of the %SYSTEM.Security class) You need no database privileges to read or write database blocks with the VIEW command.
Note:
The only code that can perform these actions is: Routines stored in the CACHESYS database, but only during normal routine execution. They are disabled if a ZINSERT into the current routine has modified the routine, and they are also not available in XECUTE commands or through argument indirection. Processes with the Write permission on the %DB_CACHESYS resource.
For the whole of an application, Cach allows you to create an application definition associated with a user-defined application (which itself is defined as a named entity composed of executable code). Application resources then allow you to perform authorization checking for the application. There are three types of applications: Web application definitions These are associated with a specific CSP or Zen application. Privileged Routine application definitions These are associated with one or more routines. Client application definitions These are associated with one or more Cach Direct executables.
Application resources provide a means of controlling access to applications. To use this feature, create a custom resource as described in the next section, Creating or Editing a Resource and use it in association with the application as described in the Creating and Editing an Application: The General Tab section of the Applications chapter. For example, if a Zen application has an associated resource, then users can only run the application if they have Use permission on the resource. If an application uses other resource-regulated entities, such as databases, then users must also have appropriate permissions on those resources in order to operate the application effectively. For more information on applications, consult the Applications chapter.
Once you have added a resource, it appears in the table of resources and is of type Application. You can then use it as part of application-specific authorization. See the section Checking Privileges in the Privileges and Permissions chapter for more information.
For example, if there is a resource named Accounting . An attempt to create another resource named ACCOUNTING will fail. References to the resource using name values of Accounting , accounting , and ACCOUNTING will all succeed.
Important:
3.
4.
2. 3. 4.
Use the finder feature of the Portal to select the page. Note that clicking on the name of the page takes you directly to that page; click inside the box (but not on the name itself) to display the pages action pane. At the very bottom of the pages action pane, click Assign. This displays the Assign Custom Resource dialog. In that dialog, select the empty item from the Custom Resource Name list and click OK.
4
Privileges and Permissions
Permissions allow you to perform some action, such as reading or writing data, or using a tool. Permissions are associated with resources, forming privileges. This model allows a user to perform a particular action in relation to a particular resource.
The meaning of each permission depends on the resource with which it is used. Permission names can appear as the full word or the first letter of the word; their names are not case-sensitive.
returns READ,WRITE if the process holds Read and Write permissions for %DB_Samples. The permission names are always returned as full words in uppercase letters. The function returns an empty string if the process holds no permissions on the resource. The two-argument form returns True or False (1 or 0) to indicate whether the process holds a specific privilege. For example:
$SYSTEM.Security.Check("%DB_Samples", "WRITE")
returns 1 if the process holds the Write permission on the %DB_Samples resource. You can also call the function with a list of permissions, such as:
$SYSTEM.Security.Check("%DB_Samples", "WRITE,READ")
It returns 1 if the process holds all of the requested permissions and 0 otherwise. You can also simply use the first letter of the privileges to be checked:
$SYSTEM.Security.Check("%DB_Samples", "W,R")
The method has the following general behaviors: The method always returns 1 for a public resource privilege, whether or not the process explicitly holds that privilege. Permission names are not case-sensitive. Permission names can be fully spelled out, as in the example above, or abbreviated by their first character. Also, permission names are not case-sensitive. Thus, WRITE,READ, W,R, and R,Write are equivalent.
5
Roles
A role is a named collection of privileges. Roles are useful because multiple users often need the same set of privileges. For example, all users of an application or all developers working on a particular project might need a common set of privileges. By using a role, such sets of privileges can be defined once (which makes future modification much easier) and shared by the relevant users. Privileges are assigned exclusively to roles; privileges are not assigned directly to users. To assign some privileges to a single user, create a role for that purpose. Major topics related to roles include: About roles Roles, users, members, and assignments Creating roles Managing roles Predefined roles Login roles and added roles Programmatically managing roles For SQL access to data in tables, Cach supports row-level security. For information on setting this up, see the section Using Row-level Security in the chapter Objects and SQL in the book Using Cach Objects.
Note:
Roles
These are displayed on the General tab of the Edit Role page, which is accessible by selecting Edit in the row for any role in the table on the Roles page ([System] > [Security Management] > [Roles]). Each role also may have members that are assigned to it or other roles to which it is assigned. These relations are described in the next section.
These phrases are all equivalent in meaning to each other. Each user can be assigned to multiple roles and each role can have multiple users as its members. Similarly, each role can also be assigned to multiple roles and can also have multiple roles as its members. A role can have both users and roles as its members. Suppose one role is assigned to another role. In this case, if role A is assigned to role B, then role A is described as a member of role B; this is equivalent to saying that role A is assigned to role B or that role B includes role A. If one role is assigned to another, that first role holds the privileges associated with the second role. This is analogous to the relationship of assigning a user to role, whereby the user then holds the privileges associated with the role. Hence, if a user is a member of one role and that role is a member of another role, then the user holds privileges associated with both the roles. For example, suppose a university has three roles available for its students: UndergraduateStudent, GraduateStudent, and GeneralStudent. Each student is assigned to either UndergraduateStudent or GraduateStudent, and these two roles are both assigned to GeneralStudent. If Elizabeth is assigned to GraduateStudent, she holds the privileges associated with both GraduateStudent and GeneralStudent; if James is assigned to UndergraduateStudent, he holds the privileges associated with both UndergraduateStudent and GeneralStudent. A roles members are listed on the Edit Role pages Members tab; on this tab, you can also assign new members to a role. If a role has been assigned to other roles, these are listed on the Assigned To tab of the Edit Role page; you can also assign a role to additional roles on that tab.
When Lee is assigned to the role FirstRole, this changes Lees profile:
When the role FirstRole is assigned to the role SecondRole, this also changes Lees profile:
Roles
The list of Lees privileges specifies which privileges originate with which roles:
The roles resources are listed, but empty, as a role cannot receive resources until it has been created, except under the conditions described in the next step. 4. As a shortcut, if you wish to create multiple roles with similar characteristics, you can use the Copy from field on the Role page to begin the process of creating a new role. When you select an existing role from this fields drop-down menu, all its privileges appear in the list of resources; you can then add or delete privileges as desired, and modify its Description property. Click Save to create the role.
5.
Once a role exists, you can edit it as described in the section Managing Roles. For example, the Resources table allows you to add new privileges to the role; do this by clicking Add.
Managing Roles
For example, if there is a role named BasicUser, any attempt to create another resource named BASICUSER will fail. References to the resource using name values of BasicUser, basicuser, and BASICUSER will all succeed.
Creating, modifying, and removing a roles privileges. This includes: Giving a Role New Privileges Modifying Privileges for a Role Removing Privileges from a Role
Creating and removing assignments among roles and users. This includes: Assigning Users or Roles to the Current Role Removing Users or Roles from the Current Role Assigning the Current Role to Another Role Removing the Current Role from Another Role
Roles
Edit the roles properties, which includes all actions for privilege management, assignment management, and SQLrelated options. Delete the role
5.
These changes should be reflected in the Resources table on the Role page.
Managing Roles
4.
The user or role has now been removed from the current role.
Roles
2. 3. 4. 5.
On the Roles page, click Edit for the role you wish to modify. This displays the Edit Role page. On the Edit Role page, select the Assigned To tab. The list of roles that the current role can be assigned to appears in the Available list. You can move them to and from the Selected list using the arrow buttons between the lists. When you have the final list of roles, click Assign or Assign with Grant Option. Clicking Assign simply assigns the current role to the selected roles. Clicking Assign with Grant Option also gives the current role the ability to assign other users or roles to the selected role(s) when using SQL commands.
The current role has now been removed from that role.
The following privileges are available: %ALTER_TABLE For a given namespace, allow the member of the role to run the ALTER TABLE command.
Managing Roles
%ALTER_VIEW For a given namespace, allow the member of the role to run the ALTER VIEW command. %CREATE_FUNCTION For a given namespace, allow the member of the role to run the CREATE FUNCTION command. %CREATE_METHOD For a given namespace, allow the member of the role to run the CREATE METHOD command. %CREATE_PROCEDURE For a given namespace, allow the member of the role to run the CREATE PROCEDURE command. %CREATE_QUERY For a given namespace, allow the member of the role to run the CREATE QUERY command. %CREATE_TABLE For a given namespace, allow the member of the role to run the CREATE TABLE command. %CREATE_TRIGGER For a given namespace, allow the member of the role to run the CREATE TRIGGER command. %CREATE_VIEW For a given namespace, allow the member of the role to run the CREATE VIEW command. %DROP_FUNCTION For a given namespace, allow the member of the role to run the DROP FUNCTION command. %DROP_METHOD For a given namespace, allow the member of the role to run the DROP METHOD command. %DROP_PROCEDURE For a given namespace, allow the member of the role to run the DROP PROCEDURE command. %DROP_QUERY For a given namespace, allow the member of the role to run the DROP QUERY command. %DROP_TABLE For a given namespace, allow the member of the role to run the DROP TABLE command. %DROP_TRIGGER For a given namespace, allow the member of the role to run the DROP TRIGGER command. %DROP_VIEW For a given namespace, allow the member of the role to run the DROP VIEWcommand.
After making your selection(s), click Apply to establish the new privileges for the table.
If a role has privileges for a table, it is listed in a table on this page. To revoke the roles privileges for a table, click Revoke at the far right of the roles row. Clicking this displays a message containing the namespace and the full name of the table (including the schema), such as the SAMPLES Sample.Company namespace and table.
Roles
After making your selection(s), click Apply to establish the new privileges for the table.
If a role has privileges for a view, it is listed in a table on this page. To revoke the roles privileges for a view, click Revoke at the far right of the roles row. Clicking this displays a message containing the namespace and the full name of the view (including the schema).
If a role has privileges for a stored procedure, it is listed in a table on this page. To revoke the roles privileges for a stored procedure, click Revoke at the far right of the roles row. Clicking this displays a message containing the namespace and the full name of the stored procedure (including the schema).
Predefined Roles
The following table has a column for each role. Each row of the table lists a system-defined resource and the privilege, if any, that the role holds on it.
%Developer
%Operator
%SQL
Use
Read
Read Read
Read
Read
Read, Write Read Read, Write Read, Write Read, Write Use
Read, Write Read, Write Read, Write Read, Write Read, Write Use
Use
Use
Roles
The definitions of these predefined roles are set during a new Cach installation and are not modified during an upgrade installation. With the exception of %All, the use of predefined roles is optional. The %Admin_Secure resource is designed to make all the necessary security assets available or restricted as a single unit. This makes it easy to separate these resources for use by the security administrator. Note: The %Operator role does not hold the %Admin_Task:Use privilege by default; if you wish for members of that role to be able to manage tasks, include %Admin_Task:Use among the roles privileges. Further, any custom roles based on %Operator must add the %DB_CACHESYS:RW privilege in order to use the Portals Operator menu. They may also add the %Admin_Task:Use privilege so that they can manage tasks.
5.5.1 %All
The predefined role, %All, always holds all privileges for all resources on the system. This role cannot be deleted or modified, and there must always be at least one user account holding the %All role. If there is only one such account, it cannot be deleted or disabled. This is designed to protect a sole Cach system administrator from being inadvertently locked out of the system. Important: A user who is assigned to the %All role does not automatically have access to rows in a table that are protected with row-level security. The application must explicitly provide the %All role with access to such a row. For detailed information about how to do this, see the section Setting Up Row-level Security in the chapter Objects and SQL in the book Using Cach Objects.
Added Roles
OrderEntryAppNormal OrderEntryAppSpecial, OrderEntryAppReporting
During the matching sequence, each role held by the process is considered, even if a match has already been found. In other words, multiple roles may match and multiple sets of new roles may be added. However, this process is not recursive: roles added as a result of the matching process are not considered for further matches. Note: There is no way to restrict a users roles to fewer than the login roles.
$ROLES contains a comma-separated list of the role names assigned to the current process. The union of all the privileges granted to all roles in the list determines the privileges that the process possesses. $ROLES initially contains the roles assigned at authentication (that is, login roles). This command can only be invoked either from a routine that is part of the CACHESYS database or if the current privileges held include Write permission for the CACHESYS database (%DB_CACHESYS:W). Note that setting $ROLES only alters a processs added roles, not its login roles. Thus if a process currently has the login roles Employee and Manager and the added role Payroll, after the statement
SET $ROLES = "Accounting"
$ROLES has the value Employee,Manager,Payroll,Accounting. A role can be added to the processs current roles by concatenating it to the current roles, with a call such as:
SET $ROLES = $ROLES _ ",Payroll"
The statement
SET $ROLES = ""
removes all added roles. The NEW command can be used with $ROLES to stack the current set of roles (Login and Added) and the current value of $USERNAME. This allows code to modify the list and, whether control leaves the containing block normally or abnormally, the changes are undone upon exit. With the exception of a null string argument, SET $ROLES = <role_name> is a system capability. NEW $ROLES and SET $ROLES = "" can be executed by any code.
6
Users
This chapter includes the following sections: Properties of Users Creating and Editing Users Viewing and Managing Existing Users Predefined User Accounts Validating User Accounts
Confirm Password Change Password on Next Login User Enabled Expiration Date
Users
Property Description The namespace in which to begin execution following login from a terminal-type service. This property overrides any namespace value provided via the command invoking Cach. The routine to execute automatically following login from a terminal-type service. This property overrides any routine value provided via the command invoking Cach. For two-factor authentication, the users mobile phone service provider. For two-factor authentication, the mobile phone number at which the user receives a text message containing the second authentication token (factor). The kind of user, which is determined by the authentication and authorization mechanisms in use. Values can be Cach password user, Delegated user, Kerberos user, LDAP user, or OS user. For more information on user types, see the following section, About User Types.
Startup Tag^Routine
Important:
Copy from (optional) The name of another user, the settings of which are to serve as the basis for the new user.
(optional) The accounts displayable name. (optional) Any text. (required) New password value. (required) Confirmation of new password value. (optional) Whether or not a password change is required at the next login.
Confirm Password
(required) Whether or not the account is available for use. (optional) The last date on which the account is available for use. (optional) The namespace in which to begin execution following login from a terminal-
Expiration Date
Startup Namespace
type service.
Startup Tag^Routine (optional) The routine to execute automatically following login from a terminal-type service.
For two-factor authentication, the users mobile phone service provider. (If the users mobile phone service provide does not appear in the list, you can add a new provide by clicking Create new provider; this displays fields for adding a new mobile phone service provider, which will then be visible.
Mobile phone service provider
For two-factor authentication, the mobile phone number at which the user receives the text message containing the second authentication token (factor).
Mobile phone number
4.
As a shortcut, if you wish to create multiple users with similar characteristics, you can use the Copy from field on the Edit User screen to begin the process of creating a new user. When you select an existing user from this fields dropdown menu, the following properties of the selected user receive values for the user being created: Full Name Expiration Date Default Namespace
Users
5.
Default Tag^Routine
Once you have created a user account, you can then edit its characteristics.
4.
Click the Save button to save the new values for the user.
You can also modify other aspects of the user account on this pages other tabs: Roles Lists the roles that the user currently holds. You can also give a user new roles (or take them away) on this page. SQL Properties This includes:
SQL Privileges Lists all the SQL privileges that a user currently holds, on a per-namespace basis. You can also
INSERT, REFERENCES, SELECT, and UPDATE). You can also assign or revoke SQL table privileges on this page. Lists, by namespace, the views for which a user has been granted privileges (%ALTER, DELETE, INSERT, REFERENCES, SELECT, and UPDATE). You can also assign or revoke SQL view privileges on this page.
SQL Views SQL Procedures Lists, by namespace, the stored procedures which a user can run. You can also assign or revoke
Note:
A change to a user account only takes effect after the user logs out and then logs back in.
To remove a user from all roles, click Remove All below the table listing the currently assigned roles. (This button is only present if a user is assigned to two or more roles.)
The following privileges are available: %ALTER _TABLE For a given namespace, allow the user to run the ALTER TABLE command. %ALTER_VIEW For a given namespace, allow the user to run the ALTER VIEW command. %CREATE_FUNCTION For a given namespace, allow the user to run the CREATE FUNCTION command. %CREATE_METHOD For a given namespace, allow the user to run the CREATE METHOD command. %CREATE_PROCEDURE For a given namespace, allow the user to run the CREATE PROCEDURE command. %CREATE_QUERY For a given namespace, allow the user to run the CREATE QUERY command. %CREATE_TABLE For a given namespace, allow the user to run the CREATE TABLE command. %CREATE_TRIGGER For a given namespace, allow the user to run the CREATE TRIGGER command. %CREATE_VIEW For a given namespace, allow the user to run the CREATE VIEW command.
Users
%DROP_FUNCTION For a given namespace, allow the user to run the DROP FUNCTION command. %DROP_METHOD For a given namespace, allow the user to run the DROP METHOD command. %DROP_PROCEDURE For a given namespace, allow the user to run the DROP PROCEDURE command. %DROP_QUERY For a given namespace, allow the user to run the DROP QUERY command. %DROP_TABLE For a given namespace, allow the user to run the DROP TABLE command. %DROP_TRIGGER For a given namespace, allow the user to run the DROP TRIGGER command. %DROP_VIEW For a given namespace, allow the user to run the DROP VIEW command.
After making your selection(s), click the Apply button to establish the new privileges for the table.
Privileges on Views
On the SQL Views tab of the Edit User page, you can add or remove view-related SQL privileges for a user. To add privileges for the view: 1. 2. 3. Choose the relevant namespace from the drop-down near the top of the page. A list of the namespaces views will appear. To change privileges for a view, select the Edit button in that views row. This displays a window for altering privileges. In this window, you can check or uncheck any of the following items: 4. ALTER SELECT INSERT UPDATE DELETE REFERENCES
After making your selection(s), click the Apply button to establish the new privileges for the table.
To remove a users stored procedure privileges: 1. 2. 3. 4. Choose the relevant namespace from the drop-down near the top of the page. A list of the namespaces stored procedures will appear. To change privileges for a stored procedure, select the Edit button in that tables row. This displays a page for altering privileges. On the page that appears, uncheck the EXECUTE check box and the GRANT privilege check box as appropriate. Click the Apply button to change the privilege(s) for the user.
For each user, you can Edit the users properties Delete the user View the user profile
Users
Alternately, if the Edit User page is visible for a user, click Profile in the upper-left corner of the page. The following properties are listed as part of the user profile.
_PUBLIC _SYSTEM
Set of privileges given to all users (not a login account). Default account to support SQL access.
There is also an account called a privileged user account, which is created during Normal and Locked Down installations and for which you supply a username and password. You can delete these predefined user accounts at any time subject to the requirement that there be at least one user with the %All role.
CAUTION:
If the _SYSTEM account is available with its default password of SYS on deployed systems, this is a security vulnerability. To address this issue, you can disable the account or change its password. InterSystems recommends disabling the account.
Users
The _PUBLIC account has no password by default and should never be given a password, since it is never enabled. In Locked-Down installations, the _SYSTEM account is also disabled.
This routine takes as its single argument, a string that is the name of the user to be validated. It then performs the following actions: 1. The call of New $Roles stacks both the $Roles variable and the $Username variable. For more information on $Roles, see the $Roles reference page.
2.
It then invokes the one-argument form of the $SYSTEM.Security.Login method, which attempts to log the user in and does not require the users password. If the login succeeds, the method returns 1; this determines the information that the routine displays and the routines return value. When the routine exits, this implicitly logs out the user, if there has been a successful login. This routine uses the one-argument form of the $SYSTEM.Security.Login method. To successfully invoke the one-argument form of $SYSTEM.Security.Login, a user must have the CACHESYS:Write and %Service_Login:Use privileges. For more information on $SYSTEM.Security.Login, see the reference page for the %SYSTEM.Security class.
3.
Important:
Here is a sample routine that demonstrates invoking ValidateUser, called VUTest. It is hard-coded to test two users, one called ValidUser and one called NonexistentUser:
VUTest() { Write $Username," is the current user.",!,! Set sc = $$^ValidateUser("ValidUser") Write ! Write "Exited validation code. ",$Username," is the current user.",!,! Set sc = $$^ValidateUser("NonexistentUser") Write ! Write "Testing complete.",! Write $Username," is the current user." Quit 1 }
Suppose the VUTest routine were created in the User namespace of a Cach instance, the PrivilegedUser account were a member of the %All role, and only the ValidUser were to exist. Here are the results of invoking VUTest at a Cach Terminal prompt:
Username: PrivilegedUser Password: *********** USER>d ^VUTest PrivilegedUser is the current user. Validating ValidUser... ValidUser is a valid user. ValidUser belongs to the following login roles: %Manager Exited validation code. PrivilegedUser is the current user. Validating NonexistentUser... NonexistentUser is not a valid user. Testing complete. PrivilegedUser is the current user. USER>
7
Services
There are various pathways for connecting to a Cach instance for users, applications, and even other Cach instances. These pathways are managed by Cach services, which serve as gatekeepers for connecting to Cach. Because Cach services are the primary means by which users and computers connect to Cach, their management is an essential part of security administration. Topics in this chapter are: Available services Service properties Services and authentication Services and their resources
The following lists the available services, what each controls, and what kind of service it is:
%Service_Bindings SQL or Objects; use of Studio [resource-based] %Service_CSP Web application pages (CSP or Zen) [resource-based] %Service_CacheDirect Cache Direct [resource-based] %Service_CallIn The CallIn interface [resource-based] %Service_ComPort COMM ports attached to a Windows system [resource-based]
Services
%Service_Console Cach Terminal from a Windows console (analogous to %Service_Terminal for Mac,
7.1.1.2 %Service_CacheDirect
This service authenticates connections to Cach through the Cach Direct server. The Cach Direct server is available on any supported platform; clients for this service can only be on Windows.
%Service_CacheDirect manages access for two types of client-side applications:
Client applications that use the Cach Direct client software. These have all authentication mechanisms available. Client applications that use the legacy CacheObject.dll library. These have no security features available; for these legacy applications, the %Service_CacheDirect service must enable the Unauthenticated mechanism only.
Since legacy applications can only support unauthenticated access and both types of client applications use the same service, Kerberos authentication is not available for Cach Direct clients if Cach is configured to accept connections from a legacy application; similarly, if a Cach instance is configured to accept Kerberos-authenticated connections from Cach Direct clients, legacy clients cannot connect to it. Note:
CacheObject.dll is supported for legacy applications only. New development should use either the Cach Direct client or the CacheActiveX.dll and the %Service_Bindings service.
Available Services
CAUTION:
Terminal or console access is one of the most sensitive aspects of Cach security. If an attacker gains access to Cach in one of these ways, it can be possible to read or destroy sensitive data.
7.1.1.4 %Service_CSP
This service manages connections that serve up CSP pages. Specifically, it manages connections between the CSP Gateway and the Cach server. If there is no unauthenticated access for the service and the CSP Gateway has no valid authentication information, then there is no access to the server via CSP. Hence, if you disable unauthenticated access through this service, then you must ensure that the CSP Gateway has the information it needs to authenticate to the Cach server. For Cach login (password) access, this is a valid username-password pair; for Kerberos access, this is a valid service principal name and key table location. To specify these values use the CSP Gateway Web Management interface; for a standard installation, the URL for this is http://localhost:57772/csp/bin/systems/module.cxw, where localhost represents 127.0.0.1 for IPv4 and ::1 for IPv6. Because %Service_CSP regulates the use of the Portal and its subapplications, disabling %Service_CSP does not disable any system applications (/csp/broker, /csp/docbook, /csp/documatic, /csp/sys, /csp/sys/exp, /csp/sys/mgr, /csp/sys/op, /csp/sys/sec, /isc/studio/rules, and /isc/studio/templates). For more information on system applications, see the section System Applications in the Applications chapter. Important: If you inadvertently lock yourself out of the Portal, you can use emergency access emergency access mode to reach the Portal and correct the problem; this is described in the section Emergency Access in the chapter System Management and Security.
7.1.1.5 %Service_DataCheck
This service regulates the use of the DataCheck utility, which provides a mechanism to compare the state of data on two systems. For more details, see the Data Consistency on Multiple Systems chapter of the Cach Data Integrity Guide, and, for security issues, particularly the section Enabling the DataCheck Service.
7.1.1.6 %Service_ECP
A resource does not govern the use of ECP. Rather, you either enable or disable the service (this makes ECP what is called a basic service ). This means that all the instances in an ECP configuration need to be within the secured Cach perimeter. See the Specifying ECP Privileges and Roles section of the Configuring Distributed Systems chapter of the Cach Distributed Data Management Guide for details on how privileges work within an ECP configuration.
7.1.1.7 %Service_Login
This service controls the ability to explicitly invoke the Login method of the %SYSTEM.Security class. Calls to this method are of the form:
Set Success = $SYSTEM.Security.Login(username, password)
where username is the user being logged in and password is that users password.
Services
7.1.1.8 %Service_Mirror
This service regulates the use of the Cach database mirroring, which provides automatic failover between two systems. For more details about mirroring generally, see the Mirroring chapter of the Cach High Availability Guide; for more details about security for mirroring (though the use of SSL/TLS), see the Configuring Cach to Use SSL/TLS with Mirroring section in the Configuring Cach to Use SSL/TLS with Mirroring chapter.
7.1.1.9 %Service_Shadow
This service regulates the use of a Cach instance as a shadow source. For more details, see Configuring the Source Database Server in the Shadow Journaling chapter of the Cach Data Integrity Guide.
7.1.1.10 %Service_Telnet
This service is only valid on a Windows Cach server and only accepts connections from a Windows client.
Controls whether a service is on or off. When enabled, a service allows connections to Cach, subject to user authentication and authorization; when disabled, a service does not permit any connections to Cach.
Service Enabled
At system start up, each service has the same state (enabled or disabled) that it had when Cach was shut down. Note that enabling or disabling a service is not simply a security setting. It determines whether or not a certain capability is provided by Cach and may, for instance, determine whether certain daemon processes are started or memory structures are allocated.
Two-Factor Authentication Enabled Controls whether a service supports two-factor authentication. (This check box
only appears when an instance has enabled two-factor authentication on its Authentication Options page [System] > [Security Management] > [Authentication Options].) With two-factor authentication, a Cach users mobile phone serves as a second authentication factor ; Cach sends a eight-digit security token to the phone, which the user must then enter at a prompt as part of the authentication process. For more details, see the section Configuring Two-factor Authentication in the Authentication chapter. Note: If two-factor authentication is enabled for an instance, this check box appears on the Edit Service page for all its services. However, two-factor authentication is only available for %Service_Bindings, %Service_Console, and %Service_Terminal (and only when it is enabled for the instance).
Specifies the available authentication mechanisms for connecting to the service; if multiple mechanisms are selected, the user or client can attempt to connect using any of these. The mechanisms available depend on what is selected on the Authentication Options page ([System] > [Security Management] > [Authentication Options]). If a service supports multiple authentication mechanisms, these are used according to the Cach rules of cascading authentication.
Allowed Authentication Methods
Specifies a list of IP addresses or machine names from which the service accepts connections; if a service has no associated addresses or machine names, then it accepts connections from any machine. This capability can be very useful with multi-tier configurations; for example, with the CSP service, it can be used to limit the set of Web servers that can connect to Cach. The Allowed Incoming Connections facility for ECP has additional features described in the Restricting ECP Application Server Access section of the Cach Distributed Data Management Guide.
Allowed Incoming Connections
For a resource-based service, the service can be specified as public. Public services are available to all authenticated users, while non-public services are available only to those users with Use permission on the services resource. This value is displayed on the main Services page ([System] > [Security Management] > [Services]) and is set on the Edit Resource page for the services resource. Possible values are: N/A The service has no associated resource; this means that service can simply be turned on or off. NO Access is available to any user holding a role that has the Use permission on the services resource. This is checked after authentication. YES Access is available to any user. A change to a service only takes effect after the service is restarted.
Note:
KRB Cache N N N N N Y N N Y
KRB Login Y Y Y N N Y N Y Y
Del Y Y Y Y Y Y Y Y Y
LDAP Y Y Y Y Y Y Y Y Y
OS N N N Y N Y Y N Y
Cach Y Y Y N Y Y Y Y Y
Un Y Y Y Y Y Y Y Y Y
Services
Key: KRB Cache Kerberos Cache KRB Login Kerberos Login Del Delegated authentication LDAP LDAP authentication OS Operating-Systembased authentication Cach Cach Login Un Unauthenticated access
For each resource-based service, if there are multiple enabled authentication mechanisms, then Cach attempts to authenticate users going from the strongest enabled form of authentication to allowing unauthenticated access (if that is enabled). This is process is described in the section Cascading Authentication in the Authentication chapter.
8
Applications
Almost all users interact with Cach using applications. Because of this, application security can provide a key set of tools for regulating user actions. Application security uses Cach authorization tools to ensure that only the appropriate users can use an application. An application also has features that allow it to escalate its users privileges. This chapter covers the following topics: Applications, their properties, and their privileges Application types Creating and editing applications System applications
All these characteristics and capabilities are part of the Cach authorization tools. If an application is formally defined with Cach, then it can use this functionality. There are three kinds of applications web applications, privileged routine applications, and client applications. This section covers: Applications and Their Properties Associating Applications with Resources Applications and Privilege Escalation Checking for Privileges Programmatically
Applications
Each application, through its application definition, has the following properties: Name The name of the application. This must start with an alphabetic character and must be followed by alphabetic, numeric, or underscore characters. The application definitions name is independent of the name of any resource. Description A description of the application. Enabled A switch that specifies if the application is available for use. If the application is not enabled, no one can run the application not even a member of the %All role. For more details on how this property governs each kind of application, see the appropriate section: web applications, privileged routine applications, or client applications. Resource A resource that manages application behavior. The resource has different effects for different application types: for web applications and client applications, it controls whether or not users have access to the application; for privileged routine applications, it controls the applications privilege escalation. If a web or client application has no resource, then any user can run the application; if a privileged routine application has no resource, then the application escalates privileges for any user. Each application definition can only be associated with a single resource. For more details on how this property affects each kind of application, see the appropriate section: web applications, privileged routine applications, or client applications. For more information on how applications interact with resources, see Associating Applications with Resources. Application Roles One or more roles to which application users are assigned. While running the application, the user is assigned to its application roles by appending these roles to the list of roles in the $Roles variable. For more information on using application roles, see the section Applications and Privilege Escalation . Matching Roles One or more roles that cause the user be assigned to some additional roles (called target roles ) while running the application. If users are assigned to a matching role, then, while using the application, they are also assigned to any target roles. This is done by appending these roles to the list of roles in the $Roles variable. For example,
if %Admin_Manage is a matching role, then being a member of that role might cause the application user to also become a member of the target role of %Admin_Secure. For more information on using matching roles, see the section Applications and Privilege Escalation . All applications have these properties. There are three application types and each has its own other, unique characteristics.
Applications
If the user is assigned to any matching role, the application assigns the user to any target roles for the duration of application use. (Again, for privileged routine applications, this depends on successfully invoking the AddRoles method, as described in the section Privileged Routine Applications.)
For example, suppose that an application has its own resource, called AppRsrc. Two roles hold the AppRsrc:Use privilege; these are AppUser and AppOperator. AppOperator is also a matching role, where the target role is %Manager. In this scenario, when a user belonging to the AppUser role invokes the application, the value of $Roles does not change; when a user belonging to AppOperator invokes the application, the value of $Roles expands to include %Manager. If the application has an application role of AppExtra, then a user belonging to the AppUser role receives the AppExtra role when invoking the application. In the first scenario (matching role only), belonging to the AppOperator role causes privilege escalation; in the second scenario (matching role and application role), belonging to either role results in privilege escalation.
Hence, you have control of whether application use is limited to specific users or open to any users; simultaneously, you also have control of whether an application runs with the users privileges or with its own privileges. This enables Cach to provide a very flexible model:
Each of the scenarios described in the previous table is commonly used for a different authorization model:
where app_resource is the resource for which the user must hold a permission app_permission is the permission that must be held. status is the methods return value of TRUE or FALSE (1 or 0).
For example, if an application required that a user have Write permission on the Application_Order_Customer resource, then the check call would be
Set status = $SYSTEM.Security.Check("Application_Order_Customer", "WRITE")
Note:
Applications
CSP security processing occurs as follows: 1. 2. 3. 4. As each page request is received, its application is determined from the URL. If the application is not enabled, there is no connection. If the application is the same as the application for the last page processed for the CSP session, then there is already a connection, so no further security checking is required. If the Use permission for %Service_CSP is not public and the user does not hold this permission, there is no connection. If the application or the CSP service require authentication and the user has not already been authenticated, then Cach checks if the request includes CacheUserName and CachePassword parameters: a. b. If CacheUserName and CachePassword are present, the CSP server attempts to log in; if the login succeeds, it checks if the user has the Use permission for the application resource. If either of these fail, there is no connection. If CacheUserName and CachePassword are not present, CSP displays an application-specific login page, if one is defined in the web application configuration. (This is the only page in a secure application that can be used prior to login.) If there is no application-specific login page, the username and password fail authentication, or the user does not have the Use permission on the application resource, there is no connection.
To edit a web application, the Portal provides the following pages: Creating and editing an application: the General tab Editing an application: the Application Roles tab
Application Types
where AppDefName is the name of the application definition and sc is a status code. If a routine is part of an application definition and the user is appropriately privileged, then calling AddRoles from that routine escalates privileges to include any application roles (as described in Editing an Application: The Application Roles Tab) and any relevant matching roles (as described in Editing an Application: The Matching Roles Tab). Important: If a routine does not curly braces to delimit code in its entry points, then control can pass from one entry point to another, possibly resulting in overprivileged users and unintended levels of access. For more information on structuring routines, see the User-defined Code chapter of Using Cach ObjectScript,
Processing occurs as follows: 1. 2. 3. If the call is not from a privileged routine, it fails. If the privilege specified in the application definition is not public and the user invoking the routine does not hold this privilege, then the call fails. Otherwise, the call succeeds.
Once a user has additional roles from a call to AddRoles, the user retains these roles unless there is an action that removes them. To explicitly remove any added roles, issue the following command:
Set $Roles = ""
You can also cause the user to give up any application roles and to revert to login roles when control passes out of scope for the routine that escalated privileges. To do this, include the following command prior to the call to AddRoles:
New $Roles
To edit a privileged routine application, the Portal provides the following pages: Creating and editing an application: the General tab Editing an application: the Application Roles tab Editing an application: the Matching Roles tab Editing an application: the Routines tab
Applications
The PRATestRtn routine. A resource associated called PRATestRsrc. It is best for this resource to have no public permissions. A role called PRATestRole, whose sole privilege is PRATestRsrc:Use. A role called PRATestAddedRole. A privileged routine application called PRATestApp, where: The PRATestRsrc is required to run the application (that is, users must have the PRATestRsrc:Use privilege, which they can get through the PRATestRole). The PRATestRtn routine is included as part of the application (on the Routines tab of the Edit Routine Application page). The PRATestAddedRole is an application role.
Two users: PRATestUser and NonPRATestUser. PRATestUser is a member of the PRATestRole and %Developer. NonPRATestUser is a member of %Developer only.
Cach enables executables built using Cach Direct to be identified to the system. When such an executable attempts to connect to the server, Cach performs the following processing: 1. 2. 3. 4. 5. If the %Service_CacheDirect is not enabled, there is no connection. If %Service_CacheDirect is enabled, the attempt to connect proceeds. If the Use permission for the %Service_CacheDirect service is not public and the user does not hold the permission on the service, then the connection is rejected. If the Use permission for a resource specified in the application definition is not public and the user does not hold the permission on the application, then the connection is rejected. If the process has Read or Write permission on the namespace to which the connection is being made, the connection is accepted; otherwise, the connection is rejected. Once the connection is accepted, application roles are added. Similarly, if the user is a member of any matching roles, then the appropriate target roles are added.
To edit a client application, the Portal provides the following pages: Creating and editing an application: the General tab Editing an application: the Application Roles tab Editing an application: the Matching Roles tab
Applications
2.
To perform general editing on a privileged routine application or a client application, the procedure is: 1. In the Management Portal menu, select System Administration >> Security >> Applications, which makes available choices of various application types. Choose Web Applications, Privileged Routine Applications, or Client Applications. This displays the page for the selected application type. On the applications page, there is a list of applications that can be edited. Click Edit in the row of the relevant application. This displays an editing page for the application. The General tab is initially displayed for this page. For privileged routine applications and client applications, the pages fields are:
Privileged routine application name Description Enabled
2. 3.
Whether or not the application is available. When enabled, an application is available, subject to user authentication and authorization; when disabled, it is not available.
Resource required to run the application A resource for which users must have the Use permission (enabled as
part of a privilege in a role) in order to perform certain actions. For web and client applications, this resource is required in order to simply operate the application; for privileged routine applications, this resource is required to invoke the AddRoles method, which gives the application its ability to escalate roles.
1.
In the Management Portal menu, select System Administration >> Security >> Applications, which makes available choices of various application types. Choose Web Applications, Privileged Routine Applications, or Client Applications. This displays the page for the selected application type. On the applications page, there is a list of applications that can be edited. Click Edit in the row for the relevant application. This displays an editing page for the application. On the application editing page, go to the Application Roles tab. To specify one or more application roles, click on the roles listed in the Available list. Move them into the Selected list with the arrows. Click Assign to establish the application role(s).
2. 3. 4. 5.
2. 3. 4. 5. 6.
Applications
Associated Resource
For more information on the /isc/studio/rules, application, see the chapter Developing Custom Tags in Using Cach Server Pages (CSP). For more information on the /isc/studio/templates application, see the chapter Using Studio Templates in Using Cach Studio.
9
Auditing
Logging certain key events in a secure audit database is a major aspect of Cach security. Cach allows you to monitor events and add entries to the audit database when those events occur. These events can be within Cach itself or part of an application. The knowledge that all activities are being monitored and that all logs can be reviewed is often an effective deterrent. This chapter provides information on various topics: Basic Auditing Concepts About Audit Events Managing Auditing and the Audit Database Other Auditing Issues
Cach system events are built-in events that monitor actions within Cach, such as start-up, shutdown, logins, and so on; system events also monitor security-related events, such as changes to security or audit settings. Cach does not automatically audit database activity, such as inserts, updates, or deletes for a table, because this kind of activity typically generates so many audit entries as to be useless or even counterproductive due to the performance impact on the system. For example, if a medical records application were to log all access to patient medical information, then one such access event might result in hundreds or thousands of database accesses. It is much more efficient to have the application create a single audit entry, rather than have the database manager generate thousands.
Auditing
Enabling Auditing
To turn on auditing, on the Auditing page ([System] > [Security Management] > [Auditing]), select the Enable Auditing choice.
Disabling Auditing
To turn off auditing, on the Auditing page ([System] > [Security Management] > [Auditing]), select the Disable Auditing choice. If you enable (turn on) auditing, then Cach audits: All system events that are enabled All user events that are enabled
Note:
Event* (also called Event Name) Identifier of the event being logged. This string can include any alphanumeric characters or punctuation, except for colons and commas; it can begin with any of these characters except for the percent sign. This can be up to 64 bytes. PID (also known as a Process ID) Operating system ID of the Cach process that logged the event. On Windows and UNIX, Cach uses the OS PID in its native form; on OpenVMS, Cach uses the PID in decimal form, converting it from the operating systems hexadecimal form. CSP Session (search results only) The session ID, if there is one, of the CSP session that caused the event. User (also called Username) Value of $USERNAME for the process that logged the event. Description A short field which can be used by applications to summarize the audit event. This field is intended for display/explanation purposes only. The combination of EventSource, EventType, and Event uniquely define a particular kind of audit event. The Description is a user readable explanation. This can be up to 128 characters. *Each different kind of event is uniquely identified by the combination of its EventSource, its EventType, and the Event itself. When you click Details, you see some of the same elements and the following additional elements: Timestamp Date/time when the event was logged, in local time. JobId ID of the job. IP Address IP address of client associated with the process that logged the event. Executable The client application associated with the process that logged the event, if there is one. System ID The machine and Cach instance that logged the event. For example, for the machine MyMachine and the instance MyInstance, the system ID is MyMachine:MyInstance. Index The index entry in the data structure containing the audit log. Roles For all events except LoginFailure, the value of $ROLES for the process that logged the event. For LoginFailure, a value of , as the user is not logged in.
Auditing
Namespace The namespace that was current when the event was logged. Routine The routine or subroutine that was running when the event was logged. User Info User-defined information about the process, added programmatically via the %SYS.ProcessQuery interface. O/S Username Username given to the process by the operating system. When displayed, this is truncated to 16 characters. This is the actual operating system username only for UNIX or VMS systems. For Windows: Status The value of any %Status object that was audited. Event Data A memo field where applications can store up to 16 KB of data associated with the audit event. For example, it can contain a set of application values at the time of the event or can summarize the old and new states of a record or field. For a console process, this is the operating system username. For Telnet, this is the $USERNAME of the process. For client connections, this is the operating system username of the client.
They monitor events within the Cach system and are distinguishable by their EventSource value of %SYSTEM:
Off
On
On
On
Off
Action (new, modify, or delete), old and new resource data. Action (create new, modify, or delete), old and new role data. The changed fields with old and new values. Old and new service security settings.
On
On
On
On
Auditing
Event Type and Event %Security/ SystemChange %Security/ UserChange %System/ AuditRecordLost
Occurs When System security settings have been changed A user definition is created, changed, or deleted An audit entry has not been added to the audit database due to resource limitations that constrain the audit system (such as disk or database full) Cach successfully starts with a configuration different than the previous start, or a new configuration is activated while Cach is running Journaling is turned on or off for a database or process A method or routine has been compiled or deleted Cach starts
Default Status On
Action (create new, modify, or delete), old and new user data. None.
On
On
%System/ ConfigurationChange
User name for the user who made the change; previous and new values of the changed element.
On
%System/ JournalChange %System/ RoutineChange %System/ Start %System/ Stop %System/ UserEventOverflow
For database journaling, the name of the database. No content, though the Description depends on the change itself; see notes. Indication of whether recovery was performed.
On
Off
On
On
On
*The LoginFailure event is off by default for minimal-security installations; it is on by default for normal and locked-down installations. If auditing is enabled, then all enabled events are audited.
A process generates a %System/%Login/Terminate event if the process exits for any other reason, including:
The user closes the Terminal window, resulting in a Terminal disconnect. If the process is in application mode, the Description field of the audit record includes the statement ^routinename client disconnect (where routinename is the first routine that the process ran); if the process is in programmer mode, the Description field includes the statement Programmer mode disconnect. A Terminal session is ended by an action in another process, including ^RESJOB, ^JOBEXAM, or the Management Portal. If the process is in application mode, the Description field of the audit record includes the statement ^routinename client disconnect (where routinename is the first routine that the process ran) ; if the process is in programmer mode, the Description field includes the statement Programmer mode disconnect. Note that the event data will contain the pid of the process which terminated them. A core dump or process exception. When a process gets a core dump or exception, it is too late for it to write to the audit file. Therefore, when the clean daemon runs to clean up the state of the process, it writes an audit record to the log with a description Pid <process nunber> Cleaned. A TCP Client disconnect. When a process detects that a client has disconnected, this results in an audit record with a Description field which contains the name of the executable that disconnected, such as <client application> client disconnect .
Auditing
6. 7.
Make sure that auditing is enabled. Once the event is defined and auditing is enabled, you can add the event to the audit log by executing the following command:
Do $SYSTEM.Security.Audit(EventSource,EventType,Event,EventData,Description)
using the EventSource, EventType and Event Name values that you defined in the Portal. For more details, see the section Adding an Entry to the Audit Log.
where EventSource, EventType, Event, EventData, and Description are as described in the section Elements of an Audit Log Entry. Both the EventData and Description arguments can hold variables or literal values (where strings must appear in quotation marks). Cach provides all other elements of the log item automatically. The content of EventData can span multiple lines. Its content is processed in a manner similar to the argument of the Cach ObjectScript Write command, so it uses the following form:
"Line 1"_$Char(13,10)_"Line 2"
In this case, the content listed in the Audit Detail is displayed as Line 1, then $Char(13,10) is a carriage return and line feed, then there is Line 2 . For example, a medical records application from XYZ Software Company might use values such as:
$SYSTEM.Security.Audit( "XYZ Software", "Medical Record", "Patient Record Access", 765432, "Access to medical record for patient 765432" )
Note that the application uses the EventData element to record the ID of the patient whose record was accessed. Further, if there is an XYZ Software/Record Update/Modify Assignment event defined and enabled, then the following code changes the value of a user-selected element of a list and notes the change in the audit database:
For i=1:1:10 { Kill fVal(i) Set fVal(i) = i * i } Read "Which field to change? ",fNum,! Read "What is the new value? ",newVal,! Set oldVal = fVal(fNum) Set fVal(fNum) = newVal Set Data = "Changed field " _ fNum _ " from " _ oldVal _ " to "_ newVal _ "." Set Description = "Record changed by user with an application manager role" Do $SYSTEM.Security.Audit( "XYZ Software", "Record Update", "Modify Assignment", Data, Description ) Write "Field changed; change noted in audit database."
Audit returns 1 or 0 to indicate that the addition succeeded or failed. No privilege is required to add an entry to the audit log.
Auditing
End Date & Time The date and time for the last (most recent) event to be displayed (the current time, by default) Sort by Orders the results by: Reverse Date From most recent to least recent Events By event name, in alphabetical order Users By user name, in alphabetical order PID By operating-system process ID, from lowest to highest
Maximum Rows The maximum number of rows to display in a listing of the audit log (up to 10,000). Color by The field (if any) that determines how the search results are colored. Fields that can determine search result coloring are Description, Event, Event Source, Event Type, PID, Time Stamp, and Username. Users The user who has caused the event. The asterisk ( *) chooses events causes by all users; no other wildcards are supported.
Note:
older than this is copied to the new namespace. 3. 4. 5. Next, use the drop-down menu to choose the namespace where you wish to copy the audit entries. If you wish to delete the audit items after they are copied, select the check box with that choice. Click OK to copy the entries.
Cach places the selected audit log entries in the ^CacheAuditD global in the selected namespace. To view this data: 1. From the Management Portal home page, go to the Globals page ([System] > [Globals]).
2.
From the Globals page, select the following items in the following order: a. b. c. The Databases radio button from the upper left area of the page. The name of the database holding the copied audit log entries. The System check box that appears above the list of globals.
This displays a list of globals in the database, including ^CacheAuditD. Globals are listed without the preceding ^ character that is needed to manipulate them programmatically or in the Cach Terminal. Note: Clicking View Globals on this page refreshes the page but unchecks in the System check box, thereby making ^CacheAuditD unavailable.
3.
Click Data from the CacheAuditD line to display detailed information on the audit log entries.
Once you have copied audit data to another namespace, you can use the queries of the %SYS.Audit class to look at that data.
older than this is exported to the new namespace. 3. Next, in the Export to file field, enter the path of the file where you wish to export the audit entries. If you do not enter a full path, the root for the path provided is cachesys/Mgr/ where cachesysis the default name of the installation directory. If you wish to delete the audit items after they are exported, select the check box with that choice. Click OK to export the entries.
4. 5.
To do this: 1. 2. From the Management Portal home page, go to the Purge Audit Log page ([System] > [Security Management] > [Purge Audit Log]). On the Purge Audit Log page, first select either:
Purge all items from the audit log Purge items that are older than this many days from audit log
Auditing
3.
Note:
The %SYS.Audit table in the %SYS namespace holds the audit log. All audit data is mapped to the CACHEAUDIT database. (You can also copy audit data to any other database using the functionality described in the section Copying the Audit Database ; you can then use the %SYS.Audit class, which is available in every namespace, to query the audit log.)
CAUTION:
If the audit database becomes full, Cach does not record audit entries for actions that cause audit events. Further, in a forensic context, the existence of only a single AuditRecordLost audit entry indicates that at least one record was lost.
To set this switch, use the ^SECURITY routine: 1. In the Cach Terminal, go to the %SYS namespace:
2.
Start ^SECURITY:
> Do ^SECURITY
3. 4.
Within ^SECURITY, choose option 6 (Auditing Setup); within Auditing Setup, choose option 1 (Enable auditing). When it displays the prompt: Freeze system on audit database error? Enter Yes or Y. Confirm any changes when prompted.
This establishes the behavior of freezing the system. For a disk full error, the way to recover from this is to force down the system, free up space on the audit disk, then restart. For an error caused by database corruption, the audit database must be moved or deleted, and a new one created or copied into its place. Note that a restart of the system will not be enough to clear the error, since the restart may write audit records, and cause the system to freeze again. For example, with the default behavior, if the disk containing the audit database fills up, then the attempt to write to the audit log will generate a <FILEFULL> error (disk full). The audit record is not written to the audit log, and is therefore lost. When the problem is resolved, an entry is written into the audit log that lists how many audit events were lost. When this switch is set, and a write error occurs when writing to the audit log, the process which was trying to write to the audit log receives an error (such as <FILEFULL>). The process then writes the error message to the cconsole.log, and then freezes the system.
10
Managed Key Encryption
Cach includes support for managed key encryption, a suite of technologies that protects data at rest. These technologies are: Block-level database encryption, also known simply as database encryption A set of tools to allow creation and management of databases in which all the data is encrypted. Such databases are managed through the Management Portal. Data element encryption for applications, also known simply as data element encryption A programmatic interface so that applications can include code to encrypt and decrypt individual data elements (such as particular class properties) as they are stored to and retrieved from disk. Encryption key management A set of tools in the Management Portal for creating and managing data-encryption keys and for managing key files. Both database encryption and data element encryption use key files to support their functionality.
Each Cach instance can simultaneously have one data-encryption key activated for database encryption and up to four data-encryption keys activated for data element encryption (activating a key makes it available for encryption and decryption operations); the database-encryption key can be the same key as one of the data-element encryption keys. When you create a data-encryption key, it is in a key file and must be decrypted to be used. Once you create a key, it is imperative that you store the key file in a secure location where it cannot be damaged in any way. When activated, information related to the key (but not the key itself) is in shared memory that is accessible only from the kernel; it is never available unencrypted. When stored on disk, they are in key files, which contain multiple encrypted copies of the data-encryption key. Cach uses AES (the Advanced Encryption Standard) to perform its encryption and decryption when Cach writes to or reads from disk. For databases, Cach writes and reads in 8192-byte blocks, and the information encypted includes the data itself, indices, bitmaps, pointers, allocation maps, and incremental backup maps. For data elements, only the specified data is encrypted, and a unique identifier for the encryption key is included with the encrypted data on disk. Encryption and decryption have been optimized, and their effects are both deterministic and small for any Cach platform; the section Performance Information includes the formula for determining how encryption affects performance. (This chapter also includes a section that addresses how the Cach database encryption facilities affect functionality related to but separate from databases themselves.)
WARNING!
The loss of or damage to all copies of a key file will prevent encrypted data whether data elements or databases from being decrypted.
Topics in this chapter include: Managing Keys and Key Files Using Encrypted Databases
Managing Key Files Adding an Administrator to a Key File Deleting an Administrator from a Key File Testing for a Valid Administrator Username-Password Pair Managing Keys and Key Files with Multinode Technologies
Recommended Policies for Managing Keys and Key Files Protection from Accidental Loss of Access to Encrypted Data Protection from Unauthorized Access to Encrypted Data
Along with key management, there are tasks associated with key file management taking care of the files that hold encryption keys. For more information on key file management, see the Managing Key Files section.
If you enter an absolute file name, the key file is placed in the specified directory on the specified drive; if you enter a relative file name, the key file is placed in the managers directory for the Cach instance (which is below the Cach installation directory that is, in <cache-install-dir>/mgr/). Also, no file suffix is appended to the file name, so that the file MyKey is saved simply with that file name. You can also use the Browse button to the right of this field to choose a directory and file name for the key file.
WARNING!
Any key stored in <cache-install-dir>/Mgr/Temp is deleted when Cach next reboots never store a key in <cache-install-dir>/Mgr/Temp. The name of an administrator who can activate the key. There must be at least one
Administrator Name
administrator. Because the database encryption functionality exists independent of Cach security, this name need not match any user names that are part of Cach security. By default, the initial administrator name value is the current username.
Password A password for this user. Because the database encryption functionality exists independent of Cach
security, this password need not match the password that a user has for Cach security. Note that this password is not stored anywhere on disk; it is the responsibility of the administrator to ensure that this information is not lost. InterSystems suggests that this password follow the administrator password strength guidelines. If someone can successfully guess a valid password, the password policy is too weak.
Confirm Password
The password for this user entered again to confirm its value. The length of the key, where choices are 128bit, 192bit, and 256bit.
Click Save to save the key file to disk. This creates a key file where each copy of the database-encryption key is encrypted using an administrators key-encryption key (KEK). It also displays the ID for the key, which is a string such as 9158980E-AE52-4E12-82FD-AA5A2909D029. The key ID is a unique identifier for the key which Cach displays here and on other pages. It provides a means for you to keep track of the key, regardless of its location. This is important because, once you save the key file, you can move it anywhere you choose; this means that Cach cannot track it by its location. 3. 4. Follow the instructions in the section Protection from Accidental Loss of Access to Encrypted Data to create and store a backup copy of the key file. Refer to the section Protection from Unauthorized Access to Encrypted Data for details about measures to prevent currently or formerly privileged users from gaining unsanctioned access to encrypted data. Each time you create a database-encryption key, it is a unique key that cannot be re-created. Using the same administrator and password for a new key still results in the creation of a different and unique key. If an unactivated key is lost and cannot be recovered, the encrypted database that it protected will be unreadable and its data will be permanently lost.
WARNING!
The name of an administrator for this key, specified either when the key was created or
edited.
Password
Then click the Activate button. The page indicates success by displaying a confirmation message, such as Activated database encryption key identifier: 5ECC05FE-3167-43EB-9798-B50E2C7E34E6. Because there is now an activated database encryption key, the page displays other options:
Deactivate Key Click to deactivate the currently activated database encryption key. For more details, see the section
Deactivating a Database Encryption Key Click to specify startup behavior related to database encryption. For more details, see the section Configuring Cach Database Encryption Startup Settings.
Configure Startup Settings
The CACHETEMP and CACHE databases are encrypted. The instance is encrypting journal files.
To deactivate the key, each condition requires a different action: For any encrypted database except CACHETEMP and CACHE, dismount the database on the Local Databases page ([System] > [Configuration] > [Local Databases]). You can then deactivate the key. For CACHETEMP and CACHE, specify that the CACHETEMP database is not to be encrypted and then restart Cach; the setting for CACHETEMP determines the behavior of the CACHE database as well. To do this, select Configure Startup Settings on the Database Encryption page; you can either choose to not activate a database encryption key at startup (in which case the option to encrypt CACHETEMP is not available) or you can choose interactive or unattended database encryption key activation at startup (in which cases the choice whether or not to encrypt CACHETEMP becomes available choose No). For encrypted journal files, ensure that no encrypted journal file is required for recovery. This is described in the section Encrypted Journal Files and Configuring Startup without Key Activation.
2. 3.
The name of an administrator for this key, specified either when the key was created or
edited.
Password
Then click the Activate button. The page then displays its table of activated keys, with the newly activated key added to it and its GUID listed in the Identifier column.
Note:
The table of keys does not display any file or path information. This is because, once the key file is activated, any sufficiently privileged operating system user can move the key; hence, Cach may not have accurate information about the operating system location and can only rely on the accuracy of the GUID for the activated key in memory. If you going to activate a second or subsequent key, make sure that you note the identifiers for the currently activated key(s) first, so that you can identify the new one.
When the [Data Element Encryption] page appears again, the row in the table for the deactivated key should no longer be present.
Along with key file management, there are tasks associated with key file taking care of encryption keys themselves. For more information on key management, see the Managing Keys chapter.
3.
The name of an administrator already in the file. The password associated with the already existing administrator in the file.
The name of the new administrator to be added to the file. Because the encryption functionality is independent of Cach security, the administrator name need not match any user names that are part of Cach security.
New Administrator Password The password for the new administrator. InterSystems suggests that this password
follow the administrator password strength guidelines. Because the encryption functionality is independent of Cach security, the password need not match the password that a user has for Cach security.
Confirm New Administrator Password
Complete these fields and click OK. You have now added a new administrator to the key file. Once you have added the new administrator to the key file, you may wish to copy the key file, making sure that each copy is in a secure location. Further, InterSystems strongly recommends that you create multiple administrators for each key, one of which has the name and password written down and stored in a secure location, such as in a fireproof safe. However, if copies of the key file are made and later on, as an administrative function, a new administrator is added, only the copy of the key file with the new administrator will be up to date. Note: When you add a new administrator to a key file, that administrators password is permanently associated with the entry for the administrator name created in the file. Once assigned, passwords cannot be changed. If you wish to assign a new password, delete the entry in the key file for that administrator name and then create a new entry with the same name and a new password.
4.
5.
At this prompt, answer No. For more information on cvencrypt, see the chapter Using the cvencrypt Utility. Do not perform this process programmatically, since it requires storing the password on disk, which is not recommended. (Unattended key activation at startup is a highly restricted special exception to storing a password on disk, as described in the section Configuring Startup with Unattended Key Activation.)
CAUTION:
Failure to take these precautions can result in a situation where the encrypted database will be unreadable and permanently lost.
3.
Configure each instance of Cach for unattended startup and provide Cach with the path to the key file. For more information on this procedure, see the section Configuring Startup with Unattended Key Activation.
Since all the Cach instances use the same key, they are able to read data encrypted by each other. Any changes to the key file are visible to all instances. Important: Refer to the section Protection from Unauthorized Access to Encrypted Data for details about measures to prevent currently or formerly privileged users from gaining unsanctioned access to encrypted data.
CAUTION:
Failure to take these precautions can result in a situation where the encrypted database will be unreadable and permanently lost.
3. 4.
Make a copy of the key file for each node. On each node: a. Get a copy of the key file and put it in a secure and stable location on that machine.
b.
Configure each instance of Cach for unattended startup. For more information on this procedure, see the section Configuring Startup with Unattended Key Activation.
Since each copy of the key file contains the same key, all the Cach instances are able to read data encrypted by each other. Since each Cach instance has a key file on its machine, the key file should always be available for a Cach restart. If there are any changes to the key file (such as adding or removing administrators), you must propagate new copies of the key file to each machine and reconfigure each instance of Cach for unattended startup using the new copy of the key file (even if that file is in the same location as the old file). Important: Refer to the section Protection from Unauthorized Access to Encrypted Data for details about measures to prevent currently or formerly privileged users from gaining unsanctioned access to encrypted data.
CAUTION:
CAUTION:
If administrators have free access to a key file, then it is possible for them to make unauthorized copies of the key file. Such copies might be used by formerly authorized members of an organization, could be lost, and so on.
The degree of secure storage required is a function of the sensitivity of the data. Under the strictest circumstances, activation might occur as follows:
1.
A system administrator (who does not have the key but does have the information to use the key) needs to re-start Cach. After or as part of a Cach re-start, the database encryption key needs to be activated, so that encrypted databases or databases containing encrypted data can be mounted. The system administrator contacts the key holder (who has the key but lacks the information to use it). The key holder may be part of a sites staff that provides physical security; the key itself may even be stored in a safe or vault. The key holder retrieves the key, which may be on a CD, USB drive, or other portable storage device. The key holder then brings the key to where it is used for key activation. The system administrator then performs key activation under the oversight of the key holder, who ensures that the system administrator performs no other actions, such as copying the key file. Once the key has been activated, the key holder returns the device holding the key to its physically secure location until it is needed again.
2. 3. 4. 5.
Implementing this arrangement is for the purpose of preventing the system administrator from obtaining the key. Again, this is because possessing the key would enable the administrator to gain potentially unauthorized access to the encrypted data.
2. 3. 4.
From the Management Portal home page, go to the Local Databases page ([System] > [Configuration] > [Local Databases]). On the Local Databases page, select the Create New Database menu choice. This displays the Create Database wizard. On the first page of the wizard, select the Encrypt Database? check box. This causes Cach to create an encrypted database. On subsequent pages of the wizard, choose database characteristics as you would when creating any database. (For more information on creating databases, see the Create Local Databases section of the Configuring Cach chapter of the Cach System Administration Guide.) Cach also provides a utility to encrypt unencrypted databases or decrypt encrypted databases, if this is necessary.
Note:
Because the activated key is used for each read and write to the database, you cannot deactivate the key without first dismounting the database. If you attempt to deactivate the key prior to dismounting the database, Cach displays an error message.
Configuring Startup without Key Activation Configuring Startup with Interactive Key Activation Startup with Unattended Key Activation
The features that depend on having a key available at startup time are: Encrypting the Cach audit log. Encrypting the CACHETEMP and CACHE databases. (Either both are encrypted or neither.) Encrypting Cach journal files and, for a destination shadow server, encrypting the journal files received from the source production server. (Either both are encrypted or neither.) Having an encrypted database mounted at startup time.
Address the issue that is preventing the change and then perform this procedure again. Once any issues are corrected, you will be able to successfully change to having startup without key activation.
If this occurs, you need to stop using encrypted journal files before you change the startup key activation settings. To do this, the procedure is: 1. 2. On the Encryption Settings page, change the Encrypt journal files setting to No. Leave the Startup Options setting as it is. Switch journal files. To do this, click Switch Journal on the Journals page ([System] > [Journals]).
Once all open transactions within the encrypted journal files have either been committed or rolled back, you can then change the Cach startup configuration.
CAUTION:
Even after there are no open transactions, you may need the encrypted journal files to restore a database. For this reason, it is very important that you maintain copies of the key file containing the key used to encrypt these files.
For more information on journal files generally, see the Journaling chapter of the Cach Data Integrity Guide.
The Cach Audit Log and Configuring Startup without Key Activation
If the instance has an encrypted audit log, Cach displays a message that an encrypted database is required at startup, such as:
ERROR #1217: Can not disable database encryption key activation at startup. Encrypted databases are required at startup: C:\InterSystems\Cache\Mgr\CacheAudit\
The error message refers to encrypted databases because the audit log is stored in the Cach database CACHEAUDIT. The audit log cannot be encrypted if Cach starts without activating an encryption key. To specify that the instance uses an unencrypted audit log, select No for the Encrypt audit log pulldown on the Encryption Settings page. Changing this setting causes Cach to erase any existing audit data and to write an AuditChange event to the audit log.
CAUTION:
If you have not backed up audit data, changing the encryption setting for the audit log results in the loss of that existing audit data.
is a destination shadow server, if it encrypts the journal files it receives from its source production server. To encrypt journal files, select Yes; to have them be unencrypted, select No. This choice depends on startup options because Cach startup creates a new journal file; if you choose encryption, startup requires a key. Note: This change takes effect the next time that Cach switches journal files. To begin journal file encryption without a restart, switch journal files after completing this page.
Encrypt Audit Log Allows you to specify whether or not Cach encrypts the audit log. To encrypt the audit log,
select Yes; to have it be unencrypted, select No. This choice depends on startup options because the Cach startup procedure records various events in the audit log; if you choose encryption, startup requires a key.
CAUTION:
This change takes effect immediately and deletes any existing audit data. Back up the audit database prior to changing this setting; otherwise, audit data will be lost.
5.
Click Save to save the selected settings. If Cach is configured to Encrypt CACHETEMP and CACHE, journal files, or the audit log Require an encrypted database at startup
Important:
then failure to activate the encryption key causes a Cach startup failure. If this occurs, use Cach emergency startup mode to configure Cach not to require any encrypted facilities at startup.
CAUTION:
If you want Cach to activate a key at startup without requiring any human intervention, then: 1. 1. 2. 3. 4. 5. Click Save to save the selected settings. You need to have a key currently activated. To activate a key, see the section Activating a Key. From the Management Portal home page, go to the Database Encryption page ([System] > [Encryption] > [Database Encryption]). Select Configure Startup Settings. This displays the Startup Options dropdown list. In Startup Options, select Unattended (NOT RECOMMENDED) If the previous value for the field was None, then this displays the pages other fields. The Startup Options area expands to display three fields. Complete these: The path of the database-encryption key file. This can be an absolute or relative path; if you specify a relative path, it is relative to the Cach installation directory. Click Browse to search for the database-encryption key file on the file system.
Key File Administrator Name Password
6.
Complete the fields in the Optionally Encrypted Data area: Allows you to specify whether or not the CACHETEMP and CACHE databases are encrypted. To encrypt them, select Yes; to have them be unencrypted, select No.
Encrypt CACHETEMP and CACHE Databases
Encrypt Journal Files Allows you to specify whether or not the instance encrypts its own journal files and, if it
is a destination shadow server, if it encrypts the journal files it receives from its source production server. To encrypt journal files, select Yes; to have them be unencrypted, select No. This choice depends on startup options because Cach startup creates a new journal file; if you choose encryption, startup requires a key. Note: This change takes effect the next time that Cach switches journal files. To begin journal file encryption without a restart, switch journal files after completing this page.
Encrypt Audit Log Allows you to specify whether or not Cach encrypts the audit log. To encrypt the audit log,
select Yes; to have it be unencrypted, select No. This choice depends on startup options because the Cach startup procedure records various events in the audit log; if you choose encryption, startup requires a key.
CAUTION:
This change takes effect immediately and deletes any existing audit data. Back up the audit database prior to changing this setting; otherwise, audit data will be lost.
7.
When you configure Cach for unattended startup, it creates a special entry in the database-encryption key file. It is especially critical to ensure that the database encryption key file is not stored on the same medium as any encrypted databases. Ideally, the key file should be on a medium that can be physically locked in place, such as a lockable CDROM or DVD drive in a rack, and the datacenter facility should be locked and monitored. Important: If Cach is configured to Encrypt CACHETEMP and CACHE, journal files, or the audit log Require an encrypted database at startup
then failure to activate the encryption key causes a Cach startup failure. If this occurs, use Cach emergency startup mode to configure Cach not to require any encrypted facilities at startup.
For more information about mirroring, see the Mirroring chapter of the Cach High Availability Guide.
These method names all begin with AESCBCManagedKey because the methods use AES (the Advanced Encryption Standard) in cipher block chaining (CBC) mode and are part of the suite of tools for managed key encryption. Important: The AESCBC methods that do not include ManagedKey in their names are older methods and cannot be used for these purposes.
10.3.2.1 $SYSTEM.Encryption.AESCBCManagedKeyEncrypt
The signature of this method as it is usually called is:
$SYSTEM.Encryption.AESCBCManagedKeyEncrypt ( plaintext As %String, keyID As %String, ) As %String
where: plaintext The unencrypted text to be encrypted. keyID The GUID of the data-encryption key to be used to encrypt plaintext. The method returns the encrypted ciphertext.
If the method fails, it throws either the <FUNCTION> or <ILLEGAL VALUE> error. Place calls to this method in a Try-Catch loop; for more information on Try-Catch, see the section The TRY-CATCH Mechanism in the Error Processing chapter of Using Cach ObjectScript. For more details, see the $SYSTEM.Encryption.AESCBCManagedKeyEncrypt class reference content.
10.3.2.2 $SYSTEM.Encryption.AESCBCManagedKeyDecrypt
The signature of this method as it is usually called is:
$SYSTEM.Encryption.AESCBCManagedKeyDecrypt ( ciphertext As %String ) As %String
where:
ciphertext The encrypted text to be decrypted. The method returns the decrypted plaintext.
If the method fails, it throws either the <FUNCTION> or <ILLEGAL VALUE> error. Place calls to this method in a Try-Catch loop; for more information on Try-Catch, see the section The TRY-CATCH Mechanism in the Error Processing chapter of Using Cach ObjectScript. You do not need to include the key ID with this call, as this are stored with and in the ciphertext to be decrypted, respectively. For more details, see the $SYSTEM.Encryption.AESCBCManagedKeyDecrypt class reference content.
10.3.2.3 $SYSTEM.Encryption.AESCBCManagedKeyEncryptStream
The signature of this method as it is usually called is:
$SYSTEM.Encryption.AESCBCManagedKeyEncryptStream ( plaintext As %Stream.Object, ciphertext As %Stream.Object, keyID As %String, ) As %Status
where: plaintext The unencrypted stream to be encrypted. ciphertext The variable to receive the encrypted stream. keyID The GUID of the data-encryption key to be used to encrypt plaintext. The method returns a %Status code.
10.3.2.4 $SYSTEM.Encryption.AESCBCManagedKeyDecryptStream
The signature of this method as it is usually called is:
$SYSTEM.Encryption.AESCBCManagedKeyDecryptStream ( ciphertext As %Stream.Object, plaintext As %Stream.Object ) As %Status
where: ciphertext The encrypted stream to be decrypted. plaintext The variable to receive the unencrypted stream. The method returns a %Status code.
You do not need to include the key ID with this call, as this are stored with and in the ciphertext to be decrypted, respectively. For more details, see the $SYSTEM.Encryption.AESCBCManagedKeyDecryptStream class reference content.
Emergency Situations
Because an encrypted data element has its encrypting key identifier stored with it, this simplifies the process of re-keying data. Given merely the handle to ciphertext and an activated key, an application can perform re-keying. For example, data element encryption supports the ability to re-key sensitive data without any downtime; this is particularly useful for users required to perform this action for legal reasons, such as those fulfilling PCI DSS (Payment Card Industry Data Security Standard) requirements. If you need to re-key data, create a new key and specify to your application that this is the new encryption key. You can then perform an action such as running a background application to decrypt the elements and encrypt them with the new key. This uses the specified key for encryption and always uses the correct key for decryption, since it is stored with the encrypted data.
CAUTION:
If the Database-Encryption Key File Is Required at Startup and Is Not Present If You Can Make the Key File Available If a Backup Key File Is Available If No Key File Is Available
10.4.1.1 If There Is a Backup Copy of the Key File with a Known Administrator Username and Password
CAUTION:
This procedure is for an emergency situation, where encrypted data in Cach databases is in danger of being lost.
If the file containing an activated key becomes inaccessible or damaged, immediately perform the following procedure: 1. 2. Get the backup copy of the key file. This is the copy that you stored as described in the section Protection from Accidental Loss of Access to Encrypted Data. Make a copy of the backup copy.
3. 4.
Re-configure your startup options using the new copy of the key file even if you are setting it up for the same options as before. Make a new backup copy of the key file and store it in a safe place. Follow all the precautions specified in the section Special Cautions to Preserve the Data in Encrypted Databases.
10.4.1.2 If There Is No Backup Copy of the Key File or the Key has No Known Administrator Username and Password
Important: THIS PROCEDURE IS FOR AN EMERGENCY SITUATION, WHERE ENCRYPTED DATA IN CACH DATABASES IS IN DANGER OF BEING LOST.
If the file containing the activated key becomes inaccessible or damaged while Cach is running, immediately perform the following procedure: 1. Do not shut down Cach. Do not deactivate the currently active key.
WARNING!
2. 3.
Shutting down Cach or deactivating the active key will cause the permanent loss of your data.
Contact the InterSystems Worldwide Response Center. Engineers there can help guide you through the following procedure and answer any questions that may arise. Prevent all users from making any changes to the database with encrypted content while copying its data to an unencrypted database. To do this, the procedure is: a. b. c. d. From the Management Portal home page, select the System Operation, then Databases to display the Databases page ([System] > [Databases]). On the Databases page, if the encrypted database is mounted, select the Dismount option in the next-to-last column in that databases row. Then select Perform Action Now on the Dismount database confirmation page. When the Databases page appears again, select the Mount option in the last column in the databases row. On the Mount database confirmation page, check the Read Only box and select Perform Action Now.
It is critical that no one makes any changes to the database during this procedure. Mounting the database read-only prevents any user from changing any data. 4. Copy all data in unencrypted form to another database. If you have multiple encrypted databases, you need to perform this procedure for each database. The procedure for copying the data is: a. In the Cach Terminal, go to the %SYS namespace:
REGULARNAMESPACE> zn "%SYS"
b.
c.
Emergency Situations
Option? 1 1) Copy from Database to Database 2) Copy from Database to Namespace 3) Exit Option?
d.
When ^GBLOCKCOPY prompts for a copy type, select 1, for copying from database to database
Option? 1 Source Directory for Copy (? for List)?
Here, either specify the name of the encrypted database or enter ? to see a numbered list of databases, which includes the encrypted database. If you enter ?, ^GBLOCKCOPY displays a list such as this one:
Source Directory for Copy (? for List)? ? 1) C:\InterSystems\MyCache\mgr\ 2) C:\InterSystems\MyCache\mgr\cache\ 3) C:\InterSystems\MyCache\mgr\cacheaudit\ 4) C:\InterSystems\MyCache\mgr\cachelib\ 5) C:\InterSystems\MyCache\mgr\cachetemp\ 6) C:\InterSystems\MyCache\mgr\docbook\ 7) C:\InterSystems\MyCache\mgr\encrypted1\ 8) C:\InterSystems\MyCache\mgr\encrypted2\ 9) C:\InterSystems\MyCache\mgr\samples\ 10) C:\InterSystems\MyCache\mgr\unencrypted\ 11) C:\InterSystems\MyCache\mgr\user\ Source Directory for Copy (? for List)?
Enter the number of the encrypted database, such as 7 here. e. f. When ^GBLOCKCOPY prompts for a destination directory for copying the data, enter the name of an unencrypted database or ? for a list similar to the one for the source directory. When ^GBLOCKCOPY asks if you wish to copy all globals, enter Yes (can be Yes, Y, y, and so on):
ll Globals? No => y
g.
If there is an empty global in the database, ^GBLOCKCOPY will now ask if you wish to copy it. This will appear something like the following:
All Globals? No => yes ^oddBIND contains no data Include it anyway? No =>
Enter No (can be No, N, n, and so on), which is the default. h. ^GBLOCKCOPY then asks if you wish to skip all the other empty globals. Enter Yes (can be Yes, Y, y, and so on), which is the default:
Exclude any other similar globals without asking again? Yes =>
There then appears a list of all the empty globals that are not being copied:
Exclude any other similar globals without asking again? Yes => Yes ^oddCOM contains no data -- not included ^oddDEP contains no data -- not included ^oddEXT contains no data -- not included ^oddEXTR contains no data -- not included ^oddMAP contains no data -- not included ^oddPKG contains no data -- not included ^oddPROC contains no data -- not included ^oddPROJECT contains no data -- not included ^oddSQL contains no data -- not included ^oddStudioDocument contains no data -- not included ^oddStudioMenu contains no data -- not included ^oddTSQL contains no data -- not included ^oddXML contains no data -- not included ^rBACKUP contains no data -- not included ^rINC contains no data -- not included
i.
^GBLOCKCOPY then asks if you wish to disable journaling for this operation:
Turn journaling off for this copy? Yes =>
Enter Yes (can be Yes, Y, y, and so on), which is the default. j. ^GBLOCKCOPY then asks if to confirm that you wish to copy the data:
Confirm copy? Yes =>
Enter Yes (can be Yes, Y, y, and so on), which is the default. Depending on the size of the database and the speed of the processor, you may see the status of the copy as it progresses. When it completes, ^GBLOCKCOPY displays a message such as:
Copy of data has completed
k.
^GBLOCKCOPY then asks if you wish to save statistics associated with the copy. Enter No (can be No, N, n, and so on), which is the default:
Do you want to save statistics for later review? No =>
Control then returns to the main prompt. 5. 6. 7. 8. Test that the copied data is valid. You can do this by examining the classes, tables, or globals in the Management Portals System Explorer for the database into which ^GBLOCKCOPY has copied the data. If the data is valid, perform steps 3 and 4 of this procedure for each encrypted database. Once you have made copies of every encrypted database into an unencrypted database, make a second copy of each database, preferably to a different machine than that which holds the first copy of each. Now and only now you can dismount all encrypted databases and deactivate the active key (that is, the key for which the key file is missing or damaged). Cach requires that you dismount all encrypted databases prior to deactivating their key.
You now have your data in one or more unencrypted databases and there is no activated key. To re-encrypt the formerly encrypted databases, the procedure is: 1. 2. Create a new database-encryption key according to the procedure described in the section Creating a Key. Create a new backup copy of the key file as described in Protection from Accidental Loss of Access to Encrypted Data.
CAUTION:
Make sure you take the precautions described in Protection from Accidental Loss of Access to Encrypted Data; failure to follow these procedures can result in the permanent loss of data.
3. 4.
Create one or more new encrypted databases, using the new key. Import the data exported in the previous procedure into the new encrypted database(s).
Your data is now stored in encrypted databases for which you have a valid key and a backup copy of the key file containing that key.
Emergency Situations
10.4.2 If the Database-Encryption Key File Is Required at Startup and Is Not Present
Under certain conditions related to the required use of a database-encryption key file at startup, Cach starts in single-user mode. These conditions are: Cach is configured for either interactive or unattended startup. Startup specifies that journal files and/or the CACHETEMP and CACHE databases are encrypted, or an encrypted database is specified as required at startup. The database-encryption key file is not present.
2. 3.
If you know the location where Cach is expecting to find the database-encryption key file, then place the key file there. (Otherwise, you need to run ^STURECOV as specified in the next section.) Start Cach again.
Cach should start in its typical mode (multi-user mode) and operate as expected.
This connects you with Cach in the operating system terminal window; the prompt in that window changes from the operating system prompt to the Cach %SYS prompt. 3. 4. If you have or can obtain a copy of the database-encryption key file (such as a backup), then place a copy of the key file in a location accessible to Cach. Run the ^STURECOV (startup recovery) routine at the Cach terminal prompt. In that routine, activate the encryption key using an administrator username and password in that file. (You do not need to exit ^STURECOV when you have completed this process.) When you are satisfied that Cach is ready for use, use ^STURECOV to complete the startup procedure. Cach then starts in multi-user mode.
5.
This connects you with Cach in the operating system terminal window; the prompt in that window changes from the OS prompt to the Cach %SYS prompt. 3. 4. If you have encrypted journal files, use ^STURECOV (startup recovery) to deactivate journal file encryption. Run the ^STURECOV routine at the Cach terminal prompt. In that routine, configure Cach database startup options not to require a database encryption key. This means that the CACHETEMP and CACHE databases as well as journal files should now operate as expected; it also means that any encrypted databases cannot be mounted. When you are satisfied that Cach is ready for use, use ^STURECOV to complete the startup procedure. Cach then starts in multi-user mode. If you have not performed the actions described in the section Protection from Accidental Loss of Access to Encrypted Data, then your data may no longer be available in any form. This is a very serious problem, but if you do not have a key, there is no way to retrieve the lost data.
5.
CAUTION:
For example, to read a block on a system with a 1 GHz processor, the time required would be:
Other Information
1 block * (8192 bytes / block) * (30 CPU clock ticks / byte) _________________________________________________________________________ 1,000,000,000 CPU clock ticks / second
which works out to a cost of 0.24 milliseconds for reading the block, compared to a typical disk read latency of 8 milliseconds.
11
SQL Security
Cach has both system-level security, and an additional set of SQL-related security features. The Cach SQL security provides an additional level of security capabilities beyond its database-level protections. Some of the key differences between SQL and system-level security are: SQL protections are more granular than system-level protections. You can define privileges for tables, views, and stored procedures. SQL privileges can be granted to users as well as to roles. System-level privileges are only assigned to roles. Holding an SQL privilege implicitly grants any related system privileges that are required to perform the SQL action. (Conversely, system-level privileges do not imply table-level privileges.) The different types of privileges are described in the SQL Privileges and System Privileges section.
Consider the following example for an instance of Cach on a Windows machine: There is a class in the USER namespace called User.MyPerson. This class is projected to SQL as the SQLUser.MyPerson table. There is a user called Test, who belongs to no roles (and therefore has no system privileges) and who has all privileges on the SQLUser.MyPerson table (and no other SQL privileges). There is a second user, called Test2. This user is assigned to the following roles: %DB_USER (and so can read or write data on the USER database); %SQL (and so has SQL access through the %Service_Bindings service); and, through a custom role, has privileges for using the Console and %Development.
If the Test user attempts to read or write data in the SQLUser.MyPerson table through any SQL-specific mechanism (such as one that uses ODBC), the attempt succeeds. This is because Cach makes the Test user a member of the %DB_USER and %SQL role to establish the connection; this is visible in audit events that the connection generates, such as the %System/%Login/Login event. (If the Test user attempts to use the Cach terminal or Management Portal, these attempts fail, because the user lacks sufficient privilege for these.)
SQL Security
If the Test2 user attempts to read or write data in the SQLUser.MyPerson table through any SQL-specific mechanism (such as one that uses ODBC), the attempt fails because the user does not have sufficient privileges for the table. (If the Test2 user attempts to view the same data in the Cach terminal using object mechanisms, the attempt succeeds because the user is sufficiently privileged for this type of connection.)
This does not affect the value returned by the SQL CURRENT_USER function. It is always the same as $USERNAME.
is equivalent to performing the same action using the Management Portal. For the user to be able to work with a particular table, privileges for that table must be explicitly granted, such as with the Management Portal.
The minimum privilege required to work with a particular table is: any SQL privilege, like SELECT, on the relevant table. If the user has the right to perform a SELECT command, then this grants the ability to read and use but not write; analogously, INSERT, UPDATE, and DELETE provide those privileges.
12
System Management and Security
This chapter covers the following topics: System Security Settings Page System-wide Security Parameters Authentication Options Password Strength and Password Policies Protecting Cach Configuration Information Managing Cach Security Domains Security Advisor Effect of Changes Emergency Access
Enable audit
Turns auditing on or off. This check box performs the same action as the Enable Auditing and Disable
Auditing links on the Auditing page ([System] > [Security Management] > [Auditing]). For more information on auditing,
Specifies whether configuration security is on or off, as described in the section Protecting Cach Configuration Information. [Default is off]
Allows you to choose the instances default security domain. For more information on security domains, see the section Managing Cach Security Domains . [Default is the domain established during installation]
Default security domain
Specifies the maximum number of days that a user account can be inactive, which is defined as the amount of time between successful logins. When this limit is reached, the account is disabled. A value of 0 (zero) means that there is no limit to the number of days between logins. [Default is 0 for minimal-security installations and 90 for normal and locked-down installations]
Inactive limit (0365)
Specifies the maximum number of successive unsuccessful login attempts. After this limit is reached, either the account is disabled or an escalating time delay is imposed on each attempt; the action depends on the value of the Disable account if login limit reached field. A value of 0 (zero) means that there is no limit to the number of invalid logins. [Default is 5]
Invalid login limit (0-64)
If checked, specifies that reaching the number of invalid logins (specified in the previous field) causes the user account to be disabled.
Disable account if login limit reached Password Expiration Days (099999) Specifies how frequently passwords expire and, therefore, how frequently users
must change their passwords (in days). When initially set, specifies the number of days until passwords expire. A value of 0 (zero) means that the password never expires. [Default is 0]
CAUTION:
This setting affects all accounts for the Cach instance, including those used by Cach itself. Until passwords are updated for these accounts, it may impossible for various operations to proceed and this may lead to unexpected results.
Password pattern Specifies the acceptable format of newly created passwords. See
Password Strength and Password Policies for more information. [Default for an instance with Minimal and Normal security is 3.32ANP; default for a locked-down instance is 8.32ANP.] Specifies a user-provided routine (or entry point) for validating a password. See the PasswordValidationRoutine method in the Security.System class for more information.
Password validation routine Role required to connect to this system If set to an existing role, specifies that a user must be a member of this role
if not checked, write access is controlled by normal security mechanisms. For more information on the percent globals and CACHESYS (the database that holds them), see the section CACHESYS, the Managers Database in the chapter Assets and Resources. [Default is controlled by normal security mechanisms.] Specifies whether there is support for multiple Cach security domains. For more information on security domains, see the section Managing Cach Security Domains. [Default is a single domain]
Allow multiple security domains Superserver SSL/TLS Support
Specifies if the superserver supports or requires the use of SSL/TLS for client con-
The superserver requires client connections to use SSL/TLS. Not recommended see the following caution for details.
Required
Authentication Options
Note:
Before you can configure the superserver to use SSL/TLS, there must be an existing configuration called %SuperServer.
For more information about using SSL/TLS with the Cach superserver, see Configuring the Cach Superserver to Use SSL/TLS.
CAUTION:
Requiring clients to use SSL/TLS for their connections will prevent the proper operation of ECP, the Management Portal, and other web applications. This describes circumstances when an administrator creates an SSL/TLS configuration called %SuperServer , enables this configuration, and then specifies in the Superserver SSL/TLS Support field that the SSL/TLS is required (clicking the Required radio button). The administrator can correct this problem at the Terminal (which still connects) using ^SECURITY as follows: 1. 2. 3. 4. Start ^SECURITY in a terminal session. Select option 9 (Systems parameter setup). Select option 1 (Edit system options). In answer to the question, What type of SSL/TLS connections are allowed for the superserver?, change the setting to Accept or None (equivalent, respectively, to Enabled and Disabled in the Portal).
The authentication options are: Allow Unauthenticated access Users may connect without authenticating. (If login dialog appears, the user can leave the Username and Password fields blank and click OK to log in.) Allow Operating System authentication Cach uses the operating systems user identity to identify the user.
Allow Password authentication Cach uses its own native tools to authenticate a username and password that are registered with it. This mechanism is also known as Cach login. Allow Delegated authentication Cach delegates the process of authentication to a user-defined function. Allow Kerberos authentication Cach performs authentication using Kerberos. Allow LDAP authentication Cach uses an available LDAP database to authenticate users. Allow LDAP cache credentials authentication Cach keeps a cached copy of LDAP credentials so that it can authenticate LDAP users if the LDAP database becomes unavailable. Enable two-factor authentication Cach provides a second authentication token to the user via a mobile phone text message that the user must then enter to complete the authentication process. If selected, the Authentication Options page displays the fields for configuring two-factor authentication.
If there are multiple authentication options, Cach uses cascading authentication. For more information on authentication, see the chapter Authentication.
where X is the minimum number of characters in the password. Y is the maximum number of characters in the password. A, N, and P specify whether Alphabetic characters, Numeric characters, and Punctuation characters are permitted in the password.
These rules are based on the Cach ObjectScript pattern matching functionality. This functionality is described in the Pattern Matching section of the Operators and Expressions chapter of Using Cach ObjectScript. Note: The value for this parameter does not affect existing passwords.
If the operator chooses option 2, Cach renames the parameter file that was invoked at startup (file.cpf) with the suffix _rejected (file.cpf_rejected). Cach then overwrites the file.cpf with the last known good configuration (_LastGood_.cpf) and starts up using this configuration. Note: The protections for the cache.cpf file are not a substitute for operating-systemlevel security. It is recommended that you protect the configuration file by strictly limiting the ability of users to modify it, at the operating-system level.
For more information on the configuration file generally, see the Cach Parameter File Reference.
For an instance with multiple domains: The $USERNAME variable includes the domain name. System utilities show the domain name when displaying usernames.
In a multiple-domain configuration, a fully-qualified user identifier consists of a username, an at sign ( @ ), and a domain name, such as, [email protected]. To specify support for a single domain or multiple domains, use the Allow multiple security domains field of the Systemwide Security Parameters page of the Management Portal ([System] > [Security Management] > [System-wide Security Parameters]), described in the System-wide Security Parameters section of this chapter.
The page also has a Create New Domain button. Selecting this displays the Edit Domain page which accepts a domain name and an optional domain description. After entering this information, select Save to create the domain.
Security Advisor
Name button Each named item in each section is a link. Selecting one of these items displays the page for managing
that item.
Ignore check box Each named item in each section has an associated Ignore check box. Selecting this grays out the
line for the specified item. The line does not appear if Cach is set up according to the Security Advisors recommendations, whether or not the Ignore check box is selected.
12.7.1 Auditing
This section displays recommendations on auditing itself and on particular audit events: Auditing should be enabled Auditing creates a record that can provide forensic information after any notable or unusual system events. Auditing for this event type should be enabled Auditing particular events can provide more specific information about various topics. Specifically, since the events noted when not enabled are: The DirectMode event Auditing this event can provide information about connections to Cach that give users significant privileges. The Login event Auditing this event can provide information questionable logins. The LoginFailure event Auditing this event can provide information about attempts to gain inappropriate access to the system.
12.7.2 Services
This section displays recommendations on Cach services. For each service, depending on its settings, the Security Advisor may address any of the following issues: Ability to set % globals should be turned off Since % globals often hold system information, allowing users to manipulate these globals can result in serious, pervasive, and unpredictable effects. Unauthenticated should be off Unauthenticated connections give all users, including the unidentified UnknownUser account, unregulated access to Cach through the service. Service should be disabled unless required Access through any service monitored by the Security Advisor can provide an undue level of system access. Service should use Kerberos authentication Access through any other authentication mechanism does not provide the maximum level of security protection. Service should have client IP addresses assigned By limiting the number of IP addresses from which connections are accepted, Cach may be able to more tightly oversee the connections to it. Service is Public Public services give all users, including the unidentified UnknownUser account, unregulated access to Cach through the service.
12.7.3 Roles
This section displays recommendations for all roles that hold possibly undue privileges; other roles are not listed. For each role, the Security Advisor may address any of the following issues: This role holds privileges on the Audit database Read access to the Audit database may expose audited data inappropriately; Write access to the Audit database may allow the inappropriate insertion of data into that database.
This role holds the %Admin_Secure privilege This privilege can allow for the establishing, modifying, and denying access of users to assets; it also allows the modification of other security-related features. This role holds Write privilege on the %CACHESYS database Write access to the %CACHESYS database may allow the compromise of system code and data.
12.7.4 Users
This section displays recommendations related to users generally and for individual user accounts. In this area, the Security Advisor may address any of the following issues: At least 2 and at most 5 users should have the %All role Too few users holding %All can lead to access problems in an emergency; too many users holding it can open the system to compromise This user holds the %All role Explicitly announcing which users hold %All can help eliminate any who hold it unnecessarily. UnknownUser account should not have the %All role A system cannot be properly secured if anonymous users have all privileges. While this is part of any instance with a Minimal security level, such an instance is not properly secured by design. Account has never been used Unused accounts provide an attractive point of entry for those attempting to gain unauthorized access. Account appears dormant and should be disabled Dormant accounts (those that have not been used for over 30 days) provide an attractive point of entry for those attempting to gain unauthorized access. Password should be changed from default password This is a commonly attempted point of entry for those attempting to gain unauthorized access.
Emergency Access
Changes to services, such as whether a service is enabled or authentication is required, are effective for future connection attempts. Existing connections are not affected. Changes to role definitions are effective immediately for any subsequent privilege checks. These affect database resources immediately, because they are checked for each database access. For services and applications, they are effective with subsequent connection attempts or application initiations. The times listed here are the latest times that changes take effect; in some cases, changes may be effective earlier than indicated.
Note:
There is only access using Cach login no other authentication mechanism is supported. For the web applications that control the Portal (/csp/sys and /csp/sys/*), the standard login page (%CSP.Login.cls) is used during emergency access even if there is a custom login page available; this ensures that the emergency user has access to the Portal, since a custom login page may prevent authentication from occurring. For other web applications, if there is a custom login page, then that page is used during emergency login. Two-factor authentication is disabled. This avoids any situation where two-factor authentication might prevent the emergency user from being able to authenticate.
1.
Start the Windows Command Prompt program. (On certain versions of Windows, such as Vista, you must run the Command Prompt as an administrator; to do this, right-click the Command Prompt choice in the menu and then choose Run as Administrator.) Go to the bin directory for your Cach installation. In that directory, invoke Cach at the command line using the appropriate switch and passing in the username and password for the emergency user.
./ccontrol start <cache-instance-name> /EmergencyId=<username>,<password>
2. 3.
This starts an emergency-mode Cach session with only one allowed user where: <cache-instance-name> specifies the instance being started in emergency mode <username> is the sole user of the system <password> is <username>s password On Windows, unlike other operating systems, the EmergencyId switch is preceded by a slash ( / ).
Note:
For example, at the instance MyCache, to start Cach in emergency mode with user Eugenia with the password 52601, the command would be:
./ccontrol start MyCache /EmergencyId=Eugenia,52601
The only user who can then log in is the emergency user, using the appropriate password, such as:
Username: Eugenia Password: ***** Warning, bypassing system security, running with elevated privileges
Once Cach has started, you can start the Terminal from the Cach cube or run any CSP application. This provides access to the Management Portal and all character-based utilities. Using this access, you can change any settings as necessary and then restart Cach in its normal mode.
This starts an emergency-mode Cach session with only one allowed user where: <cache-instance-name> specifies the instance being started in emergency mode <username> is the sole user of the system <password> is <username>s password If going from one of these operating systems to Windows, remember that on Windows only, the EmergencyId switch is preceded by a slash ( /).
Note:
For example, at the instance MyCache, to start Cach in emergency mode with user Eugenia with the password 5262001, the command would be:
ccontrol start MyCache EmergencyId=Eugenia,52601
The only user who can then log in is the emergency user, using the appropriate password, such as:
Emergency Access
Username: Eugenia Password: ***** Warning, bypassing system security, running with elevated privileges
Once Cach has started, you can run Cach Terminal or any CSP application. This provides access to the Management Portal and all character-based utilities. Using this access, you can change any settings as necessary and then restart Cach in its normal mode.
This starts an emergency-mode Cach session with only one allowed user where: <cache-instance-name> specifies the instance being started in emergency mode <username> is the sole user of the system <password> is <username>s password If going from OpenVMS to Windows, remember that on Windows only, the EmergencyId switch is preceded by a slash (/ ).
Note:
For example, at the instance MyCache, to start Cach in emergency mode with user Eugenia with the password 5262001, the command would be:
ccontrol start MyCache EmergencyId="Eugenia,52601"
The only user who can then log in is the emergency user, using the appropriate password, such as:
Username: Eugenia Password: ***** Warning, bypassing system security, running with elevated privileges
Once Cach has started, you can run Cach Terminal or any CSP application. This provides access to the Management Portal and all character-based utilities. Using this access, you can change any settings as necessary and then restart Cach in its normal mode.
The emergency user can make changes to the Cach configuration, but these changes are not activated until the next time that Cach is started in normal (not emergency) mode. This is in contrast to the normal operation of Cach, in which configuration changes are primarily activated without restarting Cach.
13
Using SSL/TLS with Cach
This chapter describes the use of Cach with SSL (Secure Sockets Layer) and TLS (Transport Layer Security), its successor. Cach supports the use of SSL/TLS to secure connections of several types: From various client applications that interact with the Cach superserver. This includes connections from Cach shadow destinations to Cach shadow sources. From Telnet clients that interact with the Telnet server. For use with TCP connections where a Cach instance is the client or server (or a Cach instance is at each end). To use SSL/TLS with ODBC, Cach Studio, the CSP Gateway, or the InterSystems Telnet client, contact the InterSystems Worldwide Response Center (WRC).
Important:
As a server, Cach accepts connections and establishes the use of SSL; as a client, Cach is able to connect to servers that require the use of SSL. In all cases, Cach uses what is called an SSL/TLS configuration, which specifies the various characteristics of a Cach instance as part of an SSL/TLS connection. This chapter has the following sections: About SSL/TLS About Configurations Configuring the Cach Superserver to Use SSL/TLS Configuring the Cach Telnet Service to Use SSL/TLS Configuring Java Clients to Use SSL/TLS with Cach Configuring .NET Clients to Use SSL/TLS with Cach Configuring Cach to Use SSL/TLS with TCP Devices Configuring Cach to Use SSL/TLS with Mirroring Configuring the CSP Gateway to Connect to Cach Using SSL/TLS Establishing the Required Certificate Chain
The ciphersuites of the client and server specify how these activities occur as part of the handshake or are supported for a protected connection. Specifically, a peers ciphersuites specify what features and algorithms it supports. The client proposes a set of possible ciphers for use; from among those proposed, the server selects one. (If there are no common ciphers between the client and server, the handshake fails.) To perform the handshake, SSL/TLS typically uses public-key cryptography (though it can use other means, such as the Diffie-Hellman protocol). With public-key cryptography, each peer (either the client or the server) has a public key and a private key. The private key is a sensitive secret value and the public key is a widely published value; typically, the public key is encapsulated in a certificate, which also contains identifying information about the holder, such as a name, organization, location, issuer validity, and so on. For Cach, an SSL/TLS configuration (described in the section About Configurations) specifies a named set of SSL/TLS-related values, including a certificate file, a private key file, and an optional set of ciphersuites. If successful, the handshake creates session keys that are used to protect subsequent communications. While Cach and applications require various interactions with SSL/TLS, the end-user typically has no such direct interactions. For example, a browser uses SSL/TLS to establish a secure connection with a specified web site by requiring that the site (the server, in this case) authenticate itself to the browser (which occurs unbeknownst to the browsers user) and the lock icon that appears in the browser is designed to indicate that SSL/TLS is protecting the connection.
About Configurations
Any text.
Type Intended purpose for this configuration, where the choice is Client or Server; the default is Client. Clients ini-
tiate the use of the protocol and servers respond to the initial request. (The Cach superserver uses a server configuration; SSL/TLS clients, such as a shadow destination, use a client configuration.) The value chosen for this field determines the choices available for or behavior of the Peer certificate verification level and File containing trusted Certificate Authority X.509 certificate(s) fields.
Peer certificate verification level
Specifies whether or not the configuration requires the verification of the peer to
Require
specifies that the server neither requests nor requires a client certificate.
Request allows the client to provide or not provide a certificate. If the client provides no certificate, then authenti-
cation proceeds; if the client provides a certificate and verification fails, then authentication fails.
Require specifies that the client must provide a certificate; authentication depends on verification of the certificate.
The X.509 certificate(s) of the Certificate Authority or Certificate Authorities that this configuration trusts, including path(s), in PEM format. The path can be specified as either an absolute path or a path relative to the managers directory. (Note that certificates from the Windows Certificate Export Wizard must be in base-64encoded X.509 format, not the default of DER-encoded binary X.509.)
File containing trusted Certificate Authority X.509 certificate(s)
The configuration uses the certificates of the trusted CA(s) to validate peer certificates. Hence, for a server configuration with a peer certification level of None, the field is not available, since there is no peer validation. Note: With mirroring, the configuration must also have enough information to validate its own certificate.
For information on how these certificates are used, see the section Establishing the Required Certificate Chain. For information on file names for these certificates and how to verify a certificate chain, see the OpenSSL documentation on the verify command.
This clients credentials or This servers credentials The files (if needed) containing the X.509 certificate and private
key for the local configuration: The full location of the configurations own X.509 certificate(s), in PEM format. This can be specified as either an absolute or a relative path. This can include a certificate chain. For information on how this is used for authentication, see the section Establishing the Required Certificate Chain. (Note that certificates from the Windows Certificate Export Wizard must be in base-64 encoded X.509 format, not the default of DER encoded binary X.509.)
File containing this configurations X.509 certificate File containing associated private key The full location of the configurations private key file, specified as either
Algorithm) and RSA (Rivest, Shamir, and Adleman, for the algorithms inventors).
Private key password
An optional password for encrypting and decrypting the configurations private key. A retyping of the optional password to ensure that it is the intended string.
Cryptographic settings:
Those communications protocols that the configuration considers valid, where the choices are one or more of SSLv2, SSLv3, and TLSv1. The default is SSLv3 and TLSv1.
Protocols Enabled ciphersuites The set of ciphersuites used to protect communications between the client and the server.
See the Enabled Ciphersuites Syntax section for more information on this topic. Note: The required fields vary, depending on whether the configuration is to be a client or server and on the desired features. Not all fields are required for all SSL configurations.
At the bottom of this page are three buttons: Checks for valid configuration information. If the configurations role is as a client, selecting this button also prompts for a server (its host name, not its URL) and a port number; Cach then tries to establish a test connection to that server. (This button is not available when creating a server configuration.)
Test Save Dismisses the dialog, saving and then activating the configuration. This saves changes to an existing configu-
being created.
About Configurations
Regarding certificate formats, note that certificates from the Windows Certificate Export Wizard must be in base-64 encoded X.509 format, not the default of DER encoded binary X.509.
Both the list of ciphersuite names and the syntax for specifying enabled ciphersuites is described on the ciphers(1) man page at openssl.org. This syntax allows you to specify guidelines for requiring or proscribing the use of various features and algorithms for a configuration. The default for a Cach configuration is TLSv1:SSLv3:!ADH:!LOW:!EXP:@STRENGTH which breaks down into the following group of colon-separated statements:
TLSv1 Specifies the inclusion of TLS v1.0 ciphersuites. SSLv3 Specifies the inclusion of SSL v3.0 ciphersuites. !ADH Specifies the unconditional exclusion of anonymous Diffie-Hellman ciphersuites. !LOW Specifies the unconditional exclusion of ciphersuites using 56- or 64-bit encryption algorithms. This statement
the connection.
Type
Because the instance is serving with an SSL/TLS client, the type must be specified to be of type Client. The specified ciphersuites need to match those required or specified by the server.
Ciphersuites
It is also necessary to ensure that the client and the server are configured so that each may verify the others certificate chain, as described in the section Establishing the Required Certificate Chain.
information about configuring the superserver to use SSL/TLS, see the next section. Important: For SSL/TLS to function properly, you must use the exact case for each configuration name as it appears here.
5.
5.
Make sure the Telnet service, %Service_Telnet, is enabled. To do this: a. b. c. On the Services page ([System] > [Security Management] > [Services]), click %Service_Telnet to display the Edit Service page for the Telnet service. On the Edit Service page, check Service Enabled if it is not already checked. Click Save to save the settings and to return to the Services page.
The following guidelines apply: If the Telnet client requires server authentication, then the server must provide a certificate and the client must have access to the servers certificate chain. If the Cach Telnet server requires client authentication, then the client must provide a certificate and the server must have access to the clients certificate chain. If the Cach Telnet server requests client authentication, then the client has the option of providing a certificate and a certificate chain to its certificate authority (CA). If the client does not provide a certificate, then authentication succeeds; if it provides a non-valid certificate or certificate chain, then authentication fails.
For information on how certificate and certificate chains are used for authentication, see the section Establishing the Required Certificate Chain.
The true value of the SSL keyword specifies that SSL/TLS secures the client-server connection (by authenticating the Cach server to the .NET client and, optionally, authenticating the client to the server). Once the secure connection is established, the Cach server uses the User ID and Password keywords to authenticate the identity of the user connecting through the .NET client. (Note that the connection string does not specify anything related to mutual authentication; it merely specifies a server, which in turn may request or require client authentication.)
2. 3.
If the client has a private key and certificate, these are stored in the clients keystore; the keystore can also hold the clients root CA certificate and any intermediate CA certificates. To authenticate the server, the client may need to have the root CA certificate for the server and any intermediate CA certificates, these can be stored either in the clients truststore or along with client certificate information in the keystore. For more information on keystores and truststores, see the section Keystores and Truststores in the Java Secure Socket Extension (JSSE) Reference Guide.
To specify the default value of a property for use by all configurations, specify an unversioned property name and its value in the following form:
propertyName = propertyValue
For example, to specify the default value for the keyStoreType property as pkcs12, the form is:
keyStoreType = pkcs12
To override the default value for a property, specify a versioned property name, such as:
keyStoreType.1 = jceks
If a configuration file contains multiple configuration definitions, then these versions must use sequential ordering; if client application code refers to a configuration that follows a sequential gap, then an error results. For example, suppose that a configuration file has three versioned name properties: name.1, name.2, and name.4; the configuration associated with the name.4 property will not ever be created and a reference to it will fail with an error.
of true or false (false is the default). The setting of this property has no effect on exception handling. [Optional]
keyRecoveryPassword Password used to access the clients private key; this was created at the same time as the
private key pair. [Required if the private key has password protections and application code is not passing in the private key as an input parameter.]
keyStore The file for storing the client private key and certificate information. The keystore can also hold the content
was created.]
keyStoreType The format of the keystore file, if one is specified. [Optional]
logfile The file in which Java records errors. [Optional] name A versioned identifier for the Java client configuration. (Each name property must be versioned. Any unversioned name property is not meaningful and is ignored.)
If the configuration file specifies only a single configuration and only uses unversioned property names, the name property is not required (as described in Specifying the Use of the Client Configuration ). For information about specifying multiple configurations with a single configuration file, see the section Configuration Files, Configurations, Properties, Values, and Defaults ). [Optional]
protocol [Required] The SSL or TLS protocol to be used for the connection. The options and the protocols they
specify are:
SSL Some variant of SSL.
SSLv3 Version 3 of SSL. TLS Some variant of TLS. [Default] TLSv1 Version 1 of TLS (equivalent to version 3.1 of SSL). TLSv1.1 Version 1.1 of TLS (equivalent to version 3.2 of SSL).
trustStore The file for storing the servers root CA certificate; it can also hold the certificates for any intermediate
was created.]
trustStoreType The format of the truststore file, if one is specified. [Optional]
3.
Passing that object to Java Connection object for the connection from the client to the Cach server.
To specify information for the connection, the first part of the process is to create a Properties object from a configuration file and set the values of particular properties in it. In its simplest form, the code to do this is:
java.util.Properties prop = new java.util.Properties(); prop.put("connection security level", "10"); prop.put("SSL configuration name",configName); prop.put("key recovery password",keyPassword);
where The connection security level of 10 specifies that the client is attempting use SSL/TLS to protect the connection. configName is a variable whose value holds the name of Java client configuration. If the configuration file has only default values and these are being used for a single configuration, do not include this line; see the following section, Specifying a Configuration without a Name, for details. keyPassword is the password required to extract the clients private key from the keystore.
Once the Properties object exists and has been populated, the final step is to pass it to the connection from the Cach Java client to the Cach server. This is done in the call to the DriverManager.getConnection method. The form of this call is:
Connection conn = DriverManager.getConnection(CacheServerAddress, prop);
where CacheServerAddress is a string that specifies the address of the Cach server and prop is the properties object being passed to that string. If this call succeeds, the SSL/TLS-protected connection has been established. Typically, application code containing calls such as those described in this section includes various checks for success and protection against any errors. For more details about using the Cach Java binding, see Using Java with Cach.
For a complete list of the methods for getting and setting properties, see the CacheDataSource section of the Cach JDBC Compliance chapter of Using Cach with JDBC. The JavaDoc for com.intersys.jdbc.CacheDataSource is under
<install-dir>/dev/java/doc/index.html
When working with a CacheDataSource object, if you want to specify an unnamed configuration, simply do not call setSSLConfigurationName.
For general information about Cach support for mirroring, see the Mirroring chapter of the Cach High Availability Guide.
To both participate in mirroring (either as a failover member or as an async member) and use SSL/TLS, an instance must have two Cach SSL/TLS configurations one of type server and the other of type client; each of these must have an X.509 SSL/TLS certificate issued by a trusted Certificate Authority. The certificates should contain a unique identifier in the Common Name (CN) component of the certificate, such as the fully qualified domain name (FQDN) of the instance plus the members Cach node name; because the CN is a field in a certificates distinguished name (DN), establishing a unique CN ensures that the certificates DN uniquely identifies the member. To create an instances mirroring configurations, follow the procedure in the next section. When SSL/TLS is enabled, the following actions occur: 1. Server authentication: When the client connects to the server, it requires the server to authenticate itself. This authentication verifies that the DN for the servers certificate matches the DN for a system configured in the clients mirror configuration. If there is no match, the client drops the connection.
2.
Client authentication: When the server accepts a connection from a client, it requires the client to authenticate itself. This authentication also verifies that the DN for the clients matches the DN for a system configured in the servers mirror configuration. Again, if there is no match, the server drops the connection. Encryption: The SSL protocol automatically uses the servers certificate to establish an encrypted channel between the client and the server, so that any data passing through this channel is encrypted and thereby secured.
3.
Go to the Create SSL/TLS Configurations for Mirror page. You can do this either on the SSL/TLS Configurations page ([System] > [Security Management] > [SSL/TLS Configurations]) by clicking Create Configurations for Mirror or on the Create Mirror page ([System] > [Configuration] > [Create Mirror]) by clicking Set up SSL/TLS. This displays the Create SSL/TLS Configurations for Mirror page. On the Create SSL/TLS Configurations for Mirror page ([System] > [Security Management] > [SSL/TLS Configurations] > [Create SSL/TLS Configurations for Mirror]), complete the fields on the form. The fields on this page are analogous to those on the New SSL/TLS Configuration page (as described in the section Creating or Editing an SSL/TLS Configuration). Since this page creates both server and client configurations that mirroring automatically enables (%MirrorClient and %MirrorServer), there are no Configuration Name, Description, or Enabled fields; also, for the private-key
3.
password, this page allows you to enter or replace one (Enter new password), specify that none is to be used (Clear password), or leave an existing one as it is (Leave as is). Since both configurations need the same X.509 credentials, completing this form saves both configurations simultaneously. Fields on this page are:
File containing trusted Certificate Authority X.509 certificate(s)
Note:
This file must include the CA certificate that can be used to verify this configurations X.509 certificate.
Note:
If the certificate to be used includes either Key Usage or Extended Key Usage extensions, see the following section, Special Considerations for Certificates for Mirror Members. key
If you select Leave as is, the page displays two additional fields, for entering and confirming a new password for the private key associated with the certificate.
Protocols Enabled ciphersuites
Once you complete the form, click Save. For general information about configuring mirror members, see the Creating a Mirror section of the Mirroring chapter of the Cach High Availability Guide.
If the Extended Key Usage extension is present, then it must specify both: The Client Authentication key usage The Server Authentication key usage
If both extensions are present, then each must specify both values. Of course, it is also valid to have neither extension present. If a certificate only specifies one value (either client or server), the SSL/TLS connection for mirroring fails with an error such as:
error:14094413:SSL routines:SSL3_READ_BYTES:sslv3 alert unsupported certificate
The way to eliminate this error depends on how you obtained your certificates: If you are using self-signed certificates, create new certificates (such as with the OpenSSL library) that adhere to these conditions. If you are using a commercial certificate authority tool (such as Microsoft Certificate Services), create new certificates that adhere to these conditions and use the tool to sign your certificate signing requests (CSRs). If you are purchasing certificates from a commercial certificate authority (such as VeriSign), include a request along with your CSRs that they adhere to these conditions.
How you invoke the Cach SSL/TLS functionality depends on whether you are using Cach as a client or server and whether you are creating an initially-secured TCP connection or adding SSL/TLS to an existing connection. This section addresses the following topics: Configuring a Client to Use SSL/TLS with a TCP Connection Configuring a Server to Use SSL/TLS with a TCP Socket
If Cach is a client, then it connects to the server via the client application. The connection uses the specified configuration to determine its SSL-related behavior.
The TCP string specifies that this is a TCP device. For more information on initiating a TCP connection, see the section OPEN Command for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide. 2. Open the connection, specifying the use of SSL with either the /SSL or /TLS parameter.
OPEN MyConn:(SvrID:1000:/SSL="MyCfg")
where MyConn is the device previously specified SvrID can be a string that is a resolvable DNS name or an IP address MyCfg is a saved (and activated) SSL/TLS configuration
This call opens a TCP connection to the loopback processor (that is, the local machine) on port 1000 using SSL. It uses SSL according to the characteristics specified by the MyCfg configuration. Optionally, the call can include a password for the private key file:
OPEN MyConn:(SvrID:1000:/SSL="MyCfg|MyPrivateKeyFilePassword")
Here, all the arguments are as above and MyPrivateKeyFilePassword is the actual password. For more information on opening a TCP device, see OPEN and USE Command Keywords for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide. Once the connection is established, you can then use it in the same manner as any other TCP connection.
The TCP string specifies that this is a TCP device. For more information on initiating a TCP connection, see the section OPEN Command for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide.
2.
Specify the use of SSL/TLS as follows with either the /SSL or /TLS parameter:
USE MyConn:(::/TLS="MyCfg")
Optionally, the call can include a password for the private key file:
USE MyConn:(::/TLS="MyCfg|MyPrivateKeyFilePassword")
Here, all the arguments are as above and MyPrivateKeyFilePassword is the actual password. For more information on opening a TCP device, see OPEN and USE Command Keywords for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide. Having added SSL/TLS security to the connection, you can continue to use it in the same manner as before.
This socket requires the use of SSL/TLS from clients connecting to it. When a client attempts to connect to the server, the server attempts to negotiate a connection that uses SSL/TLS. If this succeeds, the connection is available for normal use and communications are secured using the negotiated algorithm. If it fails, there is no connection available for the client.
The TCP string specifies that this is a TCP device. For more information on initiating a TCP connection, see the section OPEN Command for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide. 2. Open the connection, specifying the use of SSL with either the /SSL or /TLS parameter.
OPEN MySocket:(:1000:/TLS="MyCfg")
Optionally, the call can include a password for the private key file:
OPEN MySocket:(:1000:/TLS="MyCfg|MyPrivateKeyFilePassword")
This call opens a TCP socket on port 1000 using TLS. For more information on opening a TCP device, see OPEN and USE Command Keywords for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide.
The TCP string specifies that this is a TCP device. For more information on initiating a TCP connection, see the section OPEN Command for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide. 2. Specify the use of SSL/TLS as follows with either the /SSL or /TLS parameter:
USE MySocket:(::/SSL="MyCfg")
Optionally, the call can include a password for the private key file:
USE MySocket:(::/SSL="MyCfg|MyPrivateKeyFilePassword")
For more information on opening a TCP device, see OPEN and USE Command Keywords for TCP Devices in the TCP Client/Server Communication chapter of the Cach I/O Device Guide. Having added SSL/TLS security to the socket, you can continue the connection to it in the same manner as before.
Note:
For information on setting up a connection between the CSP Gateway and the Cach server that is protected by Kerberos, see the Setting Up a Kerberized Connection from the CSP Gateway to Cach section of the Authentication chapter.
The procedure is: 1. 2. 3. 4. 5. 6. If there is not already a %SuperServer SSL/TLS configuration associated with the Cach server, create one as described in the section Creating or Editing an SSL/TLS Configuration. On the Portals System-wide Security Parameters page ([Home] > [Security Management] > [System-wide Security Parameters]), for the Superserver SSL/TLS Support choice, select Enabled (not Required). Go to the CSP Gateways Server Access page ([System] > [Configuration] > [CSP Gateway Management]). On that page, under Configuration, select Server Access. Next, select Edit Server and click Submit. This displays the configuration page for the CSP Gateway. On this page, configure the CSP Gateway to use SSL/TLS. Specifically, for the Connection Security Level field, select SSL. You must also specify values for the SSL Protocol, SSL Key Type, Require peer certificate verification, SSL Certificate File, SSL Certificate Key File, SSL CA Certificate File, andSSL Private Key Passwor fields. For more details on the fields on this page, see the Configuring Server Access section of the CSP Gateway Operation and Configuration chapter of the CSP Gateway Configuration Guide.
Suppose there are: A verified entity (named VE) with a certificate signed by the certificate authority named ICA1.
A certificate for ICA1 signed by the certificate authority ICA2, and a certificate for ICA2 signed by RootCA. A trusted CA (named RootCA ) with a self-signed root certificate.
The following are valid distributions of certificates between the verified entity and the verifying entity:
Note that it is not valid to have VE and ICA2 in the verified entitys certificate file and ICA1 and RootCert in the verifying entitys trusted CA certificate file
14
Using Delegated Authentication
Cach supports the use of user-defined authentication mechanisms. This is known as delegated authentication. Delegated authentication allows administrators to implement custom mechanisms to replace the authentication and role-management activities that are part of Cach security. This chapter covers the following topics: Overview of Delegated Authentication Creating Delegated (User-Defined) Authentication Code Setting Up Delegated Authentication After Delegated Authentication Succeeds
For example, to use delegated authentication for an instances Management Portal, the steps are: 1. 2. 3. 4. Create the user-defined authentication code in ZAUTHENTICATE. Enable delegated authentication for the Cach instance as a whole. Enable delegated authentication for the %Service_CSP service. Enable delegated authentication for the set of /csp/sys* applications.
1.
When a service or application uses delegated authentication, a login attempt automatically results in a call to the ZAUTHENTICATE routine. The authentication code in this routine can be any user-defined Cach ObjectScript, class methods, or $ZF callout code. The next step depends on whether or not authentication succeeds and whether or not this is the first login using ZAUTHENTICATE: If ZAUTHENTICATE succeeds and this is the first time that the user has been authenticated through this mechanism, the user is added to the list of Cach users with a type of Delegated user . If ZAUTHENTICATE sets roles or other characteristics, these become part of the users properties. If ZAUTHENTICATE succeeds and this is not the first login, ZAUTHENTICATE updates the users properties. If ZAUTHENTICATE fails, then the user receives an access denied error and is unable to access the system. To determine why this has occurred: a. b. Check the Reason for Failing to Login field in the User Profile. For more detailed information, check the audit log for the relevant %System/%Login/LoginFailure event. If auditing or the LoginFailure event are not enabled, you may need to enable both of these and then re-create the circumstances of the login failure.
2.
3.
A delegated user is listed as such in the Type column of the list of users on the Users page ([System] > [Security Management] > [Users]). The users properties are displayed read-only in the Management Portal and are not editable from within Cach (since all the information comes from outside Cach). Note: A delegated user cannot also be a Cach password user.
2.
From within Studio, save it as a .MAC file in the %SYS namespace. From the File menu, choose Save as; in the dialog that appears, enter ZAUTHENTICATE in the File name field and choose Macro Routine (*.mac) in the Files of type field. (Saving the routine to a .MAC file preserves it across Cach upgrades, while saving it as an .INT file does not.) Review the comments in the system-supplied code for ZAUTHENTICATE. These provide important guidance about how to implement a custom version of the routine. Edit the routine by adding custom authentication code and any desired code to set user account characteristics. Because Cach places no constraints on the authentication code in ZAUTHENTICATE, the application programmer is responsible for ensuring that this code is sufficiently secure.
3. 4.
CAUTION:
14.2.2 Signature
The signature of ZAUTHENTICATE is:
ZAUTHENTICATE(ServiceName, Namespace, Username, Password, Credentials, Properties) PUBLIC { // authentication code // optional code to specify user account properties and roles }
where: ServiceName A string representing the name of the service through which the user is connecting to Cach, such as %Service_Console or %Service_CSP. Namespace A string representing the namespace on the Cach server to which a connection is being established. This is for use with the %Service_Bindings service, such as with Studio or ODBC. Username A string representing the name of the account entered by the user that is to be validated by the routines code. Password A string representing the password entered by the user that is to be validated. Credentials Passed by reference. Not implemented in this version of Cach. Properties Passed by reference. An array of returned values that defines characteristics of the account named by Username.
When Cach calls ZAUTHENTICATE, it has values for these arguments and supplies them to the routine.
CAUTION:
Because Cach does not and cannot place any constraints on the authentication code in ZAUTHENTICATE, the application programmer is responsible for ensuring that this code is sufficiently secure.
The username and password returned are then authenticated in the normal manner as if the user entered them. A possible use of this mechanism is to provide a username and password within the entry point and then, within authentication code, to $roles for the process. The username and password returned from this entry point can be obtained by any mechanism that the application developer chooses. They can come from a global, an external DLL or LDAP call, or simply set within the routine. The application developer could even provide code to prompt for the username and password, such as in a terminal connection or with a custom CSP login page. If the entry point returns an error status, then the error is logged in the audit log, and the user is denied access to the system; the one exception to this is if the error status $SYSTEM.Status.Error($$$GetCredentialsFailed) is returned, in which the normal username/password prompting proceeds. In the following example of a GetCredentials entry point, the code performs different actions for different services: For %Service_Console, it does not prompt the user for any information and sets the processs username and password to _SYSTEM and SYS, respectively. For %Service_Bindings, it forces the user to provide a username and password. For web applications, it checks if the application in use is the /csp/samples application; if it is that application, it sets the username and password to AdminUser and Test. For all other web applications, it denies access. For any other service, it denies access.
Finally, the Error entry point performs clean-up as necessary. The code is:
GetCredentials(ServiceName,Namespace,Username,Password,Credentials) Public { // For console sessions, authenticate as _SYSTEM. If ServiceName="%Service_Console" { Set Username="_SYSTEM" Set Password="SYS" Quit $SYSTEM.Status.OK() } // For the CSP samples application, authenticate as AdminUser. If $isobject($get(%request)) { If %request.Application="/csp/samples/" { Set Username="AdminUser" Set Password="Test" Quit $System.Status.OK() } } // For bindings connections, use regular prompting. If ServiceName="%Service_Bindings" { Quit $SYSTEM.Status.Error($$$GetCredentialsFailed) } // For all other connections, deny access. Quit $SYSTEM.Status.Error($$$AccessDenied) }
For more details, see the comments for this entry point in ZAUTHENTICATE.INT.
Each of these elements is described in more detail in one of the following sections. Note: The value of each element in the properties array determines the value of its associated property for the user being authenticated. It is not possible to use only a subset of the properties or to manipulate their values after authentication.
Comment
If ZAUTHENTICATE sets the value of Properties("Comment"), then that string becomes the value of the user accounts Comment property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Comment for the user account is a null string and the relevant field in the Management Portal then holds no content.
FullName
If ZAUTHENTICATE sets the value of Properties("FullName"), then that string becomes the value of the user accounts Full name property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Full name for the user account is a null string and the relevant field in the Management Portal then holds no content.
NameSpace
If ZAUTHENTICATE sets the value of Properties("Namespace"), then that string becomes the value of the user accounts Startup Namespace property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Startup Namespace for the user account is a null string and the relevant field in the Management Portal then holds no content. Once connected to Cach, the value of Startup Namespace (hence, that of Properties("Namespace")) determines the initial namespace for any user authenticated for local access (such as for Console, Terminal, or Telnet). If Startup Namespace has no value (since Properties("Namespace") has no value), then the initial namespace for any user authenticated for local access is determined as follows: 1. 2. If the USER namespace exists, that is the initial namespace. If the USER namespace does not exist, the initial namespace is the %SYS namespace. If the user does not have the appropriate privileges for the initial namespace, access is denied.
Note:
Password
If ZAUTHENTICATE sets the value of Properties("Password"), then that string becomes the value of the user accounts Password property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Password for the user account is a null string and the relevant field in the Management Portal then holds no content.
Roles
If ZAUTHENTICATE sets the value of Properties("Roles"), then that string specifies the Roles to which a user is assigned; this value is a string containing a comma-delimited list of roles. If no value is passed back to the calling routine, then the value of Roles for the user account is a null string and the relevant field in the Management Portal then holds no content. Information about a users roles is available on the Roles tab of a users Edit User page. If any roles returned in Properties("Roles") are not defined, then the user is not assigned to the role. Hence, the logged-in user is assigned to roles as follows: If a role is listed in Properties("Roles") and is defined by the Cach instance, then the user is assigned to the role. If a role is listed in Properties("Roles") and is not defined by the Cach instance, then the user is not assigned to the role. A user is always assigned to those roles associated with the _PUBLIC user. A user also has access to all public resources. For information on the _PUBLIC user, see the section The _PUBLIC Account in the Users chapter; for information on public resources, see the section Services and Their Resources in the Resources chapter.
Routine
If ZAUTHENTICATE sets the value of Properties("Routine"), then that string becomes the value of the user accounts Startup Tag^Routine property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Startup Tag^Routine for the user account is a null string and the relevant field in the Management Portal then holds no content. If Properties("Routine") has a value, then this value specifies the routine to execute automatically following login on a terminal-type service (such as for Console, Terminal, or Telnet). If Properties("Routine") has no value, then login starts the Cach Terminal session in programmer mode.
Username
If the username property is returned by this function, then that username is written to the Cach database. This gives the user a chance to normalize what was entered by the user at the username prompt. Note that the normalized username must only differ by case. If the Username property is not passed back to the calling routine, then the username entered by the user at the username prompt will be used as the username written to the Cach security databases (that is, it is not normalized). If ZAUTHENTICATE sets the value of Properties("Username"), then that string becomes the value of the user accounts Name property in Cach. (This property is described in the section Properties of Users , in the Users chapter.) This provides the application programmer with an opportunity to normalize content provided by the end-user at the login prompt. If there is no explicit call that passes the value of Properties("Username") back to the calling routine, then there is no normalization and the value entered by the end-user at the prompt serves as the value of the user accounts Name property without any modification.
ZAUTHENTICATE can return system-defined or application-specific error messages. All these messages use the Error method of the %SYSTEM.Status class. This method is invoked as $SYSTEM.Status.Error and takes one or two arguments, depending on the error condition. The available system-defined error messages are: $SYSTEM.Status.Error($$$AccessDenied) Error message of Access Denied $SYSTEM.Status.Error($$$InvalidUsernameOrPassword) Error message of Invalid Username or Password $SYSTEM.Status.Error($$$UserNotAuthorizedOnSystem,Username) Error message of User Username is not authorized $SYSTEM.Status.Error($$$UserAccountIsDisabled,Username) Error message of User Username account is disabled $SYSTEM.Status.Error($$$UserInvalidUsernameOrPassword,Username) Error message of User Username invalid name or password $SYSTEM.Status.Error($$$UserLoginTimeout) Error message of Login timeout $SYSTEM.Status.Error($$$UserCTRLC) Error message of Login aborted $SYSTEM.Status.Error($$$UserDoesNotExist,Username) Error message of User Username does not exist $SYSTEM.Status.Error($$$UserInvalid,Username) Error message of Username Username is invalid $SYSTEM.Status.Error($$$PasswordChangeRequired) Error message of Password change required $SYSTEM.Status.Error($$$UserAccountIsExpired,Username) Error message of User Username account has expired $SYSTEM.Status.Error($$$UserAccountIsInactive,Username) Error message of User Username account is inactive $SYSTEM.Status.Error($$$UserInvalidPassword) Error message of Invalid password $SYSTEM.Status.Error($$$ServiceDisabled,ServiceName) Error message of Logins for Service Servicename are disabled $SYSTEM.Status.Error($$$ServiceLoginsDisabled) Error message of Logins are disabled $SYSTEM.Status.Error($$$ServiceNotAuthorized,ServiceName) Error message of User not authorized for service
To generate a custom message, use the $SYSTEM.Status.Error() method, passing it the $$$GeneralError macro and specifying any custom text as the second argument. For example:
$SYSTEM.Status.Error($$$GeneralError,"Any text here")
Note that when an error message is returned to the caller, it is logged in the audit database (if LoginFailure event auditing is turned on). However, the only error message the user sees is $SYSTEM.Status.Error($$$AccessDenied). However, the user also sees the message for the $$$PasswordChangeRequired error. Return this error if you want the user to change from the current to a new password.
To use delegated authentication with local connections, enable it for the service. Client/Server access
%Service_Bindings, %Service_CacheDirect,
To use delegated authentication with client/server connections, enable it for the service. CSP access
%Service_CSP
To use delegated authentication with web-based connections (through CSP or Zen), enable it for the web application, as well as for the service itself. Enabling it for the service allows the CSP Gateway itself to authenticate using delegated authentication.
where Username is a string specifying the user whose password is being changed. NewPassword is a string specifying the new value of the users password. OldPassword is a string specifying the old value of the users password. Status (passed by reference) receives a Cach status value indicating either that the password change has been successful or specifying the error that caused the routine to fail.
15
Using LDAP Authentication
Cach provides support for authentication using LDAP, the Lightweight Directory Access Protocol. LDAP systems have a central repository of user information, from which Cach retrieves information. For example, on Windows, a domain controller using Active Directory is an LDAP server. This means that an instance of Cach running on this type of Windows domain can use LDAP for its authentication. The procedure for configuring a Cach service or application to use an existing LDAP server for authentication is as follows: 1. 2. 3. On the LDAP Options page, configure Cach to use the LDAP server. This includes specifying the names of LDAP user properties to be used for setting the values of properties of Cach users. Configure the LDAP server to use the registered LDAP properties. Set up Cach to use LDAP. This involves enabling LDAP for the entire instance of Cach and then enabling it for the relevant services or applications.
When a user attempts to authenticate to an instance of Cach that uses LDAP authentication, the process is: 1. 2. The user is prompted for a username and password. This user, who is trying to authenticate, is known as the target user. Cach establishes a connection to the LDAP server using the values specified for the LDAP username to use for searches and LDAP username password. This user, who has privileges to search the LDAP database so that Cach can retrieve information, is known as the search user. Once the connection is established, the next step is to look up the user in the LDAP database using the LDAP Unique search attribute. If Cach locates the target user in the LDAP database, it retrieves the attributes associated with the user, including the roles to which the user belongs. Note that Cach retrieves all the attributes associated with the user; it is not possible to configure it to retrieve only a subset of these. Cach then attempts to authenticate the user to the LDAP database, using the username and password provided in step 1. If authentication succeeds, the user can then interact with Cach based on the privileges associated with the users roles and any publicly available resources. The users properties are displayed read-only in the Management Portal and are not editable from within Cach (since all the information is coming from outside Cach). If you have more complex authentication and authorization requirements, it is also possible to use delegated authentication to authenticate using the LDAP server. This requires that you use calls to the %SYS.LDAP class as part of the custom authentication code in the ZAUTHENTICATE routine. For sample code that performs these actions, see the LDAP.mac routine in the SAMPLES namespace. For more details about delegated authentication and the ZAUTHENTICATE routine, see the Delegated Authentication chapter.
3. 4.
5. 6.
Note:
Note:
Support for the use of LDAP over IPv6 is not available on OpenVMS.
All this information is specified on the Management Portal LDAP Options page ([System] > [Security Management] > [LDAP Options]). When this page is first displayed, only a single field is visible, the Enable LDAP authentication field. Checking this field displays all the fields for configuration information for connecting the Cach instance to the LDAP server. There are a standard set of fields and there can also be customized fields. When connecting to an LDAP server, Cach refers to various fields for its information; the end-user can do the same. The fields are:
Is the LDAP server a Windows Active Directory server
a Windows Active Directory server. Windows only. Specifies the name of the domain where the LDAP server is located. This field is only editable for a Windows Active Directory server.
LDAP domain name
Specifies the name(s) of the host(s) on which the LDAP server is running. The complexity of each host name can range from an unqualified host name to fully-qualified host name with a port number; the required form of the host name(s) depends on the particular configuration.
LDAP host names
To specify multiple host names, separate the names by spaces. If the LDAP server is configured to use a particular port, you can specify it by appending :portname to the host name; typical usage is not to specify a port and to let the LDAP functions use the default port, such as:
ldapserver.example.com ldapserver.example.com ldapbackup.example.com
LDAP username to use for searches Windows only. The username provided to the LDAP server to establish an initial
connection and which is used to perform LDAP searches and lookups. This user is also known as the search user. The search user must have permission to read the entire LDAP database. It is important to ensure that the search user has uninterrupted access to the LDAP database; for example, to establish this on Windows, set its User cannot change password and Password never expires attributes and set the value of its Account expires attribute to Never. For more information on searching the LDAP database, see the section Searching the LDAP Database.
LDAP DN user to use for searches UNIX and OpenVMS only. The Distinguished Name (DN) of the user provided
to the LDAP server to establish an initial connection and which is used to perform LDAP searches and lookups. This user is also known as the search user. The search user must have permission to read the entire LDAP database. It is also important to ensure that the search user has uninterrupted access to the LDAP database. For example, the users operating-system account should be set so that: The user cannot change the accounts password The password never expires The account never expires
For example, if the search user is ldapsearchuser, the Distinguished Name might be as follows:
uid=ldapsearchuser,ou=People,dc=example,dc=com
For more information on searching the LDAP database, see the section Searching the LDAP Database.
LDAP username password
Specifies the password associated with account used for the initial connection.
LDAP Base DN to use for searches Specifies the point in the directory tree from which searches begin. This typically
consists of domain components, such as DC=intersystems,DC=com. Specifies a unique identifying element of each record, which therefore makes it appropriate for searches. For more information on searching the LDAP database, see the section Searching the LDAP Database.
LDAP Unique search attribute
Specifies whether or not to use TLS/SSL encryption to protect data being passed between the Cach server and the LDAP server.
Use TLS/SSL encryption for LDAP sessions
UNIX and OpenVMS only. Specifies the location of the file containing any TLS/SSL certificates (in PEM format) being used to authenticate the server certificate, if needed. For Windows, see Specifying a Certificate File on Windows.
TLS/SSL certificate file User attribute to retrieve comment attribute Specifies the attribute whose value is the source for the Comment property
for a user. This property is described in the section Properties of Users, in the Users chapter.
User attribute to retrieve full name from Specifies the attribute whose value is the source for the Full name property
for a user. This property is described in the section Properties of Users, in the Users chapter.
User attribute to retrieve default namespace Specifies the attribute whose value is the source for the Startup namespace
property for a user. This property of a Cach user is described in the section Properties of Users, in the Users chapter; this LDAP property is described in the section Registered LDAP Properties.
User attribute to retrieve default routine Specifies the attribute whose value is the source for the Tag^Routine property
for a user. This property of a Cach user is described in the section Properties of Users, in the Users chapter; this LDAP property is described in the section Registered LDAP Properties. Specifies the attribute whose value determines the roles to which a user is assigned. When creating this attribute, it must be specified as an LDAP multivalued attribute. For information about a Cach users roles, see the Roles tab of a users Edit User page; this LDAP property is described in the section Registered LDAP Properties.
User attribute to retrieve roles
Specifies any attributes whose values are the source for any applicationspecific variables. Application code can then use the Get method of the Security.Users class to return this information.
LDAP attributes to retrieve for each user
When looking up a user with the LDAP Unique search attribute, the form of the username depends on the operating system of both the Cach instance and the LDAP server: When connecting from Windows to Windows, it can simply be login name of the user, such as testuser . For any other type of connection, it must include the full DN (distinguished name) of the user. When connecting from UNIX or OpenVMS to a Windows LDAP server, this is case-sensitive. For example: When connecting from UNIX or OpenVMS to Windows, it might be CN=testuser,OU=Users,OU=Cambridge. When connecting from any operating system to UNIX or OpenVMS, it might be uid=testuser,ou=people.
To use these attributes, the procedure on the LDAP server is: 1. Enable the attributes for use. To do this, modify the value of objectClass field in the LDAP schema by appending the intersystemsAccount value to its list of values. (intersystemsAccount has an LDAP OID of 1.2.840.113556.1.8000.2448.1.1.) Add the fields (as few or as many as required) to the schema. Populate their values for the entries in the LDAP database. It is not required to use the registered LDAP schema names. In fact, you may already use existing attributes from your LDAP schema.
2. 3.
Note:
For example, with a UNIX LDAP server, to define the schema for using LDAP authentication with Cach, use the content that appears the following definitions:
# Attribute Type Definitions attributetype ( 1.2.840.113556.1.8000.2448.2.1 NAME 'intersystems-Namespace' DESC 'InterSystems Namespace' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE ) attributetype ( 1.2.840.113556.1.8000.2448.2.2 NAME 'intersystems-Routine' DESC 'InterSystems Routine' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE ) attributetype ( 1.2.840.113556.1.8000.2448.2.3 NAME 'intersystems-Roles' DESC 'InterSystems Roles' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) # Object Class Definitions objectclass ( 1.2.840.113556.1.8000.2448.1.1 NAME 'intersystemsAccount' SUP top AUXILIARY DESC 'Abstraction of an account with InterSystems attributes' MAY ( intersystems-Routine $ intersystems-Namespace $ intersystems-Roles ) )
This content goes to two locations: Place it in the intersystems.schema file in the /etc/openldap/schema/ directory. Include it, along with any other content, in the /etc/openldap/slapd.conf file.
c.
With LDAP authentication enabled for the instance, an LDAP check box appears on the Edit Service page for relevant services and the Edit Web Application page for those applications. 2. Enable LDAP authentication for services and applications, as appropriate.
To use LDAP authentication with local connections, enable it for the service.
Client/Server access
%Service_Bindings, %Service_CacheDirect,
To use LDAP authentication with client/server connections, enable it for the service. Web access
%Service_CSP
To use LDAP authentication with web connections (through CSP or Zen), enable it for the web application. Enabling it for the service also allows the CSP Gateway itself to authenticate using LDAP authentication.
16
Using Delegated Authorization
Cach supports the use of user-defined authorization code. This is known as delegated authorization. Topics in this chapter include: Overview of Delegated Authorization Creating Delegated (User-Defined) Authorization Code Configuring an Instance to Use Delegated Authorization After Authorization The State of the System
Note:
Working from the ZAUTHORIZE.int Template ZAUTHORIZE Signature Authorization Code with ZAUTHORIZE ZAUTHORIZE Return Value and Error Messages
CAUTION:
where: ServiceName A string specifying the name of the service through which the user is connecting to Cach, such as %Service_Console or %Service_CSP. Namespace A string specifying the namespace on the Cach server to which a connection is being established. This is for use only with %Service_Bindings, such as connections for Studio or ODBC; for any other service, the value should be "" (the empty quoted string). Username A string specifying the user whose privileges are being determined.
Password A string specifying the password associated with account in use. This is for use only with the Kerberos K5API authentication mechanism; for any other mechanism, the value should be "" (the empty quoted string). Credentials Passed by reference. Not implemented in this version of Cach. Properties Passed by reference. An array of returned values that specifies characteristics of the account named by Username. For more information, see ZAUTHORIZE and User Properties.
CAUTION:
Because Cach does not and cannot place any constraints on the authorization code in ZAUTHORIZE, the application programmer is responsible for ensuring that this code is sufficiently secure.
Each of these elements is described in more detail in one of the following sections. Note: It is not possible to manipulate the value of any member of the Properties array after authorization.
Comment
If ZAUTHORIZE returns a value for Properties("Comment"), then that string becomes the value of the user accounts Comment property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Comment for the user account is a null string and the relevant field in the Management Portal holds no content.
FullName
If ZAUTHORIZE returns a value for Properties("FullName"), then that string becomes the value of the user accounts Full name property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Full name for the user account is a null string and the relevant field in the Management Portal holds no content.
NameSpace
If ZAUTHORIZE sets the value of Properties("Namespace"), then that string becomes the value of the user accounts Startup Namespace property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Startup Namespace for the user account is a null string and the relevant field in the Management Portal holds no content. Once connected to Cach, the value of Startup Namespace as specified by the value of Properties("Namespace") determines the initial namespace for any user authenticated for local access (such as for Console, Terminal, or Telnet). If Startup Namespace has no value, then the initial namespace for any user authenticated for local access is determined as follows: 1. 2. If the USER namespace exists, that is the initial namespace. If the USER namespace does not exist, the initial namespace is the %SYS namespace. If the user does not have the appropriate privileges for the initial namespace, access is denied.
Note:
Password
If ZAUTHORIZE sets the value of Properties("Password"), then that string becomes the value of the user accounts Password property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Password for the user account is a null string and the relevant field in the Management Portal then holds no content. If ZAUTHORIZE returns a password, this allows the user to log into the system via Password authentication if it is enabled. This is a possible mechanism to help migrate from delegated authentication to Password authentication, though with the usual cautions associated with the use of multiple authentication mechanisms; see Cascading Authentication in the Authentication chapter for more details.
Roles
If ZAUTHORIZE sets the value of Properties("Roles"), then that string specifies the Roles to which a user is assigned; this value is a string containing a comma-delimited list of roles. If no value is passed back to the calling routine, then there are no roles associated with the user account and the Management Portal indicates this. Information about a users roles is available on the Roles tab of a users Edit User page and a users profile. If any roles returned in Properties("Roles") are not defined, then the user is not assigned to the role. Hence, the logged-in user is assigned to roles as follows: If a role is listed in Properties("Roles") and is defined by the Cach instance, then the user is assigned to the role. If a role is listed in Properties("Roles") and is not defined by the Cach instance, then the user is not assigned to the role. A user is always assigned to those roles associated with the _PUBLIC user. A user also has access to all public resources. For information on the _PUBLIC user, see the section The _PUBLIC Account in the Users chapter; for information on public resources, see the section Services and Their Resources in the Resources chapter.
Routine
If ZAUTHORIZE sets the value of Properties("Routine"), then that string becomes the value of the user accounts Startup Tag^Routine property in Cach. (This property is described in the section Properties of Users, in the Users chapter.) If no value is passed back to the calling routine, then the value of Startup Tag^Routine for the user account is a null string and the relevant field in the Management Portal then holds no content. If Properties("Routine") has a value, then this value specifies the routine to execute automatically following login on a terminal-type service (such as Console, Terminal, or Telnet). If Properties("Routine") has no value or a value of "", then login starts the Cach Terminal session in programmer mode, subject to whether they have the privilege to access programmer mode or not.
Username
If ZAUTHORIZE sets the value of Properties("Username"), then that string becomes the value of the user accounts Name property in Cach. (This property is described in the section Properties of Users , in the Users chapter.) This provides the application programmer with an opportunity to normalize content provided by the end-user at the login prompt (while ensuring that the normalized username only differ by case). If there is no explicit call that passes the value of Properties("Username") back to the calling routine, then there is no normalization and the value entered by the end-user at the prompt serves as the value of the user accounts Name property without any modification.
ZAUTHORIZE can return system-defined or application-specific error messages. All these messages use the Error method of the %SYSTEM.Status class. This method is invoked as $SYSTEM.Status.Error and takes one or two arguments, depending on the error condition. The available system-defined error messages are: $SYSTEM.Status.Error($$$AccessDenied) Error message of Access Denied $SYSTEM.Status.Error($$$InvalidUsernameOrPassword) Error message of Invalid Username or Password $SYSTEM.Status.Error($$$UserNotAuthorizedOnSystem,Username) Error message of User username is not authorized $SYSTEM.Status.Error($$$UserAccountIsDisabled,Username) Error message of User username account is disabled $SYSTEM.Status.Error($$$UserInvalidUsernameOrPassword,Username) Error message of User username invalid name or password $SYSTEM.Status.Error($$$UserLoginTimeout) Error message of Login timeout $SYSTEM.Status.Error($$$UserCTRLC) Error message of Login aborted $SYSTEM.Status.Error($$$UserDoesNotExist,Username) Error message of User username does not exist
$SYSTEM.Status.Error($$$UserInvalid,Username) Error message of Username username is invalid $SYSTEM.Status.Error($$$PasswordChangeRequired) Error message of Password change required $SYSTEM.Status.Error($$$UserAccountIsExpired,Username) Error message of User username account has expired $SYSTEM.Status.Error($$$UserAccountIsInactive,Username) Error message of User username account is inactive $SYSTEM.Status.Error($$$UserInvalidPassword) Error message of Invalid password $SYSTEM.Status.Error($$$ServiceDisabled,ServiceName) Error message of Logins for Service username are disabled $SYSTEM.Status.Error($$$ServiceLoginsDisabled) Error message of Logins are disabled $SYSTEM.Status.Error($$$ServiceNotAuthorized,ServiceName) Error message of User not authorized for service
To use these error codes, uncomment the #Include %occErrors statement that appears in ZAUTHORIZE.int. To generate a custom message, use the $SYSTEM.Status.Error() method, passing it the $$$GeneralError macro and specifying any custom text as the second argument. For example:
$SYSTEM.Status.Error($$$GeneralError,"Any text here")
Note that when an error message is returned to the caller, it is logged in the audit database (if LoginFailure event auditing is turned on). However, the only error message the user sees is $SYSTEM.Status.Error($$$AccessDenied). However, the user also sees the message for the $$$PasswordChangeRequired error. Return this error if you want the user to change from the current to a new password.
3.
Selecting either of these choices causes Cach to invoke the ZAUTHORIZE.mac routine, if one exists, in the %SYS namespace. Important: Cach only calls ZAUTHORIZE after user authentication.
Whether for a first-time user or not, the process that logs in has the value of the $ROLES system variable set to the value of Properties("Roles"). For a terminal login, the namespace is set to the value of Properties("NameSpace") and the startup routine is set to the value of Properties("Routine").
A
Tightening Security for a Cach Instance
To provide increased security for a Cach instance, you can configure it to more tightly constrain user access. This can prevent unauthorized users from using Cach tools or from gaining access to sensitive resources. This appendix describes various actions that reduce the attack surface of a Cach instance or otherwise increase its security. There are multiple actions for tightening an instances security. They are presented here roughly in the sequence in which they should be performed: Enabling auditing Changing the authentication mechanism for an application Limiting the number of public resources Restricting access to services. This involves: Limiting the number of enabled services Limiting the number of public services Restricting access to services by IP address or machine name
Restricting public privileges Limiting the number of privileged users Disabling the _SYSTEM user Restricting access for UnknownUser
The Cach Security Advisor also provides an automated analysis of the instance and recommendations for actions to increase the security of an instance. Important: A Cach instance has many interdependent elements. Because of this, it is recommended that you only do what is specified for a change, and not more or less. For example, simply removing UnknownUser from the %All role without doing anything else will cause problems for a minimal-security installation.
The knowledge of its existence can be a deterrent for an attacker, given that the attack will be tracked and there will be evidence of any malicious actions.
To enable auditing for key events for a Cach instance, the procedure is: 1. 2. 3. From the Management Portal home page, select System Administration >> Security >> Auditing >> Enable Auditing. If the choice is not available, auditing is already enabled. From the Management Portal home page, go to Configure System Events page ([System] > [Security Management] > [Configure System Audit Events]. On the Configure System Events page, enable the following events if they are not already enabled by clicking Change Status in the events row: %System/%DirectMode/DirectMode Provides information on console/terminal use. For sites that extensively use command-line utilities, can create large amounts of data. Recommended if increased data is not an issue. %System/%Login/Login Provides information on logins. For large sites, can create large amounts of data. Recommended if increased data is not an issue. %System/%Login/LoginFailure Provides feedback on possible attempted unauthorized logins. Recommended. %System/%Security/Protect Provides data on attempts to read, write, or use protected data. Recommended.
To provide properly functioning authentication for an application, there must be consistent authentication mechanisms for both the application and any service that it uses. For a web application, the CSP Gateway must also be configured to match the CSP service. Hence, to provide authentication for the Management Portal, there are three layers that all need to work together: The %Service_CSP service The CSP Gateway The Management Portal application
If these layers do not have matching authentication mechanisms, this usually results in a denial of access for example, there may be a This page cannot be displayed error instead of a login page or access to the Management Portal.
Important:
If (1) a web application uses a more powerful authentication mechanism than the CSP Gateway and %Service_CSP and (2) authentication succeeds, then the systems security is only that of the less powerful mechanism.
For an instance with a minimal-security installation, the CSP Gateway, %Service_CSP, and the Management Portal application are all set up for unauthenticated access. To provide password-level authentication for the Portal, various Cach elements must be configured as follows: The CSP service must require password authentication. The CSP Gateway must provide a username and password for that authentication. The user representing the Gateway must have sufficient privilege to use the CSP service. The Management Portal must require password authentication. All the Portals users must have sufficient privilege to use the Portal. Complete the following set of procedures during a single session in the Portal. Otherwise, you may lock yourself out of the Portal and have to perform the remaining procedures through the ^SECURITY routine.
Important:
An overview of the procedure to make these changes is: 1. 2. 3. 4. 5. 6. 7. 8. 9. Optionally, turn on auditing to track the changes to the instance. This is described in the Enabling Auditing section of this appendix. Give the %Service_CSP:Use privilege to the CSPSystem user. Change the password of the CSPSystem user. Configure the CSP Gateway to provide a username and password for authentication. Configure %Service_CSP to require password authentication. Remove the public status of the %Service_CSP:Use privilege. Configure the Management Portal application to require password authentication only. Specifying the appropriate privilege level for the instances users. Optionally, make the documentation or samples available.
10. Begin enforcement of the new policies. Once this process is complete, then a users next attempt to connect to the Portal will result in a login prompt.
CAUTION:
A Cach instance has many interdependent elements. Because of this, it is recommended that you only do what is specified for a change, and not more or less. Otherwise, you may lock yourself out of Cach or could even render the instance temporarily inoperative.
To associate the %Service_CSP:Use privilege with the CSPSystem user, the procedure is: 1. 2. 3. 4. 5. 6. 7. 8. 9. From the Management Portal home page, go to the Roles page ([System] > [Security Management] > [Roles]). On the Roles page, click Create New Role. This displays the Edit Role page, where the Name field is editable. Enter a name for the role to include the %Service_CSP:Use privilege (such as GatewayRole). Click Save. Cach has now created the role. In the Privileges section on the General tab of the Edit Role page, click Add, which displays a list of available resources for the role. From this list, click %Service_CSP and then click Save. The newly created role now includes the %Service_CSP:Use privilege. Select the Members tab of the Edit Role page. On this tab, you can assign the CSPSystem user to the newly created role. Click CSPSystem from the users in the Available list and move it to the Selected by clicking the right arrow. Click Assign to assign CSPSystem to the role. (In other words, CSPSystem is now a member of the role.) This means that CSPSystem holds the %Service_CSP:Use privilege. Cach creates the CSPSystem user to represent the CSP Gateway. If you prefer, a different user can perform this function. This procedure refers only to the CSPSystem user; if you use a different user, replace CSPSystem with that username where relevant.
Note:
If you wish, you can also confirm that CSPSystem is assigned to the role created for authentication in the previous procedure. To do this, click on the Roles tab. The table with the column heading CSPSystem is Assigned to the Following Roles should list the newly-created role.
3. 4. 5. 6. 7. 8. 9.
In the Server Access frame, the LOCAL server should be highlighted. Click Submit to edit it, which displays a page with Server Access and Error Pages parameters. On this page, there is a Connection Security section. Ensure that the Connection Security Level drop-down has Password displayed. In the User Name field, enter CSPSystem. In the Password and Password (Confirm) field, enter the password that you selected in the previous section. Click Save Configuration near the bottom of the page. To return to the Management Portal, click Back to Management Portal from the bottom of the list in the left pane.
Important:
3. 4.
Under Allowed Authentication Methods, disable Unauthenticated access and enable Password access. Click Save. Also disable Unauthenticated access and enable Password access for all the applications that compose the other pages and choices of the Portal. These applications are: /csp/sys/bi /csp/sys/exp /csp/sys/mgr /csp/sys/op /csp/sys/sec
This configures the Portal to require password authentication (also known as Cach login) and not to allow unauthenticated access, and so that all its parts behave consistently. The next step is to ensure that all relevant users have appropriate access to the Portal.
A.2.7 Specifying the Appropriate Privilege Level for the Instances Users
When the Portal is configured to accept unauthenticated connections, any user can connect as the UnknownUser. Because a minimal-security installation makes UnknownUser a member of the %All role, there is no danger of being locked out of the Portal. Now that the Portal requires password authentication, its legitimate users need to be members of the %Operator role, the %Manager role, or the %All role. In a minimal-security installation, SuperUser, Admin, _SYSTEM, and UnknownUser all have this level of privilege; further, these all have passwords of SYS. To properly secure users, the procedure is: 1. Either disable UnknownUser or remove UnknownUser from the %All role. To disable UnknownUser, the procedure is: a. b. On the Users page ([System] > [Security Management] > [Users]), click Edit in the UnknownUser row. This displays the Edit User page for UnknownUser. Clear the User Enabled field and click Save.
To remove UnknownUser from the %All role: a. b. c. On the Users page ([System] > [Security Management] > [Users]), click Edit in the UnknownUser row. This displays the Edit User page for UnknownUser. Go to the Roles tab on the Edit Page. In the UnknownUser is Assigned to the Following Roles table, on the %All row, click the UnknownUser from %All. Click OK in the confirmation dialog. Limiting access through UnknownUser can have widespread effects, particularly if an instances users are not sufficiently privileged. button to remove
d.
Important:
2.
Ensure that any other potentially unauthorized users are not members of %All, %Developer, %Manager, %Operator, %SQL, or any user-defined role that grants privileges. This involves a process analogous to removing UnknownUser from the %All role.
(A user-defined role that grants privileges might have Use permission on any of the %Admin... resources, %Development, or any of the %Service or %System resources, or Write permission on %DB_CACHELIB or %DB_CACHESYS.) 3. Ensure that any user who should have access to the Portal is assigned to %All, %Developer, %Manager, %Operator, %SQL, or any user-defined role that grants Portal access. The procedure, for each of these users, is: a. b. c. On the Users page ([System] > [Security Management] > [Users]), click Edit in the users row. This displays the Edit User page for the user being edited. Go to the Roles tab on the Edit Page. Move the desired role(s) from the Available to the Selected list by clicking the right arrow and then click Assign to assign the user to the role(s).
4.
Change the passwords for SuperUser and Admin users from the default. To do this: a. b. c. On the Users page ([System] > [Security Management] > [Users]), click Edit in the users row. This displays the Edit User page for the user being edited. Enter the new password in the Password field. Confirm it in the Confirm Password field and click Save. Make sure that you know the password for at least one user who administers the Portal. Otherwise, you may lock yourself out of the Portal and have to log in using emergency access so that you can reset one or more passwords using the ^SECURITY routine.
Important:
To make the documentation available: a. On the Web Applications page, the /csp/docbook application represents the Cach DocBook documentation application. Select Edit in this row to edit the application. This displays the Edit Web Application page for the /csp/docbook application. Under Allowed Authentication Methods, disable Unauthenticated access and enable Password access. Click Save. Return to the Web Applications page. On the Web Applications page, the /csp/documatic application represents the Cach Documentation class reference application. Select Edit in this row to edit the application. This displays the Edit Web Application page for the /csp/documatic application. Under Allowed Authentication Methods, disable Unauthenticated access and enable Password access. Click Save.
b. c. d.
e.
Note:
Because the documentation is compose of two individual applications /csp/docbook and /csp/documatic that are separate from each other and from the Portal, each has a separate password prompt.
If you do not perform this procedure, the service requires a password prompt but the application attempts to use unauthenticated access. This prevents all users including those assigned to %All from reaching the documentation or samples.
The next time that a user requests a page, the Gateway will reestablish a connection to the Cach server. This connection will use the selected authentication mechanism.
Note:
Permission R R RW
Note:
You may also want to make the Read permission on the %DB_DOCBOOK database public, so that all users have access to the documentation.
To tighten the security of an instance, limit the number of public resources. To do this, the procedure is: 1. Ensure that all users who genuinely require access to these resources have been given privileges for them. Important: If you do not provide privileges for %Service_CSP:Use to the appropriate users, then this procedure can result in a widespread lockout from the Management Portal and other CSP applications.
2. 3.
From the Management Portal home page, go to the Resources page ([System] > [Security Management] > [Resources]). On the Resources page, each resource for which there is one or more public permissions has those permissions listed in the Public Permissions column of the table of resources. Select the resource by clicking Edit. This displays the resources Edit Resource page. On the Edit Resource page, clear any checked Public Permission fields and click Save. The resource is no longer public.
4.
2.
From the Management Portal home page, go to the Services page ([System] > [Security Management] > [Services]).
3. 4.
On the Services page, for each service that is not required, select the service by clicking on its name. This displays the services Edit Service page. On the Edit Service page, clear the Service Enabled field and click Save. The service is now disabled.
Once you have disabled all unnecessary services, the only pathways to Cach are the required services.
By default, a service accepts connections from all machines. If a service has no associated addresses or machine names, then it accepts connections from any machine. If one or more addresses or machine names are specified from which a service accepts connections, then the service only accepts connections from these machines. This feature is not available for %Service_CallIn, %Service_ComPort, %Service_Console, %Service_DataCheck, %Service_Login, %Service_MSMActivate, %Service_Mirror, %Service_Telnet, and %Service_Terminal. To restrict access to a service by IP address, the procedure is: 1. 2. 3. 4. 5. 6. Determine the IP addresses of those machines with legitimate access to the service. From the Management Portal home page, go to the Services page ([System] > [Security Management] > [Services]). On the Services page, for each service for which you are restricting access by IP address, select the service by clicking on its name. This displays the services Edit Service page. On the Edit Service page, in the Allowed Incoming Connections section, click Add. In the displayed dialog, enter an IP address for an allowed incoming connection. Click OK. Click Add and enter other addresses as needed.
Perform this procedure for each service that is restricting the IP addresses from which it accepts connections.
2. 3.
From the Management Portal home page, go to the Execute SQL Query page ([System] > [SQL] > [Execute SQL Query]) for the SAMPLES namespace. (On the Execute SQL Query page, from the list of namespaces on the left, click SAMPLES.) Revoke all the _PUBLIC users privileges on tables in the SAMPLES database. In the pages editing form, enter the following SQL command:
REVOKE ALL PRIVILEGES ON * FROM _PUBLIC
and click Execute Query. 4. Revoke all the _PUBLIC users privileges to invoke stored procedures in the SAMPLES database. In the pages editing form, enter the following SQL command:
REVOKE EXECUTE ON * FROM _PUBLIC
and click Execute Query. 5. To prevent general use of the InterSystems documentation, you can revoke the _PUBLIC users privileges to search the DocBook database. To do this: a. b. c. On the Execute SQL Query page, click DOCBOOK from the list of namespaces. Select the SQL Tables tab. In the pages editing form, enter by the following SQL command:
REVOKE ALL PRIVILEGES ON * FROM _PUBLIC
end up having more users assigned to %All than are necessary. This can arise from assigned users leaving an organization but their accounts not being disabled, from temporary assignments not being revoked, and so on. Along with the %All role, the system-defined roles of %Manager, %Developer, %Operator, and %SQL can give users undue privilege. There also may be user-defined roles that do this. Users assigned to such roles are sometimes known as privileged users. To limit the number of privileged users, determine which users are assigned to each privileged role and remove those who are not needed. The procedure is: 1. 2. 3. 4. From the Management Portal home page, go to the Roles page ([System] > [Security Management] > [Roles]). On the Roles page, click Edit on the row for the relevant role. This displays the Edit Role page for that role. On the Edit Role page, click the Members tab, which displays a list of the users and roles assigned to the role. To remove any user from the specified role, click Remove on the row for the user or role to be removed. Click OK in the confirmation dialog.
Perform this procedure for each privileged role, including %All and the others listed previously. It is also important to disable the _SYSTEM user; the procedure for this is described in the next section, Disabling the _SYSTEM User. Important: Certain seemingly non-privileged roles may have what could be called privileges by proxy. This occurs when a seemingly non-privileged role is assigned to a privileged role. In this case, any user who is assigned to role with privileges by proxy holds all the privileges associated with the privileged role. Avoid creating privileges by proxy whenever possible. When not possible, have as few users as possible assigned to the roles with privileges by proxy.
Note:
All connections use UnknownUser. UnknownUser is assigned to the %All role. UnknownUser holds all SQL privileges.
The most effective way to restrict access for UnknownUser is to disable that account. However, with a minimal-security installation, simply shutting down this account causes a lockout from the Management Portal, as described in the following section. Therefore, you should only disable UnknownUser as part of the procedure for changing the authentication mechanism for the Management Portal. Note: With normal-security and locked-down installations, UnknownUser holds no privileges, so this is not an issue.
A.8.1 Potential Lockout Issue with the UnknownUser Account When Increasing Security
If an instance has been installed with Minimal security, UnknownUser has the %All role; the instance also has unauthenticated access available for all services and applications. If you simply change the users role (from %All to something else) and still allow unauthenticated access, you may be denied access to the Management Portal, the Cach Terminal, and other basic features. This is because, under these conditions, Cach establishes a connection to the selected tool without performing authentication. When there is no authentication, Cach automatically sets the user account to UnknownUser. The next step is to check user privileges. If UnknownUser has insufficient privileges, access to the tool is limited or not available. For example, under these circumstances, the Terminal displays an Access Denied message and then shuts down; the Portal displays its main page, but no options can be selected. To correct this condition: 1. 2. Start Cach in emergency access mode. Restore sufficient privileges to the UnknownUser account.
If you wish to prevent use of UnknownUser, you must upgrade the authentication mechanism for the Management Portal.
B
Using the cvencrypt Utility
Cach allows you to use encrypted databases, as described in the chapter Managed Key Encryption. There are occasions when you may need to perform encryption management operations on a database, such as: Converting an Unencrypted Database to Be Encrypted Converting an Encrypted Database to Be Unencrypted Converting an Encrypted Database to Use a New Key Using Command-line Options with cvencrypt Using cvencrypt in Batch Mode on OpenVMS
To perform these operations, Cach supplies cvencrypt, a standalone utility for use with 8-KB format databases. Its available operations are described in the following sections.
CAUTION:
It is critical that you back up the database before encrypting it. Failure to do so can result in data being lost.
2. 3. 4.
Have an existing database-encryption key for your Cach instance. If the database is mounted, dismount it. You can do this from the Management Portal Databases page ([System] > [Databases]). In the directory containing the cache.dat file for the database to encrypt, run the cvencrypt utility, providing a path to it. For example, if your database is in the C:\MyDBs directory and is called test1 and Cach is installed in the C:\CacheSys directory, then you would run the utility as follows:
C:\MyDBs\test1>..\..\CacheSys\bin\cvencrypt cache.dat
The utility then provides an informational display message about itself, and then information on the database passed to it. If this is a multivolume database, the utility displays information about this, such as
Database has multiple volumes. Volume ====== c:\mydbs\accounting1\CACHE.DAT c:\mydbs\accounting2\CACHE.EXT c:\mydbs\accounting3\CACHE.EXT Blocks: first ===== 1 129 257 last ==== 128 256 1792
5.
The utility then prompts for what action you wish to take:
1) Encrypt 2) Quit
To encrypt the database, enter 1 and press Enter. 6. This displays a prompt to activate an already-existing encryption key:
Access database encryption key. Keyfile:
At this prompt, enter the full path of the key for encrypting the database. For example, suppose that you have stored the database-encryption keyfile, dek1, in the C:\CacheSys\Mgr directory.
Keyfile: C:\CacheSys\Mgr\dek1
7.
The utility then prompts for the username and password of a keyfile administrator:
Username: dek-admin1 Password: <characters shielded during entry>
When it receives these, the utility then reminds you that it modifies data in place, so that you should be sure that your data is adequately backed up before continuing:
This utility will modify your database in place. Be sure that your data is adequately backed up before proceeding. Continue? [Y/N]:
If you wish to continue, enter Y . it encrypts the database, stating the key that it is using for encryption:
Using database encryption key (ID = 5DBC532D-4D1F-A3A4-30CDA34BB66B).
During encryption, the utility displays a progress indicator, as well as a reminder not to interrupt the process.
CAUTION:
If you interrupt the process while it is incomplete, the database may be in a state in which some of its data is encrypted and some of it is unencrypted. It is impossible for Cach to read such a database, and all the data will be lost.
8.
CAUTION:
It is critical that you back up the database before decrypting it. Failure to do so can result in data being lost.
2. 3.
If the database is mounted, dismount it. You can do this from the Management Portal Databases page ([System] > [Databases]). In the directory containing the cache.dat file for the database to decrypt, run the cvencrypt utility, providing a path to it. For example, if your database is in the C:\MyDBs directory and is called test1 and Cach is installed in the C:\CacheSys directory, then you would run the utility as follows:
C:\MyDBs\test1>..\..\CacheSys\bin\cvencrypt cache.dat
The utility then provides an informational display message about itself, and then information on the database passed to it. If this is a multivolume database, the utility displays information about this, such as
Database has multiple volumes. Volume ====== c:\mydbs\accounting1\CACHE.DAT c:\mydbs\accounting2\CACHE.EXT c:\mydbs\accounting3\CACHE.EXT Blocks: first ===== 1 129 257 last ==== 128 256 1792
4.
5.
To decrypt the database, enter 1 and press Enter. This displays a prompt to activate the databases encryption key:
Access original database encryption key (key ID = E1D00BC2-07F4-4495-9562-394B26A2B05B) Keyfile:
Enter the keyfile including its full path, such as C:\encdb\dek; relative pathnames are not valid. 6. The utility then prompts for the username and password of a keyfile administrator:
Username: dek-admin1 Password: <characters shielded during entry>
7.
Before decrypting the data, the utility reminds you that it modifies data in place, so that you should be sure that your data is adequately backed up before continuing:
This utility will modify your database in place. Be sure that your data is adequately backed up before proceeding. Continue? [Y/N]:
If you wish to continue, enter Y . Once you confirm your decision, the utility decrypts the database. During decryption, the utility displays a progress indicator, as well as a reminder not to interrupt the process, such as:
Decrypting database (key ID = E1D00BC2-07F4-4495-9562-394B26A2B05B). Do not interrupt this process! Processed: 25000 blocks (16%)
CAUTION:
If you interrupt the process while it is incomplete, the database may be in a state in which some of its data is encrypted and some of it is unencrypted. It is impossible for Cach to read such a database, and all the data will be lost.
8.
When the process is complete, the progress indicator changes to a completion message:
Processed: 153600 blocks (done!)
CAUTION:
It is critical that you back up the database before decrypting it. Failure to do so can result in data being lost.
2. 3.
If the database is mounted, dismount it. You can do this from the Management Portal Databases page ([System] > [Databases]). Make sure that the key with which the database is being re-encrypted already exists. You can create this key using the Management Portal Database Encryption page ([System] > [Encryption] > [Database Encryption]); if there is already an activated key, you need to deactivate it before creating a new one. In the directory containing the cache.dat file for the database to decrypt, run the cvencrypt utility, providing a path to it. For example, if your database is in the C:\MyDBs directory and is called test1 and Cach is installed in the C:\CacheSys directory, then you would run the utility as follows:
C:\MyDBs\test1>..\..\CacheSys\bin\cvencrypt cache.dat
4.
When it first starts, the utility displays an information message about itself and the database passed to it. If this is a multivolume database, the utility displays information about this, such as
5.
The utility displays information about the encryption in use for the database:
Database is encrypted (Key ID = E1D00BC2-07F4-4495-9562-394B26A2B05B).
6.
To re-encrypt the database with a new database-encryption key, enter 2 and press Enter. To begin the process of re-encrypting the database, you must have access to the key in which the database is currently encrypted. The utility prompts for the absolute path for this keyfile, and, receiving that, the username of an administrator and that administrator's password:
Access original database encryption key. (key ID = E1D00BC2-07F4-4495-9562-394B26A2B05B) Keyfile: C:\encdb\dek1 Username: dek-admin1 Password: <characters shielded during entry>
7.
Once this information has been successfully entered, the utility prompts for the absolute path of the keyfile for reencrypting the database. Receiving that, it prompts for the username of an administrator and that administrator's password:
Access new database encryption key. Keyfile (full path): C:\encdb\dek2 Username: dek-admin2 Password: <characters shielded during entry>
When it receives information on this second key, the utility reminds you that it modifies data in place, so that you should be sure that your data is adequately backed up before continuing. If you wish to continue, enter Y . Once you confirm that you want to perform this process, the utility encrypts the database. During encryption, the utility displays a progress indicator, as well as a reminder not to interrupt the process, such as:
Do not interrupt this process! Processed: 16000 blocks (10%)
CAUTION:
If you interrupt the process while it is incomplete, the database may be in a state in which some of its data is encrypted with one key and some of it is encrypted with another. It is impossible for Cach to read such a database, and all the data will be lost.
8.
When the process is complete, the progress indicator changes to a completion message:
Processed: 153600 blocks (done!)
-inuser argument The administrator name to use (along with the -inpass password) to extract the database encryption key from the input key file. If you do not use the -inuser option with cvencrypt, it prompts you for a username. -outkeyfile argument The output key file, which contains the database key for encrypting the output from cvencrypt. When processing an unencrypted database, cvencrypt uses the output key file to encrypt it. When processing an encrypted database where there is a value for the -outkeyfile option but no value provided for the -inkeyfile option, cvencrypt
does nothing. When processing an encrypted database, if there are values for both the input and output key files, then cvencrypt uses the input key file to decrypt the database and the output key file to re-encrypt it; if the input and output key files hold the same database encryption key, cvencrypt does not run. -outpass argument The password to use (along with the -outuser administrator name) to extract the database encryption key from the output key file. If you do not use the -outpass option with cvencrypt, it prompts you for a password. Important: If you use the -outpass option, then this password may be visible to operating system tools as part of the data associated with the cvencrypt process. For example, on UNIX, the ps command displays the value of the -outpass password. If you have any concerns about exposing this information to those who should not have it, do not use the -outpass option; when you invoke cvencrypt, you will be prompted for the password, which will then not appear as part of the data associated with the process.
-outuser argument The administrator name to use (along with the -outpass password) to extract the database encryption key from the output key file. If you do not use the -outuser option with cvencrypt, it prompts you for a username.
To do this, the procedure is: 1. 2. Back up the database. For details on this process, see the Backup and Restore chapter of the Cach Data Integrity Guide. Add a temporary database encryption administrator to your database encryption key file. To do this with the Management Portal, follow the procedure described in the section Adding an Administrator to a Key File in the Managed Key Encryption chapter. You can also use the ^DATABASE utility, as described in the ^DATABASE section of the Using the Character-based Security Management Routines appendix. 3. Run cvencrypt interactively and answer "N" to the final "Continue? {Y/N}:" prompt. This captures the input that you wish to provide to cvencrypt but does not run it. The operating system displays a message such as:
A command procedure "cvencrypt.com" has been created that you can SUBMIT as a batch job.
4. 5.
Issue the OpenVMS SUBMIT command to run the command procedure as a batch job. Once the job is running, remove the temporary administrator from the key file (using either the Management Portal or ^DATABASE).
InterSystems recommends that you create a new command procedure for each batch job, as the input parameters may differ. Note: Batch mode is only available for OpenVMS. It is not supported for UNIX or Windows.
C
Frequently Asked Questions about Cach Security
Troubleshooting
When users attempt to use the Management Portal, they are either prompted to log in as they move among its sections or unexpectedly lack privileges on certain pages or are not allowed to perform certain operations. Why is this and how can I correct it? The Cach Management Portal consists of several separate web applications. The main page of the Portal is associated with the /csp/sys application and other pages are associated with various /csp/sys/* applications (such as the security-related content, which is associated with the /csp/sys/sec application). If the applications do not all have a common set of authentication mechanism(s) in use, users going from one Portal page to another may encounter login prompts or sudden shifts in their level of privilege. For example, if the /csp/sys application is using password authentication exclusively, while other related Portal applications are using unauthenticated access exclusively, then, as users move from one Portal page to another, they go from unauthenticated access to requiring authentication. Another possible case is this: the /csp/sys application supports only password authentication, the other applications support only unauthenticated access, and UnknownUser has no special privileges; in this case, when users go from the Portals main page to its other pages, they may not have sufficient privileges to perform any action. To check and configure the authentication mechanism for a web application, select the application from the Web Applications page in the Portal ([System] > [Security Management] > [Web Applications]) and, for the displayed application, make selections under Allowed Authentication Methods as appropriate (typically, so that /csp/sys and /csp/sys/* share a common set of authentication mechanisms).
Upgrading
These questions address questions for users of Cach 5.0 and previous versions who are considering the security implications of upgrading to Cach 5.1 or more recent versions. Must I use Cach security? What do I need to be aware of when upgrading to the Cach security in version 5.1 or later? What operational aspects of Cach security (5.1 or later) differ from previous versions of Cach?
Must I use Cach security? Yes. Security in Cach is always enabled. However, you can configure an instances security to mimic the openness of an older system and to support legacy systems without any visible effects. What do I need to be aware of when upgrading to the Cach security in version 5.1 or later? The following items require attention when upgrading: All users require new passwords assigned to them after an upgrade installation. The password hash function used is more robust than those used in earlier versions of Cach. Since Cach only stored (and stores) the hashed form of the password for comparison, there is no way to invert the hashed form (giving a plaintext password) and replace it with the hashed value using the newer function. As a result, to take advantage of this robustness, users need to enter new passwords. By default, developers do not have privileges on many of the Cach services they did under prior versions. The default installation of Cach is configured with a relatively limited set of features accessible by default. The predefined roles do not include privileges for legacy resources such as COM ports, which most customers do not need. As necessary, administrators can alter the predefined roles or create new roles that provide a different set of privileges to meet the needs of each site.
What operational aspects of Cach security (5.1 or later) differ from previous versions of Cach? An instance of Cach 5.1 or later operates slightly differently from prior versions of Cach. Differences include: As of Cach 5.1, Cach ObjectScript has two system variables, $USERNAME and $ROLES that help applications manage their security needs. Both these variables can be used programmatically in routines, methods, and SQL statements. For CSP and Zen applications, security information is maintained as part of the CSP session. The values of $USERNAME and $ROLES are preserved across page requests, even if different processes are used to execute those requests. More specifically, when processing begins for a CSP page, $ROLES contains the users roles as well as roles defined for the application. The session does not contain roles that were dynamically added during processing of a previous page by setting the value of $ROLES or invoking $SYSTEM.Security.AddRoles. This is true for both stateless sessions and those that maintain state.
D
Relevant Cryptographic Standards and RFCs
The following are standards and RFCs (requests for comment) that define the cryptographic primitives and algorithms used in Cach security: AES (Advanced Encryption Standard) encryption FIPS (Federal Information Processing Standards) 197 AES Key Wrap NIST (National Institute of Standards and Technology) document AES Key Wrap Specification (http://csrc.nist.gov/CryptoToolkit/kms/AES_key_wrap.pdf) IETF (Internet Engineering Task Force) RFC 3394
Base64 encoding RFC 3548 Block padding PKCS (Public-Key Cryptography Standards) #7 and RFC 2040 CBC (Cipher Block Chaining) cipher mode NIST 800-38A Deterministic random number generator FIPS PUB 140-2, Annex C FIPS PUB 186-2, Change Notice 1, Appendix 3.1 and Appendix 3.3
GSS (Generic Security Services) API The Kerberos Version 5 GSS-API Mechanism RFC 1964 Generic Security Service Application Program Interface, Version 2, Update 1 RFC 2743 Generic Security Service API Version 2: C Bindings RFC 2744 Generic Security Service API Version 2: Java Bindings RFC 2853
Kerberos Network Authentication Service (V5) RFC 1510 Hash-based Message Authentication Code (HMAC) FIPS 198 and RFC 2104 Message Digest 5 (MD5) hash RFC 1321 Password-Based Key Derivation Function 2 (PBKDF2) PKCS #5 v2.0 and RFC 2898 Secure Hash Algorithm (SHA-1) FIPS 180-2 and RFC 3174
All these documents are available online: FIPS documents NIST documents PKCS documents RFCs (IETF)
E
Using Character-based Security Management Routines
The preferred and recommended way to manage a Cach installation is the Management Portal. The portal provides a convenient, browser-based interface for controlling the system. However, to cover those instances when the system cannot be managed this way, Cach also has several character-based routines that collectively provide many of the same functions on the Cach Terminal. The utilities described in this appendix are: ^SECURITY addresses the setup and maintenance of the data essential to the proper functioning of Cach security. ^EncryptionKey supports operations for encryption key management, database encryption, and data element encryption. ^DATABASE is used to manage databases; it also allows you to set values related to Cach security. ^%AUDIT allows the reporting of data from the logs, and the manipulation of entries in the audit logs as well as the logs themselves.
Each of the routines is described in its own section along with its top-level functionality. In most cases, the initial menu choice will lead to further requests for information until the routine has sufficient information to accomplish its task. To use any routine from the Cach Terminal, the user must be in the %SYS namespace and have at least the %Manager role. The routine, for example ^SECURITY, is invoked as expected with the command:
DO ^SECURITY
When the routine runs, it presents you with a list of options. Select an option by entering its number after the Option? prompt.
CAUTION:
As previously noted, the preferred way to manage a Cach system is via the Management Portal. Administrators who elect to use the routines described in this documents are assumed to have a detailed operating knowledge of how Cach works and what parameter values are appropriate for the options they choose.
that section and you are presented with the next upper level of options. An Enter reply to the top-level of options exits the ^SECURITY routine. Many of the prompts for information have a default value which is selected by typing the Enter key. When there is a default value available, it is shown after the prompt message and followed by the characters => as in
Unsuccessful login attempts before locking user? 5 =>
where the default value is 5 for the number of times a user may try to login and fail before the system locks their username. Prompts whose defaults are Yes or No also accept any matching partial response such as yE or n. The match is done ignoring the case of the response. In options whose intent is to alter the characteristics of existing user, roles, services, and so on, the existing value of the item is displayed as the default. Typing Enter preserves that value and moves on to the next prompt. Some prompts ask for a pattern to use when matching items such as user names. The default pattern is usually * that matches all items. In such patterns the asterisk matches any sequence of characters, much like it does in DOS. A pattern may also consist of a comma-separated list of items each of which is treated as its own pattern. An item is treated as being selected if it matches any pattern in the list. There is nothing to prevent multiple instances of the same routine from being executed at the same time by different system administrators (or even the same administrator). If this happens, it is the responsibility of the administrators to coordinate their activity to avoid conflicts and achieve their objectives with regard to the coherence of the affected data.
CAUTION:
E.1 ^SECURITY
This routine addresses the setup and maintenance of the data essential to the proper functioning of Cach security. The initial menu includes: 1. User setup Users represent actual people or other entities who are permitted access to the system. This is the section for define the characteristics of users for the instance. 2. Role setup Cach users are given permission to perform an action by their assignment to one or more roles. This section is where the characteristics of roles are defined. 3. Service setup Services control the ability to connect to Cach using various connection technologies. They are predefined by InterSystems. The parameters governing their use are set through this option. 4. Resource setup Resources represent assets, such as databases or applications, whose use is to be managed. A resource may represent a single asset such as a database, or it may protect multiple (usually related) assets such as a suite of applications. 5. Application setup Application definitions serve as proxies for the actual application code. Permissions on the definition are interpreted by the security system as granting the same permission on the application associated with the definition. 6. Auditing setup
^EncryptionKey
Auditing is the means by which Cach keeps a record of security-related events. This section deals with the definition and management of events whose occurrence is to be noted in the audit log. 7. Domain setup Domains permit a community of users to be partitioned into several groups. This option allows an administrator to set up Cach security to accept users from multiple domains. The domains defined via this option exist only within the Cach system for the purpose of recognizing valid users. When multiple domains have been defined, usernames should include the domains they will be attempting access from, for example, [email protected]. If a users name is given without the domain identification, Cach uses the default domain (if any) set up in the system parameters section. 8. SSL configuration setup SSL/TLS provides authentication and other functionality. This section provides configuration tools if the instance uses Cach support for the SSL/TLS protocol. 9. Mobile phone service provider setup With two-factor authentication, authenticating users receive a one-time security code on their mobile phone that they then enter at a prompt. This section provides the tools for configuring the mobile phone service providers in use for the Cach instance. 10. OpenAM Identity Services setup OpenAM identify services allow Cach to support single-sign on (SSO); by using this feature, users that have already successfully authenticated do not have to re-authenticate. This section deals with managing OpenAM identity services for the Cach instance. 11. Encryption key setup Cach uses keys to encrypt databases or user-specified data elements. This section provides tools for working with keys for both database and managed encryption. 12. System parameter setup The system parameters are a collection of security-related values that apply system-wide. This section includes the ability to export and import all an instances security settings, including those for SQL privileges. Note: If you are importing security settings from a source instance configured with multiple domains to a target instance not configured to allow multiple domains and the source instances default domain differs from that of the target instance, then the import does not update the targets default domain you must explicitly set this value. To do this, use the Default security domain drop-down on the System-wide Security Parameters page ([Home] > [Security Management] > [System Security Settings] > [System-wide Security Parameters]).
13. Exit
E.2 ^EncryptionKey
The ^EncryptionKey routine is for use with managed key encryption; it supports operations for encryption key management (technology for creation and management of encryption keys and key files), database encryption, and data element encryption. 1. Create new encryption key and key file Allows you to create a new database-encryption key, which it stores in a key file. 2. Manage existing encryption key file
Allows you to list administrators associated with a key file, add an administrator to a key file, and remove an administrator from a key file. 3. Database encryption Allows you to activate a database encryption key, display the unique identifier for the currently activated database encryption key (if there is one), deactivate the activated database encryption key, and configure Cach startup options related to database encryption. 4. Data element encryption for applications Allows you to activate a data element encryption key, list the unique identifier for any currently activated data element encryption keys (if there are any), and deactivate the activated data element encryption key.
E.3 ^DATABASE
The ^DATABASE routine is used to manage databases; it also allows you to set values related to Cach security. 1. Create a database Allows you to create a new database. 2. Edit a database Allows you to change the characteristics of an existing database, for example, by adding additional volumes. 3. List databases Displays the characteristics of one or more databases. 4. Delete a database Allows you to delete a Cach database. This action is irreversible. 5. Mount a database Makes a database ready for use by Cach. Databases must be mounted to Cach in order to be usable. Databases can be set to be automatically mounted at startup. 6. Dismount a database Permits you to quiesce a database and remove it from use by Cach. 7. Compact globals in a database Reorganizes the data inside CACHE.DAT. Note that this option does not reduce the size of the database file; to reduce the size of the database, see option 13. 8. Show free space for a database Displays the available space for a database. This is calculated as the difference between its current contents and its current declared size. 9. Show details for a database Displays detailed information on a specified database including location, size, status, and other controlling parameters. 10. Recreate a database Creates a new, empty database with the parameters of the original database. The new database is the same size as the original database. 11. Manage database encryption
^%AUDIT
Removes all the logical data from a database while preserving the properties of the database for reuse. 12. Return unused space for a database Frees either a specified amount of or all available extra space associated with a database, reducing it from its current size to its smallest possible size. 13. Compact free space in a database Removes the free space in a database. Note that this option reduces the size of the database file; to compact globals without changing the size of the database file, see option 7.
E.4 ^%AUDIT
This routine allows the reporting of data from the logs, and the manipulation of entries in the audit logs as well as the logs themselves. 1. Audit reports Permits you to specify selection criteria (date ranges, events, affected users, and so on) and display characteristics, then extracts the data from the audit log and formats it for presentation. 2. Manage audit logs Allows the extraction of log entries to another namespace, the export and import of audit log data to and from external files, and maintenance activities against the audit log itself. 3. Exit