setting up the grouper and signet databases joy veronneau cornell university identity management...

34
Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Upload: cathleen-norris

Post on 23-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Setting up the Grouper and Signet Databases

Joy Veronneau

Cornell University

Identity Management

November 7, 2006

Page 2: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006
Page 3: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006
Page 4: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Introduction

• Grouper and Signet rely on Hibernate technology to integrate with a variety of RDBMS systems.

• Also see the Signet and Grouper Wikis for Hibernate configuration information.

Page 5: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Let’s talk about

first…

Page 6: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

grouper.hibernate.properties

• See sample grouper/conf/grouper.hibernate.properties in Appendix 2 of handout.

• Comes pre-populated for HSQLDB, PostgreSQL, and Oracle - just comment and uncomment the appropriate sections.

• Hibernate uses JDBC - fill in:– hibernate.connection.driver_class (JDBC driver classname)– hibernate.connection.url (JDBC URL for the database)– hibernate.connection.username (database user)– hibernate.connection.password (database user’s password)

Page 7: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper/Oracle Example

• At Cornell, we are using an Oracle database for the groups registry.

Page 8: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper/Oracle cont’d

• Remember to uncomment this line if you are using Oracle:

(You can also fix any spelling mistakes you might find.)

Page 9: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Ready, Set …

• If your configuration is ready, the next thing you need to do is initialize your database.

• Don’t forget to put your classes.jar file in the grouper/lib directory (e.g. oracle-classes12.jar)

• You may want to edit your log4j.properties file if you haven’t already.

Page 10: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Go!• Switch into the grouper directory and type “ant

schemaexport” - this command generates the DDL (Data Definition Language) appropriate for your configured RDBMS and installs the tables.

• Then type “ant db-init”. This command populates various tables with required logical schema information and creates the root naming stem of the Groups Registry.

• These ant commands will produce errors if you haven’t configured your log files correctly in log4j.properties. But the commands will still work after Grouper complains a little.

Page 11: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper FAQ Number 2:

Q: "ant schemaexport" creates 14 tables, 2 of which are "subject" and "subjectattribute". Do I need these?

A: No. They are there only to support the quickstart demo and testing the API. They can safely be removed or ignored *if* your subjects are coming from another source, e.g. an LDAP directory.

Page 12: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper FAQ Number 6:Q: I am using Oracle for my Grouper database, and

when I try to add more groups or members, I am getting this error: "hibernate commit error: Could not execute JDBC batch update." What causes that?

A: One cause may be that you have run out of tablespace - try extending your tablespace for the Grouper database.

Cornell currently has the tablespace set to 1Gb, just a rough guess based on preliminary data loads.

Page 13: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper/Oracle cont’d

• The Oracle database schema has been modified between version 1.0 and 1.1 of Grouper. If you are upgrading from 1.0, you should export the GROUPER_MEMBERSHIPS table, reorder the columns and import the GROUPER_MEMBERSHIPS table for much better performance.

Page 14: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Audience Participation

• Any experience using Grouper with PostgreSQL or HSQLDB?

Page 15: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Special Grouper Subjects:GrouperAll

• The GrouperAll subject is hard-wired.• GrouperAll means *any* subject.• When you select “Assign the following default

privileges for everyone” in the UI, you are actually assigning them to the “GrouperAll” subject.

• You will see GrouperAll appear in the UI when you look at who has group privileges such as VIEW and READ.

Page 16: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006
Page 17: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Special Grouper Subjects:GrouperSystem

• The super-user…• If you are using an SSO system and/or outside

subject sources, you probably won’t be able to sign on as GrouperSystem but…

• You can create a Grouper “wheel” group whose members are the security equivalent to “GrouperSystem”.

• If you are a member of the “wheel” group, the UI gives you a choice whether to act as yourself with normal privileges, or as “admin” which means “GrouperSystem”.

Page 18: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Setting up the Grouper Wheel Group

• See instructions in the Wiki Documentation section: “Initializing Administration of Grouper Privileges.”

• Use gsh to create the group, and edit the grouper.properties file.

• Sample grouper.properties file in Appendix 4 of handout.

• Joy sez: “Make a script, you will have to do this more than once when you are starting out!”

Page 19: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

The gsh Utility (Grouper Shell)

• My favorite utility - a tool for interacting with the Grouper API.

• Script (batch) and interactive modes.• The Grouper Wiki has instructions for how to

build and use it. • Use special gsh commands or *any* API

command.

Page 20: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Useful gsh Variables

Page 21: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Create “wheel” Group - Sample gsh Script

Page 22: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper XML Export

• Exported XML may be used for: * provisioning other systems * reporting * backups * switching database backends - including to upgraded schemas (required by new Grouper API versions) in the same database

Page 23: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Grouper XML Import

• Useful for: * loading - adding to or updating existing Stems, Groups and Group Types. Whole or partial Grouper registries can be exported, and subsequently imported at a specified Stem (or the Root Stem if not specified) in the new instance. * initializing a new, empty registry to a known state - useful for demos, testing and system recovery

Page 24: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Sample Grouper XML export command

• Remember to create an export.properties file.

• From grouper directory, this will export the cu:ga stem which has the wheel group in it:

ant xml-export -Dcmd="GrouperSystem -name cu:ga x.xml"

Page 25: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

What the Export xml Looks Like

Page 26: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Setting up the

Database

Page 27: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Set Up the Signet Database

• Instructions on the Signet Wiki• The DDL for each supported database is found in

the signet/sql directory. • Signet currently provides DDL for:

* HSQL * Oracle * Postgres * Sybase

• Execute with your favorite tool (Aqua for Mac, dbArtisan for Windows)

Page 28: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Copy Your Driver

• For Oracle this is oracle-classes12.jar

• An appropriate driver must be installed in two places, as there are two parts to Signet that operate independently - the Web application and the utilities.* signet/lib

* signet/webapp/signet/WEB-INF/lib

Page 29: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Two Different Versions of Hibernate?

• It’s just an accident that Signet uses XML for the Hibernate configuration and Grouper doesn’t.

• Currently Grouper (& Subject) use v2.1.8 of Hibernate. Signet uses some earlier v2.

• Normalization of third party libraries common to Signet and Grouper is being addressed.

Page 30: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Edit signet/config/hibernate.cfg.xml

• See sample hibernate.cfg.xml in Appendix 3 of handout.

• Configures your JDBC connection.• Edit two copies of the hibernate.cfg.xml

file:– signet/config/hibernate.cfg.xml– signet/webapp/signet/WEB-INF/classes/

hibernate.cfg.xml

Page 31: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Sample signet/config/hibernate.cfg.xml for Oracle

Page 32: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

The Special “Signet” Subject

• Built into Signet• The Signet subject is the source of granted

privileges over internal Signet system actions as described below.

• The Signet subject is the actor on any system-initiated action, e.g., it will be identified as the "revoker" when a lifecycle event (expiration or affiliation change) causes the automatic revocation of services.

Page 33: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

“Signet” Subject - more

• The Signet subject has hard-wired granting powers over all functions in all subsystems. Note that Signet can extend capabilities to others (can grant), but cannot itself act on those privileges.

Page 34: Setting up the Grouper and Signet Databases Joy Veronneau Cornell University Identity Management November 7, 2006

Giving the Signet System Administrator Initial Power

• Use the Signet proxy tool to grant System Administrator privileges (described in the Wiki)

• ./run.sh grant [email protected]

• Possible commands: grant, revoke, list