blob: 173ad484b808682f555774794a59b7ab4ba0eb23 [file] [log] [blame]
<!DOCTYPE html>
<!--
Generated by Apache Maven Doxia at 2015-12-08
Rendered using Reflow Maven Skin 1.1.1 (http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<title>Apache Trafodion Enabling Security Features in Trafodion</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta http-equiv="content-language" content="en" />
<link href="http://netdna.bootstrapcdn.com/bootswatch/2.3.2/cerulean/bootstrap.min.css" rel="stylesheet" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" rel="stylesheet" />
<link href="./css/bootswatch.css" rel="stylesheet" />
<link href="./css/reflow-skin.css" rel="stylesheet" />
<link href="http://yandex.st/highlightjs/7.5/styles/default.min.css" rel="stylesheet" />
<link href="./css/lightbox.css" rel="stylesheet" />
<link href="./css/site.css" rel="stylesheet" />
<link href="./css/print.css" rel="stylesheet" media="print" />
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body class="page-enable-secure-trafodion project-trafodion" data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target="#top-nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="index.html">Apache <span class="color-highlight">Trafodion</span></a>
<div class="nav-collapse collapse" id="top-nav-collapse">
<ul class="nav pull-right">
<li ><a href="download.html" title="Download">Download</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="index.html" title="Project Overview">Project Overview</a></li>
<li ><a href="new-features.html" title="New Features">New Features</a></li>
<li ><a href="roadmap.html" title="Roadmap">Roadmap</a></li>
<li ><a href="performance.html" title="Performance">Performance</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="team-list.html" title="Team">Team</a></li>
<li ><a href="presentations.html" title="Presentations">Presentations</a></li>
<li ><a href="mail-lists.html" title="Mailing List">Mailing List</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="source-repository.html" title="Source Repository">Source Repository</a></li>
<li ><a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a></li>
<li ><a href="license.html" title="License">License</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Using <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="quickstart.html" title="Quick Start">Quick Start</a></li>
<li ><a href="download.html" title="Download">Download</a></li>
<li ><a href="install.html" title="Install">Install</a></li>
<li ><a href="management.html" title="Managing Trafodion">Managing Trafodion</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="documentation.html" title="Documentation">Documentation</a></li>
<li ><a href="faq.html" title="FAQ">FAQ</a></li>
<li ><a href="release-notes.html" title="Release Notes">Release Notes</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Features <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="architecture-overview.html" title="Architecture Overview">Architecture Overview</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/security-ansi-schemas" title="ANSI Schema Support" class="externalLink">ANSI Schema Support</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/ustat-automation" title="Automated Update Statistics" class="externalLink">Automated Update Statistics</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/bulkunload" title="Bulk Unload" class="externalLink">Bulk Unload</a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Trafodion_Manageability#Logging_Events" title="Event Handling" class="externalLink">Event Handling</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/hybrid-query-cache" title="Hybrid Query Cache" class="externalLink">Hybrid Query Cache</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/identity-column" title="Identity Column" class="externalLink">Identity Column</a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Creating_Statistics_During_Bulk_Load" title="Immediate Update Statistics" class="externalLink">Immediate Update Statistics</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/lob-support" title="Large Object (LOB)" class="externalLink">Large Object (LOB)</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/ddl-query-invalidation" title="Metadata Query Invalidation" class="externalLink">Metadata Query Invalidation</a></li>
<li ><a href="https://cwiki.apache.org/confluence/display/TRAFODION/Cmp-divisioning" title="Multi-Temperature Data" class="externalLink">Multi-Temperature Data</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/access-external-hbase-tables" title="Native HBase Tables" class="externalLink">Native HBase Tables</a></li>
<li ><a href="docs/Trafodion_odb_User_Guide.pdf" title="ODB">ODB</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/sql-query-cancel" title="Query Cancel" class="externalLink">Query Cancel</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/security-privilege-updates" title="Privilege Checking" class="externalLink">Privilege Checking</a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Trafodion_Manageability" title="Repository" class="externalLink">Repository</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/enable-get-statistics-thru-rms" title="Runtime Management System" class="externalLink">Runtime Management System</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/sequence-numbers" title="Sequence Numbers" class="externalLink">Sequence Numbers</a></li>
<li ><a href="https://blueprints.launchpad.net/trafodion/+spec/skew-buster" title="Skew Buster" class="externalLink">Skew Buster</a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Tutorial:_The_object-oriented_UDF_interface" title="Table-Oriented UDF" class="externalLink">Table-Oriented UDF</a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Data_Loading#Trickle_Loading_Data_Into_Trafodion_Tables" title="Trickle Load" class="externalLink">Trickle Load</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Backup_and_Restore" title="Backup/Restore Utility" class="externalLink">Backup/Restore Utility</a></li>
<li ><a href="https://wiki.trafodion.org/wiki/index.php/Metadata_Cleanup" title="Metadata Cleanup Utility" class="externalLink">Metadata Cleanup Utility</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Contributing <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="contribute.html" title="Contribute">Contribute</a></li>
<li ><a href="advocate.html" title="Advocate">Advocate</a></li>
<li ><a href="develop.html" title="Develop">Develop</a></li>
<li ><a href="testing.html" title="Test">Test</a></li>
<li ><a href="merge.html" title="Merge">Merge</a></li>
<li ><a href="release.html" title="Release">Release</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="create-dev-environment.html" title="Create Dev Environment">Create Dev Environment</a></li>
<li ><a href="manage-dev-environment.html" title="Manage Dev Environment">Manage Dev Environment</a></li>
<li ><a href="setup-build-environment.html" title="Setup Build Environment">Setup Build Environment</a></li>
<li ><a href="build.html" title="Build Trafodion">Build Trafodion</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="code.html" title="Modify Code">Modify Code</a></li>
<li ><a href="tests.html" title="Modify Tests">Modify Tests</a></li>
<li ><a href="document.html" title="Modify Documentation">Modify Documentation</a></li>
<li ><a href="website.html" title="Modify Web Site">Modify Web Site</a></li>
<li ><a href="wiki.html" title="Modify Wiki Pages">Modify Wiki Pages</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="cplusplus-coding-guidelines.html" title="C++ Coding Guidelines">C++ Coding Guidelines</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="http://incubator.apache.org/projects/trafodion.html" title="Status Page" target="_blank" class="externalLink">Status Page</a></li>
<li ><a href="http://www.apache.org/foundation/how-it-works.html" title="Apache Foundation" target="_blank" class="externalLink">Apache Foundation</a></li>
<li ><a href="http://www.apache.org/licenses/" title="Apache License" target="_blank" class="externalLink">Apache License</a></li>
<li ><a href="http://www.apache.org/security/" title="Apache Security" target="_blank" class="externalLink">Apache Security</a></li>
<li ><a href="http:divider" title=""></a></li>
<li ><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship" target="_blank" class="externalLink">Sponsorship</a></li>
<li ><a href="http://www.apache.org/foundation/thanks.html" title="Thanks" target="_blank" class="externalLink">Thanks</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<!-- Masthead
================================================== -->
<header>
<div class="jumbotron subhead">
<div class="row" id="banner">
<div class="span12">
<div class="pull-left">
<a href="index.html" id="bannerLeft"><h1>Apache <span class="color-highlight">Trafodion</span></h1></a>
<p class="lead">Transactional SQL-on-Hadoop Database</p>
</div>
<div class="pull-right">
</div>
</div>
</div>
</div>
<div>
<ul class="breadcrumb">
<li><a href="index.html" title="Trafodion">Trafodion</a></li>
<li class="divider">/</li>
<li>Enabling Security Features in Trafodion</li>
</ul>
</div>
<hr class="toc-separator" />
<div id="toc-bar" class="navbar" data-spy="affix" data-offset-top="250">
<div class="navbar-inner">
<div id="toc-scroll-target" class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target="#toc-nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse collapse" id="toc-nav-collapse">
<ul id="toc" class="nav">
<li class="toplevel"><a href="#introduction" title="Introduction">Introduction</a></li>
<li class="divider-vertical"></li>
<li class="toplevel"><a href="#configuring_ldap_servers" title="Configuring LDAP Servers">Configuring LDAP Servers</a></li>
<li class="divider-vertical"></li>
<li class="toplevel"><a href="#generate_a_trafodion_certificate" title="Generate a Trafodion Certificate">Generate a Trafodion Certificate</a></li>
<li class="divider-vertical"></li>
<li class="toplevel"><a href="#authentication_setup_script" title="Authentication Setup Script">Authentication Setup Script</a></li>
<li class="divider-vertical"></li>
<li class="toplevel"><a href="#manage_users" title="Manage Users">Manage Users</a></li>
</ul>
</div>
</div>
</div>
</div>
</header>
<div class="main-body">
<div class="row">
<div class="span12">
<div class="body-content">
<!-- Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the
License. -->
<p>This page describes how to enable Trafodion security.</p>
<div class="page-header">
<h1 id="introduction">Introduction</h1>
</div>
<p>If you do not enable security in Trafodion, a client interface to Trafodion may request a username and password, but Trafodion ignores the user name and password entered in the client interface, and the session runs as the database <b><tt>root</tt></b> user, <b><tt>DB__ROOT</tt></b>, without restrictions. If you want to restrict users, restrict access to certain users only, or restrict access to an object or operation, then you must enable security, which enforces authentication and authorization. You can enable security during installation by answering the installer’s prompts or after installation by running the <b><tt>traf_authentication_setup</tt></b> script, which enables both authentication and authorization. For more information, see <a href="#Authentication_Setup_Script">Authentication Setup Script</a> below.</p>
<p>Trafodion does not manage user names and passwords internally but does support authentication via directory servers that support the OpenLDAP protocol, also known as LDAP servers. You can configure the LDAP servers during installation by answering the installer’s prompts, or you can configure the LDAP servers manually after installation. For more information, please refer to <a href="Configuring_LDAP_Servers">Configuring LDAP Servers</a> below.</p>
<p>Once authentication and authorization are enabled, Trafodion allows users to be registered in the database and allows privileges on objects to be granted to users and roles (which are granted to users). Trafodion also supports component-level (or system-level) privileges, such as MANAGE_USERS, which can be granted to users and roles. Refer to <a href="#Manage_Users">Manage Users</a> below.</p>
<h1 id="configuring_ldap_servers">Configuring LDAP Servers</h1>
<p>To specify the LDAP server(s) to be used for authentication, you need to configure the text file <b><tt>.traf_authentication_config</tt></b>, located (by default) in <b><tt>$MY_SQROOT/sql/scripts</tt></b>. This file is a flat file, organized as a series of attribute/value pairs. Details on all the attributes and values accepted in the authentication configuration file and how to configure alternate locations can be found in <a href="traf_authentication_config.html">.traf_authentication_config</a>.</p>
<p>A sample template file is located in <b><tt>$MY_SQROOT/sql/scripts/traf_authentication_config</tt></b>.</p>
<p>Attributes and values in the authentication configuration file are separated with a colon immediately following the attribute name. In general white space is ignored, but spaces may be relevant in some values. Attribute names are always case insensitive. Multiple instances of an attribute are specified by repeating the attribute name and providing the new value. For attributes with only one instance, if the attribute is repeated, the last value provided is used.</p>
<div class="source">
<div class="source">
<pre>Attribute1: valueA
Attribute2: valueB
Attribute1: valueC
</pre>
</div>
</div>
<p>If <b><tt>Attribute1</tt></b> has only one instance, <b><tt>valueC</tt></b> is used, otherwise, <b><tt>valueA</tt></b> and <b><tt>valueC</tt></b> are both added to the list of values for <b><tt>Attribute1</tt></b>.</p>
<p>Attributes are grouped into sections; this is for future enhancements. Attributes are declared in the <b><tt>LOCAL</tt></b> section, unless otherwise specified.</p>
<table border="0" class="bodyTable table table-striped table-hover">
<tbody>
<tr class="a">
<td><b>Note</b><br />Section names, attribute names, and the general layout of the authentication configuration file are subject to change in future versions of Trafodion and backward compatibility is not guaranteed.</td>
</tr>
</tbody>
</table>
<p>Specification of your directory server(s) requires at a minimum:</p>
<!-- This table is too complex to do in markdown -->
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th width="15%">Setting</th>
<th width="55%">Description</th>
<th width="30%">Example</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td><b><tt>LDAP Host Name(s)</tt></b></td>
<td>One or more names of hosts that support the OpenLDAP protocol must be specified. Trafodion will attempt to connect to all provided host names during the authentication process. The set of user names and passwords should be identical on all hosts to avoid unpredictable results. The attribute name is <b><tt>LDAPHostName</tt></b></td>
<td>
<div>
<pre>LDAPHostName: ldap.company.com</pre>
</div></td>
</tr>
<tr class="a">
<td><b><tt>LDAP Port Number</tt></b></td>
<td>Port number of the LDAP server. Typically this is 389 for servers using no encryption or TLS, and 636 for servers using SSL. The attribute name is <b><tt>LDAPPort</tt></b>.</td>
<td>
<div>
<pre>LDAPPort: 389</pre>
</div></td>
</tr>
<tr class="b">
<td><b><tt>LDAP Unique Identifier</tt></b></td>
<td>Attribute(s) used by the directory server that uniquely identifies the user name. You may provide one or more unique identifier specifiers.</td>
<td>
<div>
<pre>UniqueIdentifier: uid=,ou=users,dc=com</pre>
</div></td>
</tr>
<tr class="a">
<td><b><tt>Encryption Level</tt></b></td>
<td>A numeric value indicating the encryption scheme used by your LDAP server. Values are:
<ul>
<li>0: Encryption not used</li>
<li>1: SSL</li>
<li>2: TLS</li>
</ul> </td>
<td>
<div>
<pre>LDAPSSL: 2</pre>
</div> <p>If your LDAP server uses TLS you must specify a file containing the certificate used to encrypt the password. By default the Trafodion software looks for this file in <b><tt>$MY_SQROOT/cacerts</tt></b>, but you may specify a fully qualified filename, or set the environment variable <b><tt>CACERTS_DIR</tt></b> to another directory. To specify the file containing the certificate, you set the value of the attribute <b><tt>TLS_CACERTFilename</tt></b>, located in the Defaults section.</p> <p><b>Example</b></p>
<div>
<pre>
TLS_CACERTFilename: mycert.pem
TLS_CACertFilename: /usr/etc/cert.pem</pre>
</div> </td>
</tr>
<tr class="b">
<td><b><tt>Search username and password</tt></b></td>
<td>Some LDAP servers require a known user name and password to search the directory of user names. If your environment has that requirement, provide these “search” values.</td>
<td>
<div>
<pre>
LDAPSearchDN: lookup@company.com
LDAPSearchPwd: Lookup123</pre>
</div> </td>
</tr>
</tbody>
</table>
<p>There are additional optional attributes that can be used to customize Trafodion authentication. As mentioned earlier, they are described in <a href="traf_authentication_config.html">.traf_authentication_config</a>.</p>
<p>You can test the authentication configuration file for syntactic errors using the <b><tt>ldapconfigcheck</tt></b> tool. If you have loaded the Trafodion environment (<b><tt>sqenv.sh</tt></b>), then the tool will automatically check the file at <b><tt>$MY_SQROOT/sql/scripts/.traf_authentication_config</tt></b>. If not, you can specify the file to be checked.</p>
<p><b>Example</b></p>
<div class="source">
<div class="source">
<pre>ldapconfigcheck –file myconfigfile
File myconfigfile is valid.
</pre>
</div>
</div>
<p>If an error is found, the line number with the error is displayed along with the error. Please refer to <a href="ldapconfigcheck.html">ldapconfigcheck</a> for more information.</p>
<table border="0" class="bodyTable table table-striped table-hover">
<tbody>
<tr class="a">
<td><b>Note</b><br />The authentication configuration file needs to be propagated to all nodes, but there is a script that will do that for you described later. For now, you can test your changes on the local node.</td>
</tr>
</tbody>
</table>
<p>You can test the LDAP connection using the utility <b><tt>ldapcheck</tt></b>. To use this utility the Trafodion environment must be loaded (<b><tt>sqenv.sh</tt></b>), but the Trafodion instance does not need to be running. To test the connection only, you can specify any user name, and a name lookup will be performed using the attributes in <b><tt>.traf_authentication_config</tt></b>.</p>
<div class="source">
<div class="source">
<pre>ldapcheck --username=fakename@company.com
User fakename@company.com not found
</pre>
</div>
</div>
<p>If <b><tt>ldapcheck</tt></b> reports either that the user was found or the user was not found, the connection was successful. However, if an error is reported, either the configuration file is not setup correctly, or there is a problem either with your LDAP server or the connection to the server. You can get additional error detail by including the <b><tt>--verbose</tt></b> option. Please refer to <a href="ldapcheck.html">ldapcheck</a> for more information.</p>
<p>If you supply a password, <b><tt>ldapcheck</tt></b> will attempt to authenticate the specified <b><tt>username</tt></b> and <b><tt>password</tt></b>. The example below shows the password for illustrative purposes, but to avoid typing the password on the command line, leave the password blank (<b><tt>--password=</tt></b>) and the utility will prompt for the password with no echo.</p>
<div class="source">
<div class="source">
<pre>ldapcheck --username=realuser@company.com –-password=StrongPassword
Authentication successful
</pre>
</div>
</div>
<h1 id="generate_a_trafodion_certificate">Generate a Trafodion Certificate</h1>
<p>Trafodion clients such as <b><tt>trafci</tt></b> will encrypt the password before sending it to Trafodion. A self-signed certificate is used to encrypt the password. The certificate and key should be generated when the <b><tt>sqgen</tt></b> script is invoked. By default, the files <b><tt>server.key</tt></b> and <b><tt>server.crt</tt></b> will be located in <b><tt>$HOME/sqcert</tt></b>. If those files are not present, since Trafodion clients will not send unencrypted passwords, you will need to manually generate those files. To do so, run the script <b><tt>sqcertgen</tt></b> located in <b><tt>$MY_SQROOT/sql/scripts</tt></b>. The script runs <b><tt>openssl</tt></b> to generate the certificate and key.</p>
<p>To run openssl manually, follow the example:</p>
<div class="source">
<div class="source">
<pre>openssl req -x509 -nodes -days 365 -subj '/C=US/ST=California/L=PaloAlto/CN=host.domain.com/O=Some Company/OU=Service Connection'
- newkey rsa:2048 -keyout server.key -out server.crt
</pre>
</div>
</div>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>Option </th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td><b><tt>-x509</tt></b> </td>
<td>Generate a self-signed certificate.</td>
</tr>
<tr class="a">
<td><b><tt>-days &lt;validity of certificate&gt;</tt></b> </td>
<td>Make the certificate valid for the days specified.</td>
</tr>
<tr class="b">
<td><b><tt>-newkey rsa:&lt;bytes&gt;</tt></b> </td>
<td>Generate a new private key of type RSA of length 1024 or 2048 bytes.</td>
</tr>
<tr class="a">
<td><b><tt>-subj &lt;certificateinfo&gt;</tt></b> </td>
<td>Specify the information that will be incorporated in the certificate. Each instance in a cluster should have a unique common name(<b><tt>CN</tt></b>).</td>
</tr>
<tr class="b">
<td><b><tt>-keyout &lt;filename&gt;</tt></b> </td>
<td>Write the newly generated RSA private key to the file specified.</td>
</tr>
<tr class="a">
<td><b><tt>-nodes</tt></b> </td>
<td>It is an optional parameter that specifies NOT to encrypt the private key. If you encrypt the private key, then you must enter the password every time the private key is used by an application.</td>
</tr>
<tr class="b">
<td><b><tt>-out &lt;filename&gt;</tt></b> </td>
<td>Write the self-signed certificate to the specified file.</td>
</tr>
</tbody>
</table>
<p>Both the public (<b><tt>server.crt</tt></b>) and private (<b><tt>server.key</tt></b>) files should be placed in the directory <b><tt>$HOME/sqcert</tt></b>. If you do not want to use the <b><tt>HOME</tt></b> directory or if you want to use different names for the private and/or public key files, then Trafodion supports environment variables to specific the alternate locations or names.</p>
<ul>
<li> <p>Trafodion first checks the environment variables <b><tt>SQCERT_PRIVKEY</tt></b> and <b><tt>SQCERT_PUBKEY</tt></b>. If they are set, Trafodion uses the fully qualified filename value of the environment variable.</p> <p>You can specify either one filename environment variable or both.</p></li>
<li> <p>If at least one filename environment variable is not set, Trafodion checks the value of the environment variable <b><tt>SQCERT_DIR</tt></b>. If set, the default filename <b><tt>server.key</tt></b> or <b><tt>server.crt</tt></b> is appended to the value of the environment variable <b><tt>SQCERT_DIR</tt></b>.</p></li>
<li>If the filename environment variable is not set and the directory environment variable is not set, Trafodion uses the default location (<b><tt>$HOME/sqcert</tt></b>) and the default filename.</li>
</ul>
<h1 id="authentication_setup_script">Authentication Setup Script</h1>
<p>The final step to enable security is to change the value of the environment variable <b><tt>TRAFODION_ENABLE_AUTHENTICATION</tt><b>from </b><tt>NO</tt></b> to <b><tt>YES</tt></b> and turn on authorization. This is achieved by invoking the <b><tt>traf_authentication_setup</tt></b> script, which is located in <b><tt>$MY_SQROOT/sql/scripts</tt></b>.</p>
<p><b>Usage</b></p>
<p>Usage: traf_authentication_setup [options]</p>
<div class="source">
<div class="source">
<pre>Options:
--file &lt;loc&gt; Optional location of OpenLDAP configuration file
--help Prints this message
--off Disables authentication and authorization
--on Enables authentication and authorization
--setup Enables authentication
--status Returns status of authentication enablement
</pre>
</div>
</div>
<!-- In HTML to control the column widths; markdown table doesn't handle Option correctly. -->
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th width="10%">Option</th>
<th width="90%">Description</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td><b><tt>--file</tt></b></td>
<td>If specified, then <b><tt>filename</tt></b> is copied to <b><tt>$MY_SQROOT/</tt></b>. Users working in their own private environment can refer to a site-specific configuration file from a central location.</td>
</tr>
<tr class="a">
<td><b><tt>--on</tt></b></td>
<td> <p><b><tt>traf_authentication_setup</tt></b> invokes <a href="ldapconfigcheck.html">ldapconfigcheck</a>) to verify the configuration file is syntactically correct. It also invokes <a href="ldapcheck.html">ldapcheck</a> to verify that a connection can be made to an LDAP server.</p> <p>If both checks pass, the script sets the environment variable <b><tt>TRAFODION_ENABLE_AUTHENTICATION</tt></b> to <b><tt>YES</tt></b> in the file <b><tt>$MY_SQROOT/sqenvcom.sh</tt></b>, and propagates <b><tt>sqenvcom.sh</tt></b> and <b><tt>.traf_authentication_config</tt></b> to all nodes in the cluster.</p> <p>The last step is to enable authorization by creating privilege-related metadata tables and set up default permissions with a call to the database. The list of privilege-related metadata tables, users, roles, and component privileges are logged in <b><tt>$MY_SQROOT/logs/authEnable.log</tt></b>.</p> <p>Specifying <b><tt>--on</tt></b> requires that a valid <b><tt>.traf_authentication_config</tt></b> file exists and the Trafodion metadata initialized.</p> </td>
</tr>
<tr class="b">
<td><b><tt>--off</tt></b></td>
<td> <p>If specified, then <b><tt>traf_authentication_setup</tt></b> sets the environment variable <b><tt>TRAFODION_ENABLE_AUTHENTICATION</tt></b> to <b><tt>NO</tt></b> in <b><tt>$MY_SQROOT/sqenvcom.sh</tt></b> and propagates the file to all the nodes in the cluster.</p> <p>The last step is to disable authorization by removing any privilege-related metadata and permissions with a call to the database. The results of this operation is logged in <b><tt>$MY_SQROOT/logs/authEnable.log</tt></b>.</p> </td>
</tr>
<tr class="a">
<td><b><tt>--setup</tt></b></td>
<td>Use this option if the Trafodion metadata has not been initialized. This option enables authentication but does not call the database to create privilege-related metadata tables. Later, when Trafodion metadata is initialized, privilege-related metadata tables and default permissions are automatically created. </td>
</tr>
<tr class="b">
<td><b><tt>--status</tt></b></td>
<td>Reports the value of the environment variable <b><tt>TRAFODION_ENABLE_AUTHENTICATION</tt></b> in <b><tt>$MY_SQROOT/sqenvcom.sh</tt></b> on the current node and reports the status of security features in the database. </td>
</tr>
</tbody>
</table>
<p><b>Example</b></p>
<div class="source">
<div class="source">
<pre>INFO: Start of security (authentication and authorization) script Wed Mar 25 15:12:50 PDT 2xxx.
INFO: *** Trafodion security (authentication and authorization) status ***
Authentication is ENABLED
Authorization (grant/revoke) is ENABLED
INFO: End of security (authorization and authentication) script Wed Mar 25 15:12:54 PDT 2xxx.
</pre>
</div>
</div>
<table border="0" class="bodyTable table table-striped table-hover">
<tbody>
<tr class="a">
<td><b>IMPORTANT</b><br />Any time the environment file (<b><tt>sqenvcom.sh</tt></b>) is changed (and propagated to all nodes), Database Connectivity Services (DCS) must be restarted to pick up the new value. If the configuration file is changed, it will be re-read in 30 minutes (by default), but you can have changes take effect immediately by restarting DCS.</td>
</tr>
</tbody>
</table>
<p>To restart DCS, run the scripts <b><tt>stop-dcs.sh</tt></b> and <b><tt>start-dcs.sh</tt></b>, located in <b><tt>$MY_SQROOT/dcs-&lt;x&gt;.&lt;y&gt;.&lt;z&gt;/bin</tt></b>.</p>
<h1 id="manage_users">Manage Users</h1>
<p>Users are registered in the Trafodion database and are used to enforce authorization. If security is disabled, any user can register any user at any time. However, once security is enabled, user administration is considered a secure operation, and registration of users is restricted to <b><tt>DB__ROOT</tt></b> or any user granted the <b><tt>MANAGE_USERS</tt></b> component privilege. To initially register a user, connect to Trafodion with the external user mapped to <b><tt>DB__ROOT</tt></b>(also known as the Trafodion ID).</p>
<p>When security is enabled, the <b><tt>DB__ROOT</tt></b> user is registered as the <b><tt>TRAFODION</tt></b> external user name. It is recommended that the <b><tt>DB__ROOT</tt></b> user be mapped to the external user name that will be used to connect for root operations. To do this, start a <b><tt>sqlci</tt></b> session and perform the <b>`<tt>ALTER USER</tt></b>* command, for example:</p>
<div class="source">
<div class="source">
<pre>ALTER USER DB__ROOT SET EXTERNAL NAME trafodion_rootuser_in_ldap;
</pre>
</div>
</div>
<p>To learn more about how to register users, grant object and component privileges, and manage users and roles, please see the <a href="docs/Trafodion_SQL_Reference_Manual.pdf">Trafodion SQL Reference Manual</a>.</p>
</div>
</div>
</div>
</div>
</div><!-- /container -->
<!-- Footer
================================================== -->
<footer class="well">
<div class="container">
<div class="row">
<div class="span2 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">About</li>
<li >
<a href="index.html" title="Project Overview">Project Overview</a>
</li>
<li >
<a href="new-features.html" title="New Features">New Features</a>
</li>
<li >
<a href="roadmap.html" title="Roadmap">Roadmap</a>
</li>
<li >
<a href="performance.html" title="Performance">Performance</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="team-list.html" title="Team">Team</a>
</li>
<li >
<a href="presentations.html" title="Presentations">Presentations</a>
</li>
<li >
<a href="mail-lists.html" title="Mailing List">Mailing List</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li >
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
<li >
<a href="license.html" title="License">License</a>
</li>
</ul>
</div>
<div class="span2 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Using</li>
<li >
<a href="quickstart.html" title="Quick Start">Quick Start</a>
</li>
<li >
<a href="download.html" title="Download">Download</a>
</li>
<li >
<a href="install.html" title="Install">Install</a>
</li>
<li >
<a href="management.html" title="Managing Trafodion">Managing Trafodion</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="documentation.html" title="Documentation">Documentation</a>
</li>
<li >
<a href="faq.html" title="FAQ">FAQ</a>
</li>
<li >
<a href="release-notes.html" title="Release Notes">Release Notes</a>
</li>
</ul>
</div>
<div class="span2 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Features</li>
<li >
<a href="architecture-overview.html" title="Architecture Overview">Architecture Overview</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/security-ansi-schemas" title="ANSI Schema Support" class="externalLink">ANSI Schema Support</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/ustat-automation" title="Automated Update Statistics" class="externalLink">Automated Update Statistics</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/bulkunload" title="Bulk Unload" class="externalLink">Bulk Unload</a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Trafodion_Manageability#Logging_Events" title="Event Handling" class="externalLink">Event Handling</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/hybrid-query-cache" title="Hybrid Query Cache" class="externalLink">Hybrid Query Cache</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/identity-column" title="Identity Column" class="externalLink">Identity Column</a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Creating_Statistics_During_Bulk_Load" title="Immediate Update Statistics" class="externalLink">Immediate Update Statistics</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/lob-support" title="Large Object (LOB)" class="externalLink">Large Object (LOB)</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/ddl-query-invalidation" title="Metadata Query Invalidation" class="externalLink">Metadata Query Invalidation</a>
</li>
<li >
<a href="https://cwiki.apache.org/confluence/display/TRAFODION/Cmp-divisioning" title="Multi-Temperature Data" class="externalLink">Multi-Temperature Data</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/access-external-hbase-tables" title="Native HBase Tables" class="externalLink">Native HBase Tables</a>
</li>
<li >
<a href="docs/Trafodion_odb_User_Guide.pdf" title="ODB">ODB</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/sql-query-cancel" title="Query Cancel" class="externalLink">Query Cancel</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/security-privilege-updates" title="Privilege Checking" class="externalLink">Privilege Checking</a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Trafodion_Manageability" title="Repository" class="externalLink">Repository</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/enable-get-statistics-thru-rms" title="Runtime Management System" class="externalLink">Runtime Management System</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/sequence-numbers" title="Sequence Numbers" class="externalLink">Sequence Numbers</a>
</li>
<li >
<a href="https://blueprints.launchpad.net/trafodion/+spec/skew-buster" title="Skew Buster" class="externalLink">Skew Buster</a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Tutorial:_The_object-oriented_UDF_interface" title="Table-Oriented UDF" class="externalLink">Table-Oriented UDF</a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Data_Loading#Trickle_Loading_Data_Into_Trafodion_Tables" title="Trickle Load" class="externalLink">Trickle Load</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Backup_and_Restore" title="Backup/Restore Utility" class="externalLink">Backup/Restore Utility</a>
</li>
<li >
<a href="https://wiki.trafodion.org/wiki/index.php/Metadata_Cleanup" title="Metadata Cleanup Utility" class="externalLink">Metadata Cleanup Utility</a>
</li>
</ul>
</div>
<div class="span2 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Contributing</li>
<li >
<a href="contribute.html" title="Contribute">Contribute</a>
</li>
<li >
<a href="advocate.html" title="Advocate">Advocate</a>
</li>
<li >
<a href="develop.html" title="Develop">Develop</a>
</li>
<li >
<a href="testing.html" title="Test">Test</a>
</li>
<li >
<a href="merge.html" title="Merge">Merge</a>
</li>
<li >
<a href="release.html" title="Release">Release</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="create-dev-environment.html" title="Create Dev Environment">Create Dev Environment</a>
</li>
<li >
<a href="manage-dev-environment.html" title="Manage Dev Environment">Manage Dev Environment</a>
</li>
<li >
<a href="setup-build-environment.html" title="Setup Build Environment">Setup Build Environment</a>
</li>
<li >
<a href="build.html" title="Build Trafodion">Build Trafodion</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="code.html" title="Modify Code">Modify Code</a>
</li>
<li >
<a href="tests.html" title="Modify Tests">Modify Tests</a>
</li>
<li >
<a href="document.html" title="Modify Documentation">Modify Documentation</a>
</li>
<li >
<a href="website.html" title="Modify Web Site">Modify Web Site</a>
</li>
<li >
<a href="wiki.html" title="Modify Wiki Pages">Modify Wiki Pages</a>
</li>
<li >
<a href="http:divider" title=""></a>
</li>
<li >
<a href="cplusplus-coding-guidelines.html" title="C++ Coding Guidelines">C++ Coding Guidelines</a>
</li>
</ul>
</div>
<div class="span4 bottom-description">
<blockquote><a href="http://trafodion.apache.org/">Apache Trafodion</a> is a webscale SQL-on-Hadoop solution enabling transactional or operational
workloads on Hadoop. <br /><br />The name &quot;Trafodion&quot; (the Welsh word for transactions, pronounced
&quot;Tra-vod-eee-on&quot;) was chosen specifically to emphasize the differentiation that
Trafodion provides in closing a critical gap in the Hadoop ecosystem.<br /><br />
Trafodion builds on the scalability, elasticity, and flexibility of Hadoop. Trafodion extends
Hadoop to provide guaranteed transactional integrity, enabling new kinds of big data
applications to run on Hadoop.</blockquote>
</div>
</div>
</div>
</footer>
<div class="container subfooter">
<div class="row">
<div class="span12">
<p class="pull-right"><a href="#">Back to top</a></p>
<p class="copyright">Copyright &copy;2015 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.</p>
<hr/>
<div class="row span16">
<span>Disclaimer: Apache Trafodion is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC.
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making
process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the
completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</span>
<br/>
<br/>
<span>Apache, Apache Maven, Apache Maven Fluido Skin, the Apache feather logo, the Apache Maven project logo and the Apache Incubator project logo
are trademarks of The Apache Software Foundation.</span>
<br/>
<br/>
<span>
<a target="_blank" href="http://www.apache.org">
<img id="asf-logo" alt="Apache Software Foundation" src="images/logos/feather-small.gif"/>
</a>
<a target="_blank" href="http://incubator.apache.org/">
<img id="incubator-logo" alt="Apache Incubator" src="images/logos/egg-logo.gif"/>
</a>
</span>
</div> </div>
</div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="./js/lightbox.min.js"></script>
<script src="./js/reflow-scroll.js"></script>
<script src="http://yandex.st/highlightjs/7.5/highlight.min.js"></script>
<script src="./js/reflow-skin.js"></script>
</body>
</html>