On this page
Every control in this guide set can be turned off by someone with enough access. The audit log is how you find out when that happens, who did it, and from where. It records organization and enterprise configuration changes, membership and permission changes, repository events, token and app activity, Actions and secret scanning events, and, when streamed, Git and API activity.
This guide covers searching the audit log, querying it through the API, streaming it to your SIEM, and the events worth alerting on.
What is recorded and for how long
- Organization audit log: available to organization owners on all plans, under Settings > Archive > Logs > Audit log.
- Enterprise audit log: covers all organizations in an enterprise, under the enterprise's Settings > Audit log.
- Retention: GitHub keeps audit log events for 180 days in the web interface and API, and Git events for seven days. Anything you need longer, for investigations or compliance, has to be exported or streamed.
- Git events (
git.clone,git.fetch,git.push) are only exposed in the enterprise audit log export, API and streaming, not in the web search. - API request events for REST calls made by users, apps and tokens can be enabled for streaming on Enterprise Cloud, which helps when investigating token misuse.
Search the audit log
The search syntax uses qualifiers:
action:org.update_member
action:repo.destroy created:>=2026-11-01
actor:jdoe action:repo.*
repo:ACME/payments-api action:protected_branch.*
country:"France" -action:git.*
operation:remove category:team
Useful categories to know: org, repo, team, business, protected_branch, repository_ruleset, oauth_application, integration_installation, personal_access_token, secret_scanning, workflows, environment, hook, public_key and deploy_key.
Query it through the API
Scripts and scheduled jobs should use the REST API, which accepts the same phrase syntax:
# Owner role changes in the last 7 days
gh api --paginate \
"/orgs/ACME/audit-log?phrase=action:org.update_member+created:>=$(date -v-7d +%F)&per_page=100" \
--jq '.[] | [.["@timestamp"] / 1000 | todate, .actor, .user, .permission] | @tsv'
# Repository visibility changes
gh api --paginate "/orgs/ACME/audit-log?phrase=action:repo.access" \
--jq '.[] | [.["@timestamp"] / 1000 | todate, .actor, .repo, .visibility] | @tsv'
(date -v-7d is the macOS form; on Linux use date -d '7 days ago' +%F.) The enterprise endpoint is /enterprises/ENTERPRISE/audit-log, and including Git events requires include=all there. Rate limits apply, which is another reason to stream for continuous monitoring.
Stream to your SIEM
On GitHub Enterprise Cloud, audit log streaming pushes events continuously to:
- Amazon S3 (with OIDC authentication available, avoiding stored access keys)
- Azure Blob Storage
- Azure Event Hubs
- Datadog
- Google Cloud Storage
- Splunk (HTTP Event Collector)
Configure it under the enterprise's Settings > Audit log > Log streaming. GitHub verifies the endpoint before streaming starts. Streaming includes Git events and, if enabled, API request events, and it continues to buffer for a period if the endpoint is unavailable.
Recommendations:
- Stream from the enterprise, not per organization, so new organizations are covered automatically.
- Enable source IP disclosure in the enterprise audit log settings, so events carry the actor's IP address. Without it, investigating a stolen session or token is much harder. Inform users as your privacy rules require, since this is personal data.
- Use OIDC for the S3 destination instead of an IAM user key, for the same reasons as in the OIDC guide.
- Monitor the stream itself: an alert when no GitHub events arrive for an hour catches a broken or disabled stream. Changes to the stream configuration are themselves recorded in the enterprise audit log; alert on them too.
If you are on GitHub Team or Free, poll the organization API on a schedule and ship the results to your log platform. It is less complete (no Git events) but far better than nothing.
Events worth alerting on
Not every event deserves a page. These are high signal for most organizations:
Identity and access
org.update_memberwhere the role becomesadmin(new owner).org.add_outside_collaboratorandrepo.add_memberfor people outside the organization.org.disable_two_factor_requirement,org.disable_saml,business.disable_saml, changes to SAML provider settings (see the SSO guide).- IP allow list changes (
ip_allow_list.disable,ip_allow_list_entry.create).
Repository protection
repo.accesschanging a repository to public.repo.destroy,repo.transfer,repo.archivedon critical repositories.protected_branch.destroy,protected_branch.update_*andrepository_ruleset.destroyor.update(see rulesets).protected_branch.policy_overrideand ruleset bypasses: someone merged past the rules.
Credentials and integrations
personal_access_token.request_createdand.access_granted, especially with broad repository selection (token policies).integration_installation.createandoauth_applicationapprovals.public_key.createfor deploy keys andhook.createfor webhooks, both classic persistence paths.secret_scanning_push_protection.bypassand disabling of secret scanning (see secret scanning).
Actions
org.update_actions_settingsor changes to default workflow permissions and allowed actions policy.org.register_self_hosted_runnerand runner group changes (self-hosted runners).environment.update_protection_ruleorenvironment.deleteon production environments.- Creation or update of organization secrets (
org.create_actions_secret,org.update_actions_secret).
Data access patterns (streaming only)
- A user or token cloning an unusual number of repositories in a short time (
git.clonevolume per actor). This is the common signature of source code exfiltration after a token theft. - API request bursts from a token against repository contents endpoints.
Exact action names evolve; validate each rule against real events in your log before relying on it, by triggering the change in a test organization and checking what arrives.
An example detection
In Splunk, assuming events land in an index named github:
index=github action="git.clone"
| bin _time span=1h
| stats dc(repo) AS repos BY _time, actor, actor_ip
| where repos > 50
Tune the threshold to your normal CI behaviour: build systems clone many repositories legitimately, so exclude their app or bot actors explicitly rather than raising the threshold for everyone.
A weekly review without a SIEM
Smaller organizations without a SIEM can still get most of the value from a scheduled job that queries the API and posts a summary to the security team. Run it from a dedicated repository with a GitHub App token that has organization administration read permission, and keep the output as an artifact for traceability:
since=$(date -d '7 days ago' +%F)
for q in "action:org.update_member" "action:org.add_outside_collaborator" \
"action:repo.access" "action:protected_branch.destroy" \
"action:repository_ruleset.destroy" "action:hook.create" \
"action:integration_installation.create" \
"action:org.register_self_hosted_runner"; do
echo "## $q"
gh api --paginate "/orgs/ACME/audit-log?phrase=$q+created:>=$since&per_page=100" \
--jq '.[] | [(.["@timestamp"] / 1000 | todate), .actor, (.repo // ""), (.user // "")] | @tsv'
done > weekly-audit.txt
An empty report is a good report. Anything in it should be explainable by a known change; the rest deserves a conversation with the actor.
Investigations
When something has gone wrong, the audit log answers the first questions:
- Who and from where:
actor,actor_ip,user_agent, and for token activity,programmatic_access_typeandhashed_token. The hashed token value lets you correlate actions to one specific token without exposing it. - What else did that actor do: filter by actor across all categories for the window of interest.
- What changed in configuration: filter by categories
org,repository_ruleset,hook,public_key,integration_installation. - What did workflows do: combine with Actions run logs, which have their own retention (90 days by default for public and private repositories, configurable).
Export the relevant events immediately; retention runs out faster than investigations do.
References
- Reviewing the audit log for your organization (GitHub Docs)
- Streaming the audit log for your enterprise (GitHub Docs)
- Audit log events for your enterprise (GitHub Docs)
- Searching the audit log for your enterprise (GitHub Docs)
- REST API endpoints for organizations: get the audit log (GitHub Docs)
- NIST SP 800-92 Guide to Computer Security Log Management
- MITRE ATT&CK T1213.003: Data from Information Repositories: Code Repositories
- MITRE ATT&CK T1098: Account Manipulation
Tags:auditingorganization
Written by
Florian Amette, Security Engineer & EditorSecurity engineer writing practical hardening guides for GitHub organizations, repositories and CI/CD pipelines, with a focus on software supply-chain security.