Accessing the audit log
The audit log lists events triggered by activities that affect your organization within the current month and previous six months. Only owners can access an organization's audit log.
By default, only events from the past three months are displayed. To view older events, you must specify a date range with the created
parameter. 更多信息请参阅“了解搜索语法”。
-
在 GitHub Enterprise Server 的右上角,单击您的头像,然后单击 Your organizations(您的组织)。
-
在组织旁边,单击 Settings(设置)。
-
在 Setting(设置)边� �中,单击 Audit log(审� �日志)。
Searching the audit log
The name for each audit log entry is composed of the action
object or category qualifier, followed by an operation type. For example, the repo.create
entry refers to the create
operation on the repo
category.
每个审� �日志条目都显示有关事件的适用信息,例如:
- The enterprise or organization an action was performed in
- The user (actor) who performed the action
- The user affected by the action
- 执行操作的仓库
- 执行的操作内容
- 发生操作的国家/地区
- 操作发生的日期和时间
请注意,� 法使用文本搜索条目。 但是,您可以使用各种过滤器构建搜索查询。 查询日志时使用的许多运算符,如 -
、>
或 <
,与在 GitHub Enterprise Server 上搜索时的� �式相同。 更多信息请参阅“在 GitHub 上搜索”。
基于操作搜索
使用操作
限定符将操作限于特定类型的操作。 例如:
operation:access
查找其中资源被访问过的所有事件。operation:authentication
查找其中执行了身份验证事件的所有事件。operation:create
查找在其中创建了资源的所有事件。operation:modify
查找在其中修改了现有资源的所有事件。operation:remove
查找在其中� 除的现有资源的所有事件。operation:restore
查找在其中恢复了现有资源的所有事件。operation:transfer
查找在其中转移了现有资源的所有事件。
基于仓库搜索
使用 repo
限定符将操作限于特定仓库。 例如:
repo:my-org/our-repo
会找到在my-org
组织的our-repo
仓库中发生的所有事件。repo:my-org/our-repo repo:my-org/another-repo
会找到在my-org
组织的our-repo
和another-repo
仓库中发生的所有事件。-repo:my-org/not-this-repo
会排除在my-org
组织的not-this-repo
仓库中发生的所有事件。
请注意,您必须在 repo
限定符中包含帐户名称;仅搜索 repo:our-repo
将不起作用。
基于用户搜索
actor
限定符可将事件范围限于执行操作的人员。 例如:
actor:octocat
会找到octocat
执行的所有事件。actor:octocat actor:hubot
会找到octocat
和hubot
执行的所有事件。-actor:hubot
会排除hubot
执行的所有事件。
请注意,只能使用 GitHub Enterprise Server 用户名,而不是个人的真实姓名。
Search based on the action performed
To search for specific events, use the action
qualifier in your query. Actions listed in the audit log are grouped within the following categories:
Category name | Description |
---|---|
discussion_post | Contains all activities related to discussions posted to a team page. |
discussion_post_reply | Contains all activities related to replies to discussions posted to a team page. |
enterprise | Contains activities related to enterprise settings. |
hook | Contains all activities related to webhooks. |
integration_installation_request | Contains all activities related to organization member requests for owners to approve integrations for use in the organization. |
issue | Contains activities related to deleting an issue. |
members_can_create_pages | Contains all activities related to managing the publication of GitHub Pages sites for repositories in the organization. For more information, see "Managing the publication of GitHub Pages sites for your organization." |
org | Contains activities related to organization membership. |
organization_label | Contains all activities related to default labels for repositories in your organization. |
oauth_application | Contains all activities related to OAuth Apps. |
packages | Contains all activities related to GitHub Packages. |
profile_picture | Contains all activities related to your organization's profile picture. |
project | Contains all activities related to project boards. |
protected_branch | Contains all activities related to protected branches. |
repo | Contains activities related to the repositories owned by your organization. |
repository_secret_scanning | Contains repository-level activities related to secret scanning. For more information, see "About secret scanning." |
repository_vulnerability_alert | Contains all activities related to Dependabot 警报. |
secret_scanning | Contains organization-level configuration activities for secret scanning in existing repositories. For more information, see "About secret scanning." |
secret_scanning_new_repos | Contains organization-level configuration activities for secret scanning for new repositories created in the organization. |
team | Contains all activities related to teams in your organization. |
team_discussions | Contains activities related to managing team discussions for an organization. |
You can search for specific sets of actions using these terms. For example:
action:team
finds all events grouped within the team category.-action:hook
excludes all events in the webhook category.
Each category has a set of associated actions that you can filter on. For example:
action:team.create
finds all events where a team was created.-action:hook.events_changed
excludes all events where the events on a webhook have been altered.
Search based on time of action
Use the created
qualifier to filter events in the audit log based on when they occurred. 日期� �式必须遵循 ISO8601� �准,即 YYYY-MM-DD
(年-月-日)。 您也可以在日期后添� 可选的时间信息 THH:MM:SS+00:00
,以便按小时、分钟和秒进行搜索。 这是 T
,随后是 HH:MM:SS
(时-分-秒)和 UTC 偏移 (+00:00
)。
搜索日期时,可以使用大于、小于和范围限定符来进一步筛选结果。 更多信息请参阅“了解搜索语法”。
For example:
created:2014-07-08
finds all events that occurred on July 8th, 2014.created:>=2014-07-08
finds all events that occurred on or after July 8th, 2014.created:<=2014-07-08
finds all events that occurred on or before July 8th, 2014.created:2014-07-01..2014-07-31
finds all events that occurred in the month of July 2014.
Note: The audit log contains data for the current month and every day of the previous six months.
Search based on location
Using the qualifier country
, you can filter events in the audit log based on the originating country. You can use a country's two-letter short code or its full name. Keep in mind that countries with spaces in their name will need to be wrapped in quotation marks. For example:
country:de
finds all events that occurred in Germany.country:Mexico
finds all events that occurred in Mexico.country:"United States"
all finds events that occurred in the United States.
Using the audit log API
You can interact with the audit log using the GraphQL API.
To ensure your intellectual property is secure, and you maintain compliance for your organization, you can use the audit log GraphQL API to keep copies of your audit log data and monitor:
- 对组织或仓库设置的访问
- 权限更改
- 组织、仓库或团队中添� 或� 除的用户
- 被提升为管理员的用户
- GitHub 应用程序 权限的更改
The GraphQL response can include data for up to 90 to 120 days.
For example, you can make a GraphQL request to see all the new organization members added to your organization. For more information, see the "GraphQL API Audit Log."
Audit log actions
An overview of some of the most common actions that are recorded as events in the audit log.
business
category actions
Action | Description |
---|---|
set_actions_retention_limit | Triggered when the retention period for GitHub Actions artifacts and logs is changed for an enterprise. For more information, see "Enforcing policies for GitHub Actions in your enterprise." |
set_fork_pr_workflows_policy | Triggered when the policy for workflows on private repository forks is changed. For more information, see "Enabling workflows for private repository forks." |
discussion_post
category actions
Action | Description |
---|---|
update | Triggered when a team discussion post is edited. |
destroy | Triggered when a team discussion post is deleted. |
discussion_post_reply
category actions
Action | Description |
---|---|
update | Triggered when a reply to a team discussion post is edited. |
destroy | Triggered when a reply to a team discussion post is deleted. |
enterprise
category actions
操作 | 描述 |
---|---|
remove_self_hosted_runner | 当自托管运行器被移除时触发。 |
register_self_hosted_runner | 在注册新的自托管运行器时触发。 更多信息请参阅“添� 自托管的运行器”。 |
runner_group_created | 在创建自托管运行器组时触发。 更多信息请参阅“关于自托管运行器组”。 |
runner_group_removed | 当自托管运行器组被移除时触发。 更多信息请参阅“移除自托管运行器组”。 |
runner_group_runner_removed | 当 REST API 用于从组中� 除自托管运行器时触发。 |
runner_group_runners_added | 当自托管运行器添� 到组时触发。 更多信息请参阅“将自托管运行器移动到组”。 |
runner_group_runners_updated | 当运行器组成员列表更新时触发。 更多信息请参阅“为组织设置组中的自托管运行器”。 |
runner_group_updated | 当自托管运行器组的配置改变时触发。 更多信息请参阅“更改自托管运行器组的访问策略”。 |
self_hosted_runner_updated | 当运行器应用程序更新时触发。 可以使用 REST API 和 UI 查看;在 JSON /CSV 导出中不可见。 更多信息请参阅“关于自托管的运行器”。 |
hook
category actions
Action | Description |
---|---|
create | Triggered when a new hook was added to a repository owned by your organization. |
config_changed | Triggered when an existing hook has its configuration altered. |
destroy | Triggered when an existing hook was removed from a repository. |
events_changed | Triggered when the events on a hook have been altered. |
integration_installation_request
category actions
Action | Description |
---|---|
create | Triggered when an organization member requests that an organization owner install an integration for use in the organization. |
close | Triggered when a request to install an integration for use in an organization is either approved or denied by an organization owner, or canceled by the organization member who opened the request. |
issue
category actions
Action | Description |
---|---|
destroy | Triggered when an organization owner or someone with admin permissions in a repository deletes an issue from an organization-owned repository. |
members_can_create_pages
category actions
For more information, see "Managing the publication of GitHub Pages sites for your organization."
Action | Description |
---|---|
enable | Triggered when an organization owner enables publication of GitHub Pages sites for repositories in the organization. |
disable | Triggered when an organization owner disables publication of GitHub Pages sites for repositories in the organization. |
org
category actions
Action | Description |
---|---|
add_member | Triggered when a user joins an organization. |
advanced_security_policy_selected_member_disabled | Triggered when an enterprise owner prevents GitHub Advanced Security features from being enabled for repositories owned by the organization. 更多信息请参阅“在企业中执行 Advanced Security 的策略”。 |
advanced_security_policy_selected_member_enabled | Triggered when an enterprise owner allows GitHub Advanced Security features to be enabled for repositories owned by the organization. 更多信息请参阅“在企业中执行 Advanced Security 的策略”。 |
create_actions_secret | Triggered when a GitHub Actions secret is created for an organization. For more information, see "Creating encrypted secrets for an organization." |
disable_member_team_creation_permission | Triggered when an organization owner limits team creation to owners. For more information, see "Setting team creation permissions in your organization." |
disable_two_factor_requirement | Triggered when an owner disables a two-factor authentication requirement for all members and outside collaborators in an organization. |
enable_member_team_creation_permission | Triggered when an organization owner allows members to create teams. For more information, see "Setting team creation permissions in your organization." |
enable_two_factor_requirement | Triggered when an owner requires two-factor authentication for all members and outside collaborators in an organization. |
register_self_hosted_runner | Triggered when a new self-hosted runner is registered. For more information, see "Adding a self-hosted runner to an organization." |
remove_actions_secret | Triggered when a GitHub Actions secret is removed. |
remove_member | Triggered when an owner removes a member from an organization or when two-factor authentication is required in an organization and an organization member doesn't use 2FA or disables 2FA. Also triggered when an organization member removes themselves from an organization. |
remove_outside_collaborator | Triggered when an owner removes an outside collaborator from an organization or when two-factor authentication is required in an organization and an outside collaborator does not use 2FA or disables 2FA. |
remove_self_hosted_runner | Triggered when a self-hosted runner is removed. For more information, see "Removing a runner from an organization." |
runner_group_created | Triggered when a self-hosted runner group is created. For more information, see "Creating a self-hosted runner group for an organization." |
runner_group_removed | Triggered when a self-hosted runner group is removed. For more information, see "Removing a self-hosted runner group." |
runner_group_updated | Triggered when the configuration of a self-hosted runner group is changed. For more information, see "Changing the access policy of a self-hosted runner group." |
runner_group_runners_added | Triggered when a self-hosted runner is added to a group. For more information, see Moving a self-hosted runner to a group. |
runner_group_runner_removed | Triggered when the REST API is used to remove a self-hosted runner from a group. For more information, see "Remove a self-hosted runner from a group for an organization." |
runner_group_runners_updated | Triggered when a runner group's list of members is updated. For more information, see "Set self-hosted runners in a group for an organization." |
self_hosted_runner_updated | Triggered when the runner application is updated. Can be viewed using the REST API and the UI; not visible in the JSON/CSV export. For more information, see "About self-hosted runners." |
set_actions_retention_limit | Triggered when the retention period for GitHub Actions artifacts and logs is changed. For more information, see "Enforcing policies for GitHub Actions in your enterprise." |
set_fork_pr_workflows_policy | Triggered when the policy for workflows on private repository forks is changed. For more information, see "Enabling workflows for private repository forks." |
update_actions_secret | Triggered when a GitHub Actions secret is updated. |
update_new_repository_default_branch_setting | Triggered when an owner changes the name of the default branch for new repositories in the organization. For more information, see "Managing the default branch name for repositories in your organization." |
update_default_repository_permission | Triggered when an owner changes the default repository permission level for organization members. |
update_member | Triggered when an owner changes a person's role from owner to member or member to owner. |
update_member_repository_creation_permission | Triggered when an owner changes the create repository permission for organization members. |
organization_label
category actions
Action | Description |
---|---|
create | Triggered when a default label is created. |
update | Triggered when a default label is edited. |
destroy | Triggered when a default label is deleted. |
oauth_application
category actions
Action | Description |
---|---|
create | Triggered when a new OAuth 应用程序 is created. |
destroy | Triggered when an existing OAuth 应用程序 is deleted. |
reset_secret | Triggered when an OAuth 应用程序's client secret is reset. |
revoke_tokens | Triggered when an OAuth 应用程序's user tokens are revoked. |
transfer | Triggered when an existing OAuth 应用程序 is transferred to a new organization. |
packages
category actions
Action | Description |
---|---|
package_version_published | Triggered when a package version is published. |
package_version_deleted | Triggered when a specific package version is deleted. |
package_deleted | Triggered when an entire package is deleted. |
package_version_restored | Triggered when a specific package version is deleted. |
package_restored | Triggered when an entire package is restored. |
profile_picture
category actions
Action | Description |
---|---|
update | Triggered when you set or update your organization's profile picture. |
project
category actions
Action | Description |
---|---|
create | Triggered when a project board is created. |
link | Triggered when a repository is linked to a project board. |
rename | Triggered when a project board is renamed. |
update | Triggered when a project board is updated. |
delete | Triggered when a project board is deleted. |
unlink | Triggered when a repository is unlinked from a project board. |
update_org_permission | Triggered when the base-level permission for all organization members is changed or removed. |
update_team_permission | Triggered when a team's project board permission level is changed or when a team is added or removed from a project board. |
update_user_permission | Triggered when an organization member or outside collaborator is added to or removed from a project board or has their permission level changed. |
protected_branch
category actions
Action | Description |
---|---|
create | Triggered when branch protection is enabled on a branch. |
destroy | Triggered when branch protection is disabled on a branch. |
update_admin_enforced | Triggered when branch protection is enforced for repository administrators. |
update_require_code_owner_review | Triggered when enforcement of required Code Owner review is updated on a branch. |
dismiss_stale_reviews | Triggered when enforcement of dismissing stale pull requests is updated on a branch. |
update_signature_requirement_enforcement_level | Triggered when enforcement of required commit signing is updated on a branch. |
update_pull_request_reviews_enforcement_level | Triggered when enforcement of required pull request reviews is updated on a branch. Can be one of 0 (deactivated), 1 (non-admins), 2 (everyone). |
update_required_status_checks_enforcement_level | Triggered when enforcement of required status checks is updated on a branch. |
update_strict_required_status_checks_policy | Triggered when the requirement for a branch to be up to date before merging is changed. |
rejected_ref_update | Triggered when a branch update attempt is rejected. |
policy_override | Triggered when a branch protection requirement is overridden by a repository administrator. |
update_allow_force_pushes_enforcement_level | Triggered when force pushes are enabled or disabled for a protected branch. |
update_allow_deletions_enforcement_level | Triggered when branch deletion is enabled or disabled for a protected branch. |
update_linear_history_requirement_enforcement_level | Triggered when required linear commit history is enabled or disabled for a protected branch. |
repo
category actions
Action | Description |
---|---|
access | Triggered when a user changes the visibility of a repository in the organization. |
actions_enabled | Triggered when GitHub Actions is enabled for a repository. Can be viewed using the UI. This event is not included when you access the audit log using the REST API. For more information, see "Using the REST API." |
add_member | Triggered when a user accepts an invitation to have collaboration access to a repository. |
add_topic | Triggered when a repository admin adds a topic to a repository. |
advanced_security_disabled | Triggered when a repository administrator disables GitHub Advanced Security features for the repository. For more information, see "Managing security and analysis settings for your repository." |
advanced_security_enabled | Triggered when a repository administrator enables GitHub Advanced Security features for the repository. For more information, see "Managing security and analysis settings for your repository.". |
archived | Triggered when a repository admin archives a repository. |
config.disable_anonymous_git_access | Triggered when anonymous Git read access is disabled in a public repository. |
config.enable_anonymous_git_access | Triggered when anonymous Git read access is enabled in a public repository. |
config.lock_anonymous_git_access | Triggered when a repository's anonymous Git read access setting is locked. |
config.unlock_anonymous_git_access | Triggered when a repository's anonymous Git read access setting is unlocked. |
create | Triggered when a new repository is created. |
create_actions_secret | Triggered when a GitHub Actions secret is created for a repository. For more information, see "Creating encrypted secrets for a repository." |
destroy | Triggered when a repository is deleted. |
enable | Triggered when a repository is re-enabled. |
remove_actions_secret | Triggered when a GitHub Actions secret is removed. |
remove_member | Triggered when a user is removed from a repository as a collaborator. |
register_self_hosted_runner | Triggered when a new self-hosted runner is registered. For more information, see "Adding a self-hosted runner to a repository." |
remove_self_hosted_runner | Triggered when a self-hosted runner is removed. For more information, see "Removing a runner from a repository." |
remove_topic | Triggered when a repository admin removes a topic from a repository. |
rename | Triggered when a repository is renamed. |
self_hosted_runner_updated | Triggered when the runner application is updated. Can be viewed using the REST API and the UI; not visible in the JSON/CSV export. For more information, see "About self-hosted runners." |
set_actions_retention_limit | Triggered when the retention period for GitHub Actions artifacts and logs is changed. For more information, see "Managing GitHub Actions settings for a repository." |
set_fork_pr_workflows_policy | Triggered when the policy for workflows on private repository forks is changed. For more information, see "Managing GitHub Actions settings for a repository." |
transfer | Triggered when a repository is transferred. |
transfer_start | Triggered when a repository transfer is about to occur. |
unarchived | Triggered when a repository admin unarchives a repository. |
update_actions_secret | Triggered when a GitHub Actions secret is updated. |
repository_secret_scanning
category actions
Action | Description |
---|---|
disable | Triggered when a repository owner or person with admin access to the repository disables secret scanning for a repository. For more information, see "About secret scanning." |
enable | Triggered when a repository owner or person with admin access to the repository enables secret scanning for a repository. |
repository_vulnerability_alert
category actions
Action | Description |
---|---|
create | Triggered when GitHub Enterprise Server creates a Dependabot alert for a repository that uses a vulnerable dependency. For more information, see "About Dependabot 警报." |
dismiss | Triggered when an organization owner or person with admin access to the repository dismisses a Dependabot alert about a vulnerable dependency. |
resolve | Triggered when someone with write access to a repository pushes changes to update and resolve a vulnerability in a project dependency. |
secret_scanning
category actions
Action | Description |
---|---|
disable | Triggered when an organization owner disables secret scanning for all existing repositories. For more information, see "About secret scanning." |
enable | Triggered when an organization owner enables secret scanning for all existing repositories. |
secret_scanning_new_repos
category actions
Action | Description |
---|---|
disable | Triggered when an organization owner disables secret scanning for all new repositories. For more information, see "About secret scanning." |
enable | Triggered when an organization owner enables secret scanning for all new repositories. |
team
category actions
Action | Description |
---|---|
add_member | Triggered when a member of an organization is added to a team. |
add_repository | Triggered when a team is given control of a repository. |
change_parent_team | Triggered when a child team is created or a child team's parent is changed. |
change_privacy | Triggered when a team's privacy level is changed. |
create | Triggered when a new team is created. |
demote_maintainer | Triggered when a user was demoted from a team maintainer to a team member. For more information, see "Assigning the team maintainer role to a team member." |
destroy | Triggered when a team is deleted from the organization. |
team.promote_maintainer | Triggered when a user was promoted from a team member to a team maintainer. For more information, see "Assigning the team maintainer role to a team member." |
remove_member | Triggered when a member of an organization is removed from a team. |
remove_repository | Triggered when a repository is no longer under a team's control. |
team_discussions
category actions
Action | Description |
---|---|
disable | Triggered when an organization owner disables team discussions for an organization. For more information, see "Disabling team discussions for your organization." |
enable | Triggered when an organization owner enables team discussions for an organization. |