我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2020-05-23. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

文章版本: Enterprise Server 2.17

审查组织的审核日志

审核日志允许组织管理员快速审查组织成员执行的操作。 其中包含操作执行人、操作内容和执行时间等详细信息。

本文内容

访问审核日志

审核日志列出了过去 90 天内执行的操作。 只有所有者才能访问组织的审核日志。

  1. 在 GitHub Enterprise 的右上角,单击您的个人资料照片,然后单击 Your profile(您的个人资料)
    Profile photo
  2. 在您的个人资料页面左侧的“Organizations(组织)”下,单击组织的图标。
    组织图标
  3. 在组织名称下,单击 Settings(设置)
    组织设置按钮
  4. 在 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-repoanother-repo 仓库中发生的所有事件。
  • -repo:my-org/not-this-repo 会排除在 my-org 组织的 not-this-repo 仓库中发生的所有事件。

请注意,您必须在 repo 限定符中包含帐户名称;仅搜索 repo:our-repo 将不起作用。

基于用户搜索

actor 限定符可将事件范围限于执行操作的人员。 例如:

  • actor:octocat 会找到 octocat 执行的所有事件。
  • actor:octocat actor:hubot 会找到 octocathubot 执行的所有事件。
  • -actor:hubot 会排除 hubot 执行的所有事件。

请注意,只能使用 GitHub Enterprise 用户名,而不是个人的真实姓名。

基于执行的操作搜索

要搜索特定事件,请在查询中使用 action 限定符。 审核日志中列出的操作分为以下类别:

类别名称描述
discussion_postContains all activities related to discussions posted to a team page.
discussion_post_replyContains all activities related to replies to discussions posted to a team page.
挂钩包含与 web 挂钩相关的所有活动。
integration_installation_requestContains all activities related to organization member requests for owners to approve integrations for use in the organization.
orgContains all activities related to organization membership
profile_pictureContains all activities related to your organization's profile picture.
project包含与项目板相关的所有活动。
protected_branchContains all activities related to protected branches.
repoContains all activities related to the repositories owned by your organization.
repository_vulnerability_alertContains all activities related to security alerts for vulnerable dependencies.
团队Contains all activities related to teams in your organization.
team_discussionsContains activities related to managing team discussions for an organization.

您可以使用这些词搜索特定的操作集。 例如:

  • action:team 会找到团队类别中的所有事件。
  • -action:hook 会排除 web 挂钩类别中的所有事件。

每个类别都有一组可进行过滤的关联事件。 例如:

  • action:team.create 会找到团队创建处的所有事件。
  • -action:hook.events_changed 会排除 web 挂钩上事件已经改动的所有事件。

此列表描述可用的类别及关联的事件:

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_permissionTriggered when an organization owner limits team creation to owners. 更多信息请参阅“设置组织中的团队创建权限”。
disable_two_factor_requirementTriggered when an owner disables a two-factor authentication requirement for all members and outside collaborators in an organization.
enable_member_team_creation_permissionTriggered when an organization owner allows members to create teams. 更多信息请参阅“设置组织中的团队创建权限”。
enable_two_factor_requirementTriggered when an owner requires two-factor authentication for all members and outside collaborators in an organization.
invite_memberTriggered when a new user was invited to join your organization.
remove_memberTriggered 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_collaboratorTriggered 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_permissionTriggered when an owner changes the default repository permission level for organization members.
update_memberTriggered when an owner changes a person's role from owner to member or member to owner.
update_member_repository_creation_permissionTriggered 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_overrideTriggered 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" 会找到在美国发生的所有事件。

延伸阅读

问问别人

找不到要找的内容?

联系我们