GitHub Audit Log 来源配置 - Amazon CloudWatch
注意

重要提示:必须有 GitHub Enterprise 账户才能使用此连接器。不支持 GitHub 个人或组织账户。

GitHub Audit Log 来源配置

将 与 GitHub 集成

Amazon Telemetry Pipelines 让您能够从 GitHub Enterprise Cloud 收集审计日志。GitHub Enterprise 是一个企业级软件开发平台,专为现代开发的复杂工作流而设计。GitHub Enterprise Cloud 是 GitHub Enterprise 基于云的解决方案,托管在 GitHub 的服务器上。

使用 GitHub 进行身份验证

要读取审计日志,管道需要使用您的 GitHub 账户进行身份验证。对于企业范围,您可以使用个人访问令牌;对于组织范围,您可以使用个人访问令牌或 GitHub 应用程序。

生成令牌以作为个人访问令牌进行身份验证:

  • 使用 GitHub 账户的凭证登录 GitHub

  • 经过身份验证的用户必须是企业管理员才能使用此端点

  • 打开 GitHub 个人访问令牌(经典)页面,找到“生成新令牌(经典)”,然后按照 GitHub 过程生成具有 read:audit_log 范围且无到期日期的令牌

  • 将此新令牌存储在 personal_access_token 键下 AWS Secrets Manager 中的密钥内

生成私有密钥以作为 GitHub 应用程序进行身份验证:

  • 使用 GitHub 账户的凭证登录 GitHub

  • 确保 GitHub 应用程序具有“管理”组织权限(读取)权限

  • 按照管理 GitHub 应用程序的私有密钥中的说明生成私有密钥

  • 将此私有密钥存储在 private_key 键下 AWS Secrets Manager 中的密钥内,并将 GitHub 应用程序名称存储在 app_id 键下

配置 CloudWatch 管道

将管道配置为从 GitHub Enterprise Cloud 读取审计日志时,请选择 GitHub Audit Logs 作为数据来源。根据集成范围将来源类型选择为“企业”或“组织”,然后根据所选范围填写必填信息,例如企业名称或组织名称。创建管道后,数据将在选定的 CloudWatch Logs 日志组中可用。

支持的开放式网络安全架构框架事件类

此集成支持 OCSF 架构版本 1.5.0 以及映射到“账户变更”(3001)、“API 活动”(6003)和“实体管理”(3004)的 GitHub 操作

账户变更包含以下操作:

  • org.enable_two_factor_requirement

  • org.disable_two_factor_requirement

  • two_factor_authentication.add_factor

  • two_factor_authentication.enabled

  • two_factor_authentication.disabled

  • two_factor_authentication.remove_factor

  • org.disable_saml

  • org.enable_saml

  • personal_access_token.access_restriction_disabled

  • personal_access_token.access_restriction_enabled

  • personal_access_token.expiration_limit_set

  • personal_access_token.expiration_limit_unset

API 活动包含以下操作:

  • repository_secret_scanning_custom_pa....create

  • repository_secret_scanning_custom_pa....update

  • repository_secret_scanning_custom_pa....delete

  • repository_secret_scanning_custom_pa....publish

  • repository_secret_scanning_custom_p....enabled

  • repository_secret_scanning_custom_p....disabled

  • repository_secret_scanning_non_provi....enabled

  • repository_secret_scanning_non_provi....disabled

  • repository_secret_scanning_generic_s....enabled

  • repository_secret_scanning_generic_s....disabled

  • business_secret_scanning_custom_pattern.create

  • business_secret_scanning_custom_pattern.update

  • business_secret_scanning_custom_pattern.delete

  • business_secret_scanning_custom_pattern.publish

  • business_secret_scanning_custom_patt....enabled

  • business_secret_scanning_custom_patt....disabled

  • business_secret_scanning_generic_secrets.enabled

  • business_secret_scanning_generic_secrets.disabled

  • business_secret_scanning_non_provide....enabled

  • business_secret_scanning_non_provide....disabled

  • org_secret_scanning_non_provider_patt....enabled

  • org_secret_scanning_non_provider_patt....disabled

  • org_secret_scanning_generic_secrets.enabled

  • org_secret_scanning_generic_secrets.disabled

  • org_secret_scanning_custom_pattern.create

  • org_secret_scanning_custom_pattern.update

  • org_secret_scanning_custom_pattern.delete

  • org_secret_scanning_custom_pattern.publish

实体管理包含以下操作:

  • oauth_application.destroy

  • oauth_application.generate_client_secret

  • oauth_application.remove_client_secret

  • oauth_application.revoke_all_tokens

  • oauth_application.revoke_tokens

  • oauth_application.transfer

  • personal_access_token.auto_approve_grant_requests_enabled

  • personal_access_token.auto_approve_grant_requests_disabled

  • ip_allow_list.disable

  • ip_allow_list.enable_for_installed_apps

  • ip_allow_list.disable_for_installed_apps

  • ip_allow_list_entry.create

  • ip_allow_list_entry.update

  • ip_allow_list_entry.destroy

  • repository_secret_scanning.disable

  • repository_secret_scanning_automatic....disabled

  • repository_secret_scanning_push_prot....disable

  • repository_secret_scanning_push_prot....enable

  • oauth_application.create

  • oauth_application.reset_secret

  • auto_approve_personal_access_token_req....enabled

  • auto_approve_personal_access_token_req....disabled

  • ip_allow_list.enable

  • ip_allow_list.disable_user_level_enforcement

  • ip_allow_list.enable_user_level_enforcement

  • repository_secret_scanning.enable

  • repository_secret_scanning_automatic....enabled

  • repository_secret_scanning_push_prot....enable

  • repository_secret_scanning_push_prot....add

  • repository_secret_scanning_push_prot....remove

  • repository_secret_scanning_push_prot....disable

  • secret_scanning.enable

  • secret_scanning.disable

  • secret_scanning_new_repos.enable

  • org_secret_scanning_automatic_validi....enabled

  • org_secret_scanning_automatic_validi....disabled

  • org_secret_scanning_push_protection_b....add

  • org_secret_scanning_push_protection_b....remove

  • org_secret_scanning_push_protection_b....disable

  • org_secret_scanning_push_protection_b....enable

  • business_secret_scanning_automatic_va....enabled

  • business_secret_scanning_automatic_va....disabled

  • business_secret_scanning_push_protection.enable

  • business_secret_scanning_push_protection.disable

  • business_secret_scanning_push_protection.enabled_for_new_repos

  • business_secret_scanning_push_protection.disabled_for_new_repos

  • business_secret_scanning_push_prote....enable

  • business_secret_scanning_push_prote....update

  • business_secret_scanning_push_prote....disable