codecamp

GitHub 审查组织的审核日志

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

访问审核日志

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

  1. 在 GitHub 的右上角,单击您的个人资料照片,然后单击 Your profile(您的个人资料)

个人资料照片

  1. 在您的个人资料页面左侧的“Organizations(组织)”下,单击组织的图标。

组织图标

  1. 在组织名称下,单击 settingSettings(设置)

组织设置按钮

  1. 在 Setting(设置)边栏中,单击 Audit log(审核日志)

边栏中的组织审核日志设置

搜索审核日志

日志列出每个操作的以下信息:

  • 执行操作的仓库
  • 执行操作的用户
  • 执行的操作内容
  • 发生操作的国家/地区
  • 操作发生的日期和时间

请注意,无法使用文本搜索条目。 但是,您可以使用各种过滤器构建搜索查询。 查询日志时使用的许多运算符,如 -><,与在 GitHub 上搜索时的格式相同。 更多信息请参阅“在 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-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 用户名,而不是个人的真实姓名。

基于执行的操作搜索

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

类别名称 描述
帐户 包含与组织帐户相关的所有活动。
计费,帐单 包含与组织帐单相关的所有活动。
discussion_post 包含与发布到团队页面的讨论相关的所有活动。
discussion_post_reply 包含与回复发布到团队页面的讨论相关的所有活动。
挂钩 包含与 web 挂钩相关的所有活动。
integration_installation_request 包含与组织成员请求所有者批准用于组织的集成相关的所有活动。
marketplace_agreement_signature 包含与签署 GitHub Marketplace 开发者协议相关的所有活动。
marketplace_listing 包含与 GitHub Marketplace 中列出的应用程序相关的所有活动。
org 包含与组织成员资格相关的所有活动。
org_credential_authorization 包含与授权凭据以用于 SAML 单点登录相关的所有活动。
organization_label 包含与组织中仓库的默认标签相关的所有活动。
payment_method 包含与组织如何支付 GitHub 相关的所有活动。
profile_picture 包含与组织的头像相关的所有活动。
project 包含与项目板相关的所有活动。
protected_branch 包含与受保护分支相关的所有活动。
repo 包含与组织拥有的仓库相关的所有活动。
repository_content_analysis 包含与启用或禁用私有仓库的数据使用相关的所有活动。
repository_dependency_graph 包含与启用或禁用私有仓库的依赖关系图相关的所有活动。
repository_vulnerability_alert 包含与有漏洞的依赖项的Dependabot警报相关的所有活动。
sponsors 包含与与赞助者按钮相关的所有事件(请参阅“在仓库中显示赞助者按钮”)
team_discussions 包含与管理组织的团队讨论相关的活动。

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

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

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

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

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

  • account 类别
  • billing 类别
  • discussion_post 类别
  • discussion_post_reply 类别
  • hook 类别
  • integration_installation_request 类别
  • issue 类别
  • marketplace_agreement_signature 类别
  • marketplace_listing 类别
  • org 类别
  • org_credential_authorization 类别
  • organization_label 类别
  • oauth_application 类别
  • payment_method 类别
  • profile_picture 类别
  • project 类别
  • protected_branch 类别
  • repo 类别
  • repository_content_analysis 类别
  • repository_dependency_graph 类别
  • repository_vulnerability_alert 类别
  • sponsors 类别
  • team_discussions 类别

account 类别
操作 Description
billing_plan_change 当组织的结算周期发生更改时触发。
plan_change 当组织的订阅发生更改时触发。
pending_plan_change 当组织所有者或帐单管理员取消或降级付费订阅时触发。
pending_subscription_change 当 GitHub Marketplace 免费试用开始或到期时触发。

billing 类别
操作 描述
change_billing_type 当组织更改 GitHub 的支付方式时触发。
change_email 当组织的帐单电子邮件地址发生更改时触发。

discussion_post 类别
操作 描述
update 团队讨论帖子被编辑时触发。
destroy 团队讨论帖子被删除时触发。

discussion_post_reply 类别
操作 描述
update 团队讨论帖子的回复被编辑时触发。
destroy 团队讨论帖子的回复被删除时触发。

hook 类别
操作 描述
create 新挂钩被添加到组织拥有的仓库时触发.
config_changed 当现有挂钩的配置发生更改时触发。
destroy 从仓库中删除现有挂钩时触发。
events_changed 当挂钩上的事件发生更改时触发。

