How GHE.com Streams Audit Logs to Amazon S3 with OIDC

Enterprises on GHE.com can stream audit logs to Amazon S3 using OpenID Connect, without storing a long-lived AWS access key in GitHub. GitHub announced the extension to GitHub Enterprise Cloud with data residency on November 19, 2026. The AWS role must trust the audit-streaming identity for the exact enterprise subdomain.

News brief: November 20, 2026, India time. All identifiers below are placeholders. No AWS role or live audit stream was created for this article.

Earlier capabilityNew availability
S3 audit streaming with OIDC was available for github.com.It now extends to GHE.com enterprises.
Administrators could configure an S3 stream with credentials.OIDC avoids storing a long-lived AWS key in GitHub.

Read the announcement and GitHub’s S3 OIDC procedure. A destination bucket can be outside the enterprise’s residency region; choosing a suitable bucket region remains the administrator’s responsibility.

Separate authentication from event delivery

GitHub’s audit identity service issues the identity token. AWS Security Token Service validates it against the role trust policy and grants temporary role credentials. The audit streaming service uses that access to write objects to S3. The bucket does not authenticate the OIDC token itself.

Prepare four values before touching the policy

For a fictional enterprise, record ENTERPRISE_SUBDOMAIN, a 12-digit ACCOUNT_ID, EXAMPLE-AUDIT-BUCKET and EXAMPLE-AUDIT-ROLE. Replace every placeholder. Use the enterprise’s actual lowercase GHE.com subdomain, not its display name or a GitHub organization name. Ask the AWS administrator to review the target region, retention, encryption and access requirements.

Create the provider and narrowly scoped role

In IAM, add the provider URL https://oidc-configuration.audit-log.githubusercontent.com with audience sts.amazonaws.com. Create a role for web identity federation and attach a bucket-write policy. Follow AWS’s OIDC role guide for the trust setup.

IAM trust policy — placeholder example; not executed
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "arn:aws:iam::ACCOUNT_ID:oidc-provider/oidc-configuration.audit-log.githubusercontent.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "oidc-configuration.audit-log.githubusercontent.com:aud": "sts.amazonaws.com",
          "oidc-configuration.audit-log.githubusercontent.com:sub": "https://ENTERPRISE_SUBDOMAIN.ghe.com"
        }
      }
    }
  ]
}
Role permissions policy — placeholder example; not executed
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::EXAMPLE-AUDIT-BUCKET/*"
    }
  ]
}

Keep S3 Block Public Access enabled. A trust policy decides who may assume the role; the permissions policy decides what that role may do. They solve separate authorization questions. If the bucket requires a customer-managed KMS key, have the administrator evaluate the necessary KMS permissions and key policy rather than copying a broad wildcard grant.

Why an Actions OIDC deployment policy is different

Do not paste a deployment trust policy into this setup. GitHub Actions commonly uses token.actions.githubusercontent.com and repository or environment subject claims. Audit streaming uses the provider above and an enterprise URL subject. A policy can be valid JSON and still reject every audit-streaming token because it expects the wrong issuer or subject.

Configure the stream and collect validation evidence

  1. Open enterprise Settings → Audit log → Log streaming and choose Amazon S3.
  2. Select OpenID Connect authentication.
  3. Enter the intended bucket and region, plus arn:aws:iam::ACCOUNT_ID:role/EXAMPLE-AUDIT-ROLE.
  4. Run Check endpoint. Save only after the check succeeds.
  5. After authorized test activity, inspect a newly delivered object and confirm that its events belong to the intended enterprise.

Proposed acceptance evidence includes the endpoint-check outcome, the role ARN, the bucket region, object creation time and one harmless test event. None of these outcomes were observed in this tutorial.

Is the failure in role assumption or object delivery?

Symptom or evidenceInvestigate first
Role assumption is deniedProvider ARN, audience, exact subdomain subject and role trust policy.
Role assumption succeeds but PutObject failsObject resource ARN, bucket policy, organization restrictions and encryption/key permissions.
Endpoint check passes but expected events are absentStream state, event timing, destination prefix and whether the event is in the stream’s scope.
Duplicate events appearDownstream ingestion should identify repeated events instead of blindly counting every record.

Use AWS CloudTrail evidence for the relevant API calls when available, and retain the exact error without tokens or private event payloads. Check your trail’s event coverage before treating an absent log record as proof that a request never occurred.

Frequently asked questions

Does OIDC make the bucket public?

No. The integration assumes an IAM role. Public bucket access is unnecessary.

Does this automatically keep audit data in the GitHub residency region?

No. Verify the chosen S3 region and downstream processing separately.

What changes if our enterprise subdomain changes?

Review and remove the old subject from role trust policies. Adding a new subject does not revoke an old one.

How should we prove delivery works?

Combine a successful endpoint check with a fresh object and an expected test event. A successful role assumption alone does not prove the S3 write happened.

Related ASP.NET PB reading

For a separate example of avoiding stored AWS access keys in application hosting, see using Secrets Manager from ASP.NET Core on EC2 with an IAM role. An EC2 instance profile is a different identity source from audit-streaming OIDC.

Comments