Configuring session inactivity timeout for Ranger Admin Web UI

How to set a session inactivity timeout value for the Ranger Admin Web UI.

Ranger supports session inactivity timeout for the Ranger Admin web UI. User activity is monitored when a user logs in to the Ranger Admin web UI. If no user activity occurs during the set time period, Ranger Web UI prompts the user to either stay logged in or log out.

If the user chooses Stay Logged In, Ranger continues to use the same browser session and the session inactivity monitor resets. If the user chooses either Logout or no option, the browser redirects the user to either the Knox logout page (for a public cloud deployment) or the Ranger login page (for users who logged in to Ranger directly without using a Knox proxy).

ranger.service.inactivity.timeout has the value -1 second by default, which disables the session inactivity timeout.

To enable session inactivity timeout and set a timeout value:

  1. In Cloudera Manager > Ranger > Configuration > Search, type session.
  2. In Session Inactivity Timeout for Ranger Admin: set a positive, integer value for the ranger.service.inactivity.timeout property, then choose a time unit.

    For example, setting ranger.service.inactivity.timeout to 30 seconds triggers the logout prompt after 30 seconds of inactivity in the Ranger Web UI. Choosing 30 days allows a month of inactivity before a logout prompt displays.

    Configuring Ranger Admin Session Inactivity Timeout
  3. Click Save Changes (CTRL+S).
  4. Choose Actions > Restart to refresh session inactivity timeout configuration settings.

Configuring http session timeout value for Tomcat server

How to set a session timeout value for the UI and API requests from Ranger Admin Web UI's Tomcat server.

Ranger allows you to configure an http session timeout value for the UI and API requests from Ranger Admin Web UI's Tomcat server. This configuration ends the admin user's browser session after a specified duration. To set this configuration, use the command line editor to modify the session-timeout parameter in /web.xml.
  1. Login to your Ranger-Admin host.
  2. Enter /opt/cloudera/parcels/CDH-[version]/lib/ranger-admin/ews/webapp/WEB-INF/ in the command line editor.
  3. Backup the web.xml file in a safe place before making any changes.
  4. Edit the web.xml file as follows:
    #vim web.xml
    1. Locate the value session-timeout = 60.
    2. Change this number to your desired value, in seconds. For example, setting session-timeout = 300seconds sets the session to end after 5 minutes.
  5. Save the changes to the web.xml file.
  6. Restart Ranger Service to refresh .