Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Gerentes de segurança

Use a API REST para gerenciar gerentes de segurança em uma organização.

Sobre os gerentes de segurança

Observação: a função de gerente de segurança está em versão beta pública e sujeita a alterações.

O gerente da segurança é uma função no nível da organização que os proprietários da organização podem atribuir a qualquer equipe em uma organização. Quando aplicado, ele fornece a cada membro da equipe permissões para exibir alertas de segurança e gerenciar configurações para segurança de código em toda a sua organização, bem como permissões de leitura em todos os repositórios da organização.

Aviso: a remoção da função de gerente de segurança de uma equipe removerá a capacidade da equipe de gerenciar alertas e configurações de segurança em toda a organização, mas a equipe manterá o acesso de leitura nos repositórios concedido quando a função foi atribuída. Você precisa remover qualquer acesso de leitura indesejado manualmente. Para obter mais informações, confira "Gerenciar o acesso da equipe em um repositório da organização".

List security manager teams

Funciona com GitHub Apps

Lists teams that are security managers for an organization. For more information, see "Managing security managers in your organization."

To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the read:org scope.

GitHub Apps must have the administration organization read permission to use this endpoint.

Parâmetros para "List security manager teams"

Cabeçalhos
Nome, Type, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Type, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Códigos de status de resposta HTTP para "List security manager teams"

Código de statusDescrição
200

OK

Exemplos de código para "List security manager teams"

get/orgs/{org}/security-managers
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/security-managers

Response

Status: 200
[ { "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", "privacy": "closed", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null } ]

Add a security manager team

Funciona com GitHub Apps

Adds a team as a security manager for an organization. For more information, see "Managing security for an organization for an organization."

To use this endpoint, you must be an administrator for the organization, and you must use an access token with the write:org scope.

GitHub Apps must have the administration organization read-write permission to use this endpoint.

Parâmetros para "Add a security manager team"

Cabeçalhos
Nome, Type, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Type, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Add a security manager team"

Código de statusDescrição
204

No Content

409

The organization has reached the maximum number of security manager teams.

Exemplos de código para "Add a security manager team"

put/orgs/{org}/security-managers/teams/{team_slug}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/security-managers/teams/TEAM_SLUG

Response

Status: 204

Remove a security manager team

Funciona com GitHub Apps

Removes the security manager role from a team for an organization. For more information, see "Managing security managers in your organization team from an organization."

To use this endpoint, you must be an administrator for the organization, and you must use an access token with the admin:org scope.

GitHub Apps must have the administration organization read-write permission to use this endpoint.

Parâmetros para "Remove a security manager team"

Cabeçalhos
Nome, Type, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Type, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Remove a security manager team"

Código de statusDescrição
204

No Content

Exemplos de código para "Remove a security manager team"

delete/orgs/{org}/security-managers/teams/{team_slug}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/security-managers/teams/TEAM_SLUG

Response

Status: 204