Access that starts too early or ends too late is one of the most common identity control failures, and it usually comes down to a date field nobody owns. Sunrise and sunset dates let an identity platform grant access at a planned start time and remove it at a planned end time without waiting for a ticket. This guide explains where future-dated access is needed, how identity governance tools and directories store and act on the dates, the time zone and HR data traps that make access arrive a day late or linger a day longer, and how to monitor expiry and extensions. It is written for IAM and IGA engineers who already run joiner, mover and leaver processes and want the dates to be reliable.
Key takeaways
- Every grant needs an end. Temporary, contractor and project access should carry a sunset date when it is approved, not when someone remembers to remove it; NIST SP 800-53 AC-2(2) asks for automatic removal or disabling of temporary and emergency accounts.
- HR owns the dates, IAM owns the timing. Take start and end dates from the HR or vendor management system of record, then convert them to a time of day and time zone that suit the action.
- Store UTC, decide in local time. Directory and governance attributes are UTC timestamps; a date with no time or zone quietly becomes midnight UTC, which is the wrong day for half the world.
- Schedulers add delay. Workflows evaluate on an interval, so access can arrive or leave hours after the stored time; set the timestamp earlier for joiners and plan an immediate path for urgent leavers.
- Expiry needs a conversation. Notify the user and their sponsor before access ends, route extensions through approval, and cap how far an extension can go.
What sunrise and sunset dates are
A sunrise date is the earliest moment an account or entitlement becomes usable. A sunset date is the moment it is disabled or removed. Together they turn access into a bounded grant rather than an open-ended one. They can sit at three levels, and mature programmes use all three:
| Level | Example attribute or setting | Effect when the date passes |
|---|---|---|
| Identity (the person) | Microsoft Entra employeeHireDate and employeeLeaveDateTime; HR hire and termination dates | Joiner or leaver workflow runs: account enabled, or disabled and access removed |
| Account (the directory object) | Active Directory accountExpires | Authentication refused after the expiry time; the account object remains |
| Entitlement (a role, group or access package) | Assignment start and end dates on an access package or request; access duration on a request | That entitlement is removed while the rest of the identity stays active |
The account level is a backstop, not a process. In Active Directory, accountExpires counts 100-nanosecond intervals since 1 January 1601 UTC, and both 0 and 0x7FFFFFFFFFFFFFFF mean the account never expires, which is the default for accounts never given a date. Reports that look only for one of those values will miss accounts that have the other.
Where future-dated access is needed
| Use case | Sunrise | Sunset | Date source and owner |
|---|---|---|---|
| Joiner start | Account created ahead (pre-hire) but disabled; enabled and credentials issued on day one | None at identity level for permanent staff | HR hire or first day of work date; HR |
| Contractor or fixed-term end | Contract start | Contract end date, mandatory at creation | Vendor management system or HR contingent worker record; sponsoring manager |
| Temporary project access | Project start or approval time | Project end, capped by policy (for example 90 days) | Access request; requester with approver and resource owner |
| Leave of absence | Return date re-enables access | Leave start suspends sign-in and sessions | HR absence record; HR and line manager |
| Temporary privileged elevation | Approval time | Hours, not days | PAM or just-in-time request; approver |
| Mover with overlap | New role access on transfer date | Old role access a set number of days after transfer | HR transfer effective date; old and new managers |
| Rehire or conversion | New start date | Old contractor record ends on conversion | HR; IAM must match the identities, not create a second one |
Leavers are covered in depth in the Joiner-Mover-Leaver Guide, and contractor sponsorship in the Contractor Identity Lifecycle Guide. This page focuses on the dates themselves. Short-lived privileged elevation is a related but separate control; see Credential Vaulting vs Just-in-Time Elevation.
How IGA and directories implement it
Most identity governance platforms offer the same three building blocks: an HR connector that imports future-dated records, a scheduler that acts on date attributes, and assignment policies with expiry and extension. Two common platforms are shown below as examples of how the settings look in practice. Platforms are listed alphabetically.
Microsoft Entra ID Governance
- Identity dates: Lifecycle Workflows schedule from
employeeHireDateandemployeeLeaveDateTime, bothDateTimeOffset, populated by HR inbound provisioning, cloud sync or Entra Connect Sync. Graph expectsYYYY-MM-DDThh:mm:ssZ. - Time of day: Microsoft advises a hire time early in the day (such as 1 AM or 5 AM) and a leave time late in the day (such as 9 PM or 11 PM). Workflows never run before the stored time, but the tenant schedule (default three hours) can delay them.
- Triggers: time based attribute, attribute change, group membership change and sign-in inactivity; scheduling must be switched on for each workflow.
- Entitlement expiry: access package policies expire assignments on a date, after 0 to 3,660 days, after a number of hours, or never; a toggle lets users request a specific start and end date.
- Extensions: optional, with approval reusing the request approval settings. Users are emailed 14 days and one day before expiry when extensions are allowed.
See the Entra ID Governance Lifecycle Workflows guide for workflow design.
Okta
- Identity dates: with Workday as profile source, the Pre-Start Interval sets how many days before the hire date a worker becomes eligible to be imported and activated; future-dated updates import ahead by that number of days. The interval is ignored for termination dates.
- Time of day: terminations process at midnight UTC unless Time Zone Aware Deactivation is on; then the worker is deactivated on the next scheduled import after midnight in their own time zone, using preferred time zone, then location, then Pacific time.
- Leaver timing: by default the worker is deactivated the day after the termination date; an option uses the last day of work instead, and immediate termination reasons deactivate at the start of the termination date.
- Entitlement expiry: Okta Identity Governance access request conditions have an Access duration setting: either the admin specifies when access expires, or the requester chooses a duration up to a configured maximum.
- Migration note: Okta documents that moving to Governance Engine removes the access expiration for users whose access was granted by a condition, and advises updating those expirations manually, so plan a review of affected users.
See the Okta Identity Governance Guide for request and certification design.
Whatever the platform, test the exact behaviour in a sandbox: what happens to a user whose hire date moves back, whether a policy change alters existing assignments (in Entra, changing a policy's expiry does not change requests already pending or approved), and what the platform does when a date field is blank.
Time zones, HR dates and edge cases
Most date failures are not software bugs. They are a date without a time, a time without a zone, or an HR record that changes after IAM has acted on it.
| Pitfall | What goes wrong | Fix |
|---|---|---|
| Date-only HR field | Imported as 00:00 UTC; a Sydney joiner is enabled a day late in local terms, a Los Angeles leaver keeps access into the evening of their last day | Convert using the worker's location time zone, then apply start-of-day or end-of-day offsets |
| Scheduler interval | Access arrives up to one interval after the stored time | Set sunrise to start time minus the interval, as Microsoft's own example suggests |
| Backdated termination | HR enters a leaver after the fact with a date in the past; date-triggered workflows that look forward may never fire | Treat past dates as "act now", and alert on any leaver record created after its effective date |
| Start date pushed back | A pre-hire account activated early, or deactivated when the new date falls outside the pre-start window | Keep pre-hire accounts disabled until day one; reconcile changed start dates daily |
| Daylight saving changes | Fixed UTC offsets drift by an hour twice a year | Store IANA time zone names (for example Europe/London), not offsets |
| Source format mismatch | Attribute mapping writes the wrong value or fails silently | Use the documented format expressions for the connector and validate a sample of records after every mapping change |
| No time zone in the source | IAM guesses | Microsoft's guidance is to understand if and how the source provides time zone data and adjust; make location a required HR field |
Temporary credentials have their own clock. Microsoft recommends a 24-hour maximum lifetime for a Temporary Access Pass sent to a new starter, partly because the employee may be in a different time zone. See the Entra Temporary Access Pass Guide.
On-premises Active Directory has no hire or leave date attribute. Microsoft's guidance is to choose a string attribute (for example an extension attribute), write the HR date to it in a fixed format, and map it to the cloud attribute. Document which attribute you chose, because a later project that reuses it will break your leavers.
Monitoring expiry and extensions
A sunset date that nobody hears about turns into an emergency ticket on the morning access disappears. Build the notification and extension path at the same time as the expiry.
- Inventory: list every identity and assignment without an end date where policy says it should have one (contractors, guests, project roles, privileged groups).
- Make the end date mandatory in request forms and HR contingent worker records; reject or default it (for example 90 days) when blank.
- Notify early and late: tell the user and sponsor before expiry (14 days and one day is a common pattern), and tell the sponsor again the day access ends.
- Approve extensions: route through the resource owner or sponsor, with a reason, and cap the extension so it cannot exceed the contract or policy maximum.
- Reconcile daily: compare HR end dates with directory state and assignment expiry; any active account past its HR end date is an incident.
- Roll back safely: for a wrongly expired joiner or contractor, re-enable through the same workflow and record why, rather than by hand in the directory.
Metrics that show it is working
- Bounded grant rate: percentage of contractor, guest and temporary assignments with an end date (target 100%).
- Leaver latency: time from HR end date and time to account disabled, measured in the worker's time zone.
- Day-one readiness: percentage of joiners with working access at their local start time.
- Overstay count: active accounts or assignments past their end date at reconciliation.
- Extension ratio: extensions per expiring assignment; a high ratio means the default duration is wrong or approvers rubber-stamp.
- Backdated leaver count: leaver records entered after their effective date, reported back to HR.
Common failure patterns
- Access outlives the person: the Ledger Connect Kit npm compromise began with a phished former employee whose npm publishing access had never been revoked. Sunset dates on SaaS and developer platform access, not just the directory account, close this gap.
- Directory disabled, apps not: the HR date disables single sign-on but local accounts, API tokens and personal access tokens in SaaS tools stay live. See Orphaned and Dormant Accounts.
- Midnight UTC for everyone: one fixed time for all regions makes access early in some and late in others.
- Extensions without limit: repeated self-service extensions turn temporary access into permanent access with no review.
- Contractors without end dates: created by hand outside HR, with no sponsor, they never reach a leaver workflow.
- Silent scheduler failures: a disabled workflow schedule or failed HR import means no one is joined or left, and nobody notices until an audit.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-2 Account Management (items f, h and l) | Create, enable, disable and remove accounts per defined conditions; notify when accounts are no longer required or users leave; align with personnel processes |
| NIST SP 800-53 Rev 5 | AC-2(2) Automated Temporary and Emergency Account Management; AC-2(3) Disable Accounts | Automatic removal or disabling after a defined period |
| NIST SP 800-53 Rev 5 | PS-4 Personnel Termination; PS-5 Personnel Transfer; PS-7 External Personnel Security | HR and contract dates as the trigger |
| NIST CSF 2.0 | PR.AA-05 | Access permissions managed, enforced and reviewed with least privilege |
| ISO/IEC 27001:2022 Annex A | 5.18 Access rights | Provision, review, modify and remove access rights |
Practitioner checklist
- Name the system of record and owner for every start and end date (HR, vendor management, access request).
- Require an end date for contractors, guests, project roles and privileged assignments, with a policy maximum.
- Convert dates using the worker's location time zone, with start-of-day sunrise and end-of-day sunset offsets.
- Subtract the scheduler interval from sunrise times so access is ready at the local start time.
- Treat backdated leaver records as immediate actions and alert on them.
- Keep pre-hire accounts disabled until day one and reconcile changed start dates daily.
- Notify users and sponsors before expiry and route extensions through approval with a cap.
- Reconcile HR end dates against directory, SaaS and token state daily, and report overstays.
- Test date edge cases (moved start, backdated end, daylight saving week, blank time zone) in a sandbox after each connector change.
Standards and references
- NIST: SP 800-53 Rev 5, Security and Privacy Controls (AC-2, PS-4, PS-5, PS-7)
- Microsoft Learn: How to synchronise attributes for Lifecycle Workflows
- Microsoft Learn: Understanding Lifecycle Workflows
- Microsoft Learn: Change lifecycle settings for an access package
- Microsoft Learn: Account-Expires attribute
- Okta: Workday provisioning
- Okta: Create an access request condition
Related NHI Mgmt Group resources: Joiner-Mover-Leaver Guide · Identity Lifecycle Event Design Guide · Contractor Identity Lifecycle Guide · Access Reviews Guide