Create a time-bound policy

Ranger policy validity periods enable you to configure a policy to be effective for a specified time range. You can add a validity period to both resource-based and tag-based policies.

Time-bound policy use-case examples:
  • To restrict access to sensitive financial information until the earnings release date.
  • To block a certain user for a specific time period (e.g., a compromised user account being investigated needs to be put on "hold" from accessing resources in Hadoop services).
  • To block a certain group for a specific time (e.g., excluding temporary employees from writing on resources during the holiday season).
  1. On Service Manager > Resource Policies, select a service.
  2. On <Service_name> Policies, click Add New Policy.
  3. Complete the fields on Create Policy.
  4. Click Add Validity Period.
  5. On Policy Validity Period, specify a start time, end time, and time zone. To add additional validity periods, click +. Click Save to save the specified validity periods.

    Policy Validity Period Example
    The JSON format for Policy Validity Period appears as follows:
    "validitySchedules":[{"startTime":"2024/11/01 00:00:00","endTime":"2024/11/30 00:00:00","timeZone":"Africa/Abidjan"}]
  6. If you would like the policy to override all other policies during its validity period, select override.

    Policy Validity Period Example
  7. Click Add.