integration_installation_request 类别
操作 描述
create 当组织成员请求组织所有者安装集成以用于组织时触发。
close 当安装集成以用于组织的请求被组织所有者批准或拒绝,或者被提出请求的组成成员取消时触发。

issue 类别
操作 描述
destroy 当组织所有者或仓库中具有管理员权限的人从组织拥有的仓库中删除议题时触发。

marketplace_agreement_signature 类别
操作 描述
create 在签署 GitHub Marketplace 开发者协议时触发。

marketplace_listing 类别
操作 描述
批准 当您的列表被批准包含在 GitHub Marketplace 中时触发。
create 当您在 GitHub Marketplace 中为应用程序创建列表时触发。
delist 当您的列表从 GitHub Marketplace 中被删除时触发。
redraft 将您的列表被返回到草稿状态时触发。
reject 当您的列表被拒绝包含在 GitHub Marketplace 中时触发。

org 类别
操作 描述
audit_log_export 组织管理员创建组织审核日志导出时触发。 如果导出包含查询,则日志将列出所使用的查询以及与该查询匹配的审核日志条目数量。
block_user 当组织所有者阻止用户访问组织的仓库时触发。
cancel_invitation 当组织邀请被撤销时触发的。
disable_oauth_app_restrictions 当所有者为组织禁用 OAuth 应用程序 访问限制时触发。
disable_saml 当组织管理员禁用组织的 SAML 单点登录时触发。
disable_member_team_creation_permission 当组织所有者将团队创建限于所有者时触发。 更多信息请参阅“设置组织中的团队创建权限”。
disable_two_factor_requirement Triggered when an owner disables a two-factor authentication requirement for all members, billing managers, and outside collaborators in an organization.
enable_oauth_app_restrictions Triggered when an owner enables OAuth 应用程序 access restrictions for your organization.
enable_saml 当组织管理员对组织启用 SAML 单点登录时触发。
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, billing managers, and outside collaborators in an organization.
invite_member Triggered when a new user was invited to join your organization.
oauth_app_access_approved Triggered when an owner grants organization access to an OAuth 应用程序.
oauth_app_access_denied Triggered when an owner disables a previously approved OAuth 应用程序's access to your organization.
oauth_app_access_requested Triggered when an organization member requests that an owner grant an OAuth 应用程序 access to your organization.
remove_billing_manager Triggered when an owner removes a billing manager from an organization or when two-factor authentication is required in an organization and a billing manager doesn't use 2FA or disables 2FA.
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.
revoke_external_identity 当组织所有者撤销成员的链接身份时触发。 更多信息请参阅“查看和管理成员对组织的 SAML 访问”。
revoke_sso_session 当组织所有者撤销成员的 SAML 会话时触发。 更多信息请参阅“查看和管理成员对组织的 SAML 访问”。
unblock_user Triggered when an organization owner unblocks a user from an 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.
update_saml_provider_settings Triggered when an organization's SAML provider settings are updated.
update_terms_of_service Triggered when an organization changes between the Standard Terms of Service and the Corporate Terms of Service. 更多信息请参阅“升级到公司服务条款”。

org_credential_authorization 类别

操作 描述
grant 当成员授权用于 SAML 单点登录的凭据时触发。
deauthorized 当成员取消授权用于 SAML 单点登录的凭据时触发。
revoke 当所有者撤销授权的凭据时触发。

organization_label 类别
操作 描述
create 创建默认标签时触发。
update 编辑默认标签时触发。
destroy 删除默认标签时触发。

oauth_application 类别
操作 描述
create 在创建新 OAuth 应用程序 时触发。
destroy 当现有 OAuth 应用程序 被删除时触发。
reset_secret 当 OAuth 应用程序 的客户端密钥被重置时触发。
revoke_tokens 当 OAuth 应用程序 的用户令牌被撤销时触发。
转让 当现有 OAuth 应用程序 被转让到新组织时触发。

payment_method 类别
操作 描述
clear 当存档的付款方式被删除时触发。
create 在添加新的付款方式(例如新的信用卡或 PayPal 帐户)时触发。
update 当现有付款方式被更新时触发。

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 在分支上更新必需状态检查的实施时触发。
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 当分支更新尝试被拒绝时触发。
policy_override 当仓库管理员重写分支保护要求时触发。
update_allow_force_pushes_enforcement_level 对受保护分支启用或禁用强制推送时触发。
update_allow_deletions_enforcement_level 对受保护分支启用或禁用分支删除时触发。
update_linear_history_requirement_enforcement_level 对受保护分支启用或禁用必要线性提交历史记录时触发。

