文章版本: Enterprise Server 2.17
审查组织的审核日志
审核日志允许组织管理员快速审查组织成员执行的操作。 其中包含操作执行人、操作内容和执行时间等详细信息。
访问审核日志
审核日志列出了过去 90 天内执行的操作。 只有所有者才能访问组织的审核日志。
- 在 GitHub Enterprise 的右上角,单击您的个人资料照片,然后单击 Your profile(您的个人资料)。  
- 在您的个人资料页面左侧的“Organizations(组织)”下,单击组织的图标。  
- 在组织名称下,单击  Settings(设置)。  
- 在 Setting(设置)边栏中,单击 Audit log(审核日志)。  
搜索审核日志
日志列出每个操作的以下信息:
- 执行操作的仓库
- 执行操作的用户
- 执行的操作内容
- 发生操作的国家/地区
- 操作发生的日期和时间
请注意,无法使用文本搜索条目。 但是,您可以使用各种过滤器构建搜索查询。 查询日志时使用的许多运算符,如 -、> 或 <,与在 GitHub Enterprise 上搜索时的格式相同。 更多信息请参阅“在 GitHub 上搜索”。
基于仓库搜索
使用 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 用户名,而不是个人的真实姓名。
基于执行的操作搜索
要搜索特定事件,请在查询中使用 action 限定符。 审核日志中列出的操作分为以下类别:
| 类别名称 | 描述 | 
|---|---|
| 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. | 
| 挂钩 | 包含与 web 挂钩相关的所有活动。 | 
| integration_installation_request | Contains all activities related to organization member requests for owners to approve integrations for use in the organization. | 
| org | Contains all activities related to organization membership | 
| profile_picture | Contains all activities related to your organization's profile picture. | 
| project | 包含与项目板相关的所有活动。 | 
| protected_branch | Contains all activities related to protected branches. | 
| repo | Contains all activities related to the repositories owned by your organization. | 
| repository_vulnerability_alert | Contains all activities related to security alerts for vulnerable dependencies. | 
| 团队 | Contains all activities related to teams in your organization. | 
| team_discussions | Contains activities related to managing team discussions for an organization. | 
您可以使用这些词搜索特定的操作集。 例如:
- action:team会找到团队类别中的所有事件。
- -action:hook会排除 web 挂钩类别中的所有事件。
每个类别都有一组可进行过滤的关联事件。 例如:
- action:team.create会找到团队创建处的所有事件。
- -action:hook.events_changed会排除 web 挂钩上事件已经改动的所有事件。
此列表描述可用的类别及关联的事件:
- discussion_post类别
- discussion_post_reply类别
- hook类别
- integration_installation_request类别
-  issue类别
- The orgcategory
-  oauth_application类别
- profile_picture类别
- project类别
- protected_branch类别
- repo类别
- repository_vulnerability_alert类别
- team类别
- team_discussions类别
discussion_post 类别
| 操作 | 描述 | 
|---|---|
| update | 当团队讨论帖子被编辑时触发。 | 
| destroy | 当团队讨论帖子被删除时触发。 | 
discussion_post_reply 类别
| 操作 | 描述 | 
|---|---|
| update | 当团队讨论帖子的回复被编辑时触发。 | 
| destroy | 当团队讨论帖子的回复被删除时触发。 | 
hook 类别
| 操作 | 描述 | 
|---|---|
| create | 当新挂钩被添加到组织拥有的仓库时触发. | 
| config_changed | 当现有挂钩的配置发生更改时触发。 | 
| destroy | 从仓库中删除现有挂钩时触发。 | 
| events_changed | 当挂钩上的事件发生更改时触发。 | 
integration_installation_request 类别
| 操作 | 描述 | 
|---|---|
| create | 当组织成员请求组织所有者安装集成以用于组织时触发。 | 
| close | 当安装集成以用于组织的请求被组织所有者批准或拒绝,或者被提出请求的组成成员取消时触发。 | 
issue 类别
| 操作 | 描述 | 
|---|---|
| destroy | 当组织所有者或仓库中具有管理员权限的人从组织拥有的仓库中删除议题时触发。 | 
org 类别
| 操作 | 描述 | 
|---|---|
| disable_member_team_creation_permission | Triggered when an organization owner limits team creation to owners. 更多信息请参阅“设置组织中的团队创建权限”。 | 
| 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. 更多信息请参阅“设置组织中的团队创建权限”。 | 
| enable_two_factor_requirement | Triggered when an owner requires two-factor authentication for all members and outside collaborators in an organization. | 
| invite_member | Triggered when a new user was invited to join your organization. | 
| 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. | 
| 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. | 
oauth_application 类别
| 操作 | 描述 | 
|---|---|
| create | 在创建新 OAuth 应用程序 时触发。 | 
| destroy | 当现有 OAuth 应用程序 被删除时触发。 | 
| reset_secret | 当 OAuth 应用程序 的客户端密钥被重置时触发。 | 
| revoke_tokens | 当 OAuth 应用程序 的用户令牌被撤销时触发。 | 
| 转让 | 当现有 OAuth 应用程序 被转让到新组织时触发。 | 
profile_picture 类别
| 操作 | 描述 | 
|---|---|
| update | 在设置或更新组织的资料图片时触发。 | 
project 类别
| 操作 | 描述 | 
|---|---|
| create | 在创建项目板时触发。 | 
| link | 当仓库被链接到项目板时触发。 | 
| rename | 当项目板被重命名时触发。 | 
| update | 当项目板被更新时触发。 | 
| delete | 在删除项目板时触发。 | 
| unlink | 当仓库从项目板解除链接时触发。 | 
| update_org_permission | 当所有组织成员的基本级别权限被更改或删除时触发。 | 
| update_team_permission | 当团队的项目板权限级别被更改,或者在项目板中添加或删除团队时触发。 | 
| update_user_permission | 在项目板中添加或删除组织成员或外部协作者时,或者他们的权限级别被更改时触发。 | 
protected_branch 类别
| 操作 | 描述 | 
|---|---|
| create | 在分支上启用分支保护时触发。 | 
| destroy | 在分支上禁用分支保护时触发。 | 
| update_admin_enforced | 为仓库管理员实施分支保护时触发。 | 
| update_require_code_owner_review | 在分支上更新必需代码所有者审查的实施时触发。 | 
| dismiss_stale_reviews | 在分支上更新忽略旧拉取请求的实施时触发。 | 
| update_signature_requirement_enforcement_level | 在分支上更新必需提交签名的实施时触发。 | 
| update_pull_request_reviews_enforcement_level | 在分支上更新必需拉取请求审查的实施时触发。 | 
| update_required_status_checks_enforcement_level | 在分支上更新必需状态检查的实施时触发。 | 
| rejected_ref_update | 当分支更新尝试被拒绝时触发。 | 
| policy_override | Triggered when a branch protection requirement is overridden by a repository administrator. | 
repo 类别
| 操作 | 描述 | 
|---|---|
| access | 当组织拥有的仓库从“私有”切换到“公共”(反之亦然)时触发。 | 
| add_member | 当用户接受邀请以获取仓库协作权限时触发。 | 
| add_topic | 当仓库管理员向仓库添加主题时触发。 | 
| archived | 当仓库管理员存档仓库时触发。 | 
| config.disable_anonymous_git_access | 当公共仓库中禁用匿名 Git 读取权限时触发。 | 
| config.enable_anonymous_git_access | 当公共仓库中启用匿名 Git 读取权限时触发。 | 
| config.lock_anonymous_git_access | 当仓库的匿名 Git 读取权限设置被锁定时触发。 | 
| config.unlock_anonymous_git_access | 当仓库的匿名 Git 读取权限设置被解锁时触发。 | 
| create | 在创建新仓库时触发。 | 
| destroy | 当仓库被删除时触发。 | 
| 启用 | 在重新启用仓库时触发。 | 
| remove_member | 从仓库中删除用户的协作者身份时触发。 | 
| remove_topic | 当仓库管理员从仓库中删除主题时触发。 | 
| rename | 当仓库被重命名时触发。 | 
| 转让 | 当仓库被转让时触发。 | 
| transfer_start | 在仓库转让即将发生时触发。 | 
| unarchived | 当仓库管理员取消存档仓库时触发。 | 
repository_vulnerability_alert 类别
| 操作 | 描述 | 
|---|---|
| create | 当 GitHub Enterprise 为特定仓库中的易受攻击依赖项创建安全警报时触发。 | 
| 解决 | 当对仓库有写入权限的人推送更改以更新和解决项目依赖项中的漏洞时触发。 | 
| 忽略 | 当组织所有者或对仓库有管理员权限的人忽略有关易受攻击依赖项的安全警报时触发。 | 
team 类别
| 操作 | 描述 | 
|---|---|
| add_member | 当组织成员被添加到团队时触发。 | 
| add_repository | 当团队被授予控制仓库的权限时触发。 | 
| change_parent_team | 在创建子团队或更改子团队的父级时触发。 | 
| change_privacy | 当团队的隐私级别发生更改时触发。 | 
| create | 在创建新团队时触发。 | 
| destroy | 从组织中删除团队时触发。 | 
| remove_member | 从团队中删除组织成员时触发。 | 
| remove_repository | 当仓库不再受团队控制时触发。 | 
team_discussions 类别
| 操作 | 描述 | 
|---|---|
| 禁用 | 当组织所有者对组织禁用团队讨论时触发。 更多信息请参阅“对组织禁用团队讨论”。 | 
| 启用 | 当组织所有者对组织启用团队讨论时触发。 | 
基于操作时间搜索
使用 created 限定符在审核日志中根据操作发生的时间过滤操作。 日期格式必须遵循 ISO8601标准,即 YYYY-MM-DD(年-月-日)。 您也可以在日期后添加可选的时间信息 THH:MM:SS+00:00,以便按小时、分钟和秒进行搜索。 这是 T,随后是 HH:MM:SS(时-分-秒)和 UTC 偏移 (+00:00)。
日期支持大于、小于和范围限定符。 例如:
- created:2014-07-08会找到在 2014 年 7 月 8 日发生的所有事件。
- created:>=2014-07-08查找在 2014 年 7 月 8 日或之后发生的所有事件。
- created:<=2014-07-08查找在 2014 年 7 月 8 日或之前发生的所有事件。
- created:2014-07-01..2014-07-31会找到在 2014 年 7 月发生的所有事件。
审核日志包含过去 90 天的数据,但使用 created 限定符可搜索更早发生的事件。
基于位置搜索
使用限定符 country,您可以在审核日志中根据发生操作的国家/地区过滤操作。 您可以使用国家/地区的两字母短代码或完整名称。 请注意,名称中包含空格的国家/地区需要加引号。 例如:
- country:de会找到在德国发生的所有事件。
- country:Mexico会找到在墨西哥发生的所有事件。
- country:"United States"会找到在美国发生的所有事件。
延伸阅读
- “保护组织安全”