Encrypting a password (encode_passwd)  Chapter 7: Performance and Tuning

Chapter 6: Security

Tightening portal security

Currently, Unwired Accelerator does not encrypt the user name and password used to log in to the RDBMS server containing the portal database tables. If anyone knows the database user name and password, they can use ISQL to access the database tables directly. To safeguard portal security, you can:

StepsChanging the password, and optionally the PortalDB table owner

The simplest safeguard is to change the database password, using the ISQL GUI. The ISQL GUI requires the jConnect JDBC driver, which is packaged separately under the SYBASE\tomcat\common\lib directory.

Optionally, another safeguard is to create a custom database user to own the portal database tables, rather than using the dba user (ASA) or the sa user (Adaptive Server). This prevents unauthorized users from using ISQL directly into your database to look at PortalDB tables. If you create the custom database owner, also change the default database user name found in global.properties.xml. Coordinate these changes between the PortalDB and the global.properties.xml file.

  1. From the command line, navigate to the following directory:

    cd SYBASE\asa\java

  2. Access isql using the command that follows. The command adds the jConnect JDBC driver to the class path.

    java -classpath ..\..\tomcat\common\lib\ jconn2.jar;jisql.jar com.sybase.jisql.Jisql

    The jisql login screen displays.

  3. Log in, and change the dba or sa password from the defaults (“SQL” for ASA and “  ” for Adaptive Server).

    // Change the password. sp_password <oldpassword>, <newpassowrd>

  4. Optionally, use isql to create a new database user in the portal database and make this user the owner of PortalDB. Here is the input using isql:

  5. Open the global.properties.xml file in a text editor, and search for the data pool entry you are using, either op_portal_asa (for ASA) or op_portal_ase (for Adaptive Server).

  6. Change the database user name and password entries in the data pool entry, from the default to the values you established in “Changing the password, and optionally the PortalDB table owner”.

    See the “Database property-specific parameters” section for information about user and password in the op_portal_asa and op_portal_ase data pool sections.

  7. Optionally, encrypt the password in the global.properties.xml file using the encode_passwd.bat (Windows) or encode_passwd.sh (UNIX) utility:

    1. If you are using Tomcat, navigate to:

      SYBASE\tomcat\webapps\onepage\config

      For EAServer:

      SYBASE\EAServer\Repository\WebApplication\onepage\config

    2. Run the encode_passwd utility with the current password, for example:

      encode_passwd.bat password
      

      An encrypted password displays on the window, for example:

      990990D99ED8DFFDDFFDDFFDDFFDDFFDDFFDDFFD
      
    3. In global.properties.xml, make these changes:

      • password=” “ – copy the encrypted password, and paste it into the password attribute; for example:

        password="990990D99ED8DFFDDFFDDFFDDFFDDFFDDFFDDFFD"
        
      • password_encrypted=”false” – change this value to true.

      WARNING! Keep in mind that there is no comparable step for encrypting the password in the server.xml file.

  8. Save and close the global.properties.xml file.

StepsLimiting global.properties.xml access to the portal server owner

Another safeguard is to make the global.properties.xml file readable only by the computer user the portal server (Tomcat) runs in.

  1. Make the global.properties.xml file readable only by the computer user for the portal server.

  2. Modify database account information in the server.xml file, and limit access to the file.

StepsModifying database account information in server.xml

As a final safeguard, modify the database account information in the server.xml file, then limit access to the server.xml file as you did in the preceding procedure.

NoteThese instructions are for Tomcat. If you are using EAServer, use EAServer Manager to open the folder of PortalDB connection pools, and edit the database account information.

  1. In Windows Explorer, navigate to the following directory:

    cd SYBASE\tomcat\conf

  2. In a text editor, open server.xml.

  3. Search for “Global JNDI resources.” This section defines a Java Naming and Directory Interface (JNDI) connection pool to the PortalDB. The XML looks like:

    <!-- Global JNDI resources -->  <GlobalNamingResources>  <Resource name="jdbc/portaldb" auth="Container"      type="javax.sql.DataSource"/>  <ResourceParams name="jdbc/portaldb">   <parameter>    <name>driverClassName</name>    <value>com.sybase.jdbc2.jdbc.SybDriver</value>   </parameter>   <parameter>    <name>url</name>    <value>jdbc:sybase:Tds:localhost:4747?ServiceName=      portaldatabase</value>   </parameter>   <parameter>    <name>username</name>    <value>dba</value>   </parameter>   <parameter>    <name>password</name>    <value>SQL</value>   </parameter>

  4. Change the user name and password parameters to the new database user owner and password that you set up.

  5. Save and close the server.xml file.

  6. Make the server.xml file readable only by the computer user for the portal server (Tomcat).

  7. Restart the application server to apply the changes you made to global.properties.xml and server.xml.





Copyright © 2005. Sybase Inc. All rights reserved. Chapter 7: Performance and Tuning

View this book as PDF