repo 类别
操作 描述
access 当组织拥有的仓库从“私有”切换到“公共”(反之亦然)时触发。
add_member 当用户接受邀请以获取仓库协作权限时触发。
add_topic 当仓库管理员向仓库添加主题时触发。
archived 当仓库管理员存档仓库时触发。
create 创建新仓库时触发。
destroy 仓库被删除时触发。
禁用 当仓库被禁用(例如,因资金不足)时触发。
启用 在重新启用仓库时触发。
remove_member 仓库中删除用户的协作者身份时触发。
remove_topic 当仓库管理员从仓库中删除主题时触发。
rename 仓库被重命名时触发。
转让 仓库被转让时触发。
transfer_start 在仓库转让即将发生时触发。
unarchived 当仓库管理员取消存档仓库时触发。

repository_content_analysis 类别
操作 描述
启用 当组织所有者或对仓库有管理员权限的人对私有仓库启用数据使用设置时触发。
禁用 当组织所有者或对仓库有管理员权限的人对私有仓库禁用数据使用设置时触发。

repository_dependency_graph 类别
操作 描述
启用 当仓库所有者或对仓库有管理利用权限的人为私有仓库启用依赖关系图时触发。
禁用 当仓库所有者或对仓库有管理利用权限的人为私有仓库禁用依赖关系图时触发。

repository_vulnerability_alert 类别
操作 描述
create 当 GitHub 为特定仓库中有漏洞的依赖项创建Dependabot警报时触发。
解决 当对仓库有写入权限的人推送更改以更新和解决项目依赖项中的漏洞时触发。
忽略 当组织所有者或对仓库具有管理员权限的人忽略
关于有漏洞的依赖项的Dependabot警报时触发。
authorized_users_teams 当组织所有者或对仓库有管理员权限的成员更新有权接收仓库中有漏洞依赖项的Dependabot警报的人员或团队列表时触发。

sponsors 类别

操作 描述
repo_funding_link_button_toggle 在仓库中启用或禁用赞助按钮时触发(请参阅“在仓库中显示赞助按钮”)
repo_funding_links_file_action 更改仓库中的 FUNDING 文件时触发(请参阅“在仓库中显示赞助按钮”)

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" 会找到在美国发生的所有事件。

导出审核日志

您可以将日志导出为 JSON 数据或逗号分隔值 (CSV) 文件。

导出按钮

若要过滤导出结果,请在使用 Export(导出)下拉菜单之前通过一个或多个支持的限定符进行搜索。

限定符 示例值
action team.create
actor octocat
user codertocat
org octo-org
repo octo-org/documentation
created 2019-06-01

将日志导出为 JSON 或 CSV 后,您将在生成的文件中看到以下键和值。

示例值
action team.create
actor octocat
user codertocat
org octo-org
repo octo-org/documentation
created_at 1429548104000 (Timestamp shows the time since Epoch with milliseconds.)
data.hook_id 245
data.events ["issues", "issue_comment", "pull_request", "pull_request_review_comment"]
data.events_were ["push", "pull_request", "issues"]
data.target_login octocat
data.old_user hubot
data.team octo-org/engineering

使用审核日志 API

:审核日志 API 可用于使用 GitHub Enterprise 的组织。 更多信息请参阅“GitHub 的产品”。

要确保组织的 IP 安全和合规性,您可以使用审核日志 API 保留审核日志数据的副本并监控:

  • 对组织或仓库设置的访问。
  • 权限更改。
  • 组织、仓库或团队中添加或删除的用户。
  • 被提升为管理员的用户。
  • 对 GitHub 应用程序权限的更改。

GraphQL 响应可包含长达 90 至 120 天的数据。

例如,您可以创建 GraphQL 请求以查看添加到组织的所有新组织成员。 更多信息请参阅“GraphQL API 审核日志”。

延伸阅读

GitHub 将电子邮件通知限于已批准的域
GitHub 审查组织安装的集成
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

GitHub 身份验证

在 GitHub 上管理订阅和通知

在 GitHub 上管理活动的订阅

GitHub 组织和团队

GitHub 管理对组织仓库的 Git 访问

GitHub 计费和付款

GitHub 使用议题和拉取请求进行协作

GitHub 在具有代码质量功能的仓库上进行协作

管理在 GitHub 上的工作

GitHub 建立强大的社区

GitHub 管理仓库

GitHub 自定义 GitHub 工作流程

在 GitHub Marketplace 中购买并安装应用程序

通过 GitHub Jobs 寻找人才

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }