Enforcing Time-Based Access Restrictions for Astra Scans on AWS

Last updated: November 24, 2026

You can limit when Astra can use the AWS access you share, for example only between 11:00 AM and 6:00 PM IST on the days of your engagement. Astra's engineers already work within the hours you agree on. An IAM policy adds a hard limit on top of that: AWS blocks the access outside your window, even if a scan is scheduled at the wrong time by mistake.

This article explains which permissions Astra needs, how to write a time-based deny policy, and the limits of this approach.

Permissions Astra needs

Attach these to the IAM user or role you share with Astra:

  • The AWS managed policy SecurityAudit, for visibility into security settings.

  • The AWS managed policy ReadOnlyAccess, for read-only access to resource configuration.

  • A custom policy that denies access outside your approved hours, as described below.

To create the IAM user with the two managed policies, read 📄 How-To: Creating a Security Auditor Role in AWS.

How a time-based deny policy works

AWS always applies an explicit Deny over any Allow. A policy that denies every action during a time range blocks the Astra user during that range, whatever other policies are attached.

IAM checks time with the aws:CurrentTime condition key, which uses UTC. So convert your local window to UTC first. For example, 11:00 AM to 6:00 PM IST is 05:30 to 12:30 UTC.

Sample policy

This sample allows access from 05:30 to 12:30 UTC on 1, 2 and 3 December 2026, and denies it at all other times. The first statement blocks access before the first window, the next two block the nights between the days, and the last one blocks access after the final window. Replace the dates and times with your own.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyBeforeFirstWindow",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "DateLessThan": { "aws:CurrentTime": "2026-12-01T05:30:00Z" }
      }
    },
    {
      "Sid": "DenyNight1",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "DateGreaterThan": { "aws:CurrentTime": "2026-12-01T12:30:00Z" },
        "DateLessThan": { "aws:CurrentTime": "2026-12-02T05:30:00Z" }
      }
    },
    {
      "Sid": "DenyNight2",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "DateGreaterThan": { "aws:CurrentTime": "2026-12-02T12:30:00Z" },
        "DateLessThan": { "aws:CurrentTime": "2026-12-03T05:30:00Z" }
      }
    },
    {
      "Sid": "DenyAfterLastWindow",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "DateGreaterThan": { "aws:CurrentTime": "2026-12-03T12:30:00Z" }
      }
    }
  ]
}

To create the policy, open the IAM console, go to Policies, click Create policy, choose the JSON editor, and paste your version of the policy. Then attach it to the same IAM user or role that has SecurityAudit and ReadOnlyAccess. For details, see AWS's guide to creating IAM policies.

We recommend testing the policy in your own environment before the engagement starts, for example with the IAM policy simulator, and sharing the agreed window with your Astra contact.

Limits of this approach

  • IAM doesn't support recurring time-of-day conditions. Each window has to be written out with full UTC dates and times.

  • To cover more days, update the policy before the last window ends. If the engagement is extended, the user stays blocked until you do.

  • aws:CurrentTime doesn't accept local time zones such as Asia/Kolkata. Always convert to UTC.

  • See AWS's examples of date and time conditions for more patterns.

Automating the policy

For long engagements, you can update the policy automatically, for example with an AWS Lambda function, your CI/CD pipeline or an internal script that writes the next days' windows on a schedule.

If you need help planning access windows for your engagement, contact support from your Astra dashboard or reach out to your CSM.