정책 업데이트

정책 업데이트 (Update policy)

PATCH /orgs/{org_name}/governance/policies/{policy_id} — 정책의 메타데이터를 부분적으로 업데이트해요. 요청 본문에 있는 필드만 업데이트되고 없는 필드는 그대로 남아요. scope 객체는 하위 필드별로 패치돼요. teams를 보내면 그 목록을 대체하고, 생략된 하위 필드는 그대로 두며, 빈 목록은 지워요(조직 전체).

출처: 문서

본문

API 버전 1 — Update policy · PATCH /orgs/{org_name}/governance/policies/{policy_id}

정책의 메타데이터를 부분적으로 업데이트해요. 요청 본문에 있는 필드만 업데이트되고 없는 필드는 그대로 남아요. scope 객체는 하위 필드별로 패치돼요. teams를 보내면 그 목록을 대체하고, 생략된 하위 필드는 그대로 두며, 빈 목록은 지워요(조직 전체).

규칙 세트는 여기서 수정되지 않아요. 그건 규칙 엔드포인트를 사용하세요. 필수 필드가 하나 이상 있어야 해요. 정책을 이전과 새 상태 모두로 반환해요. 변경 사항은 개발자 머신에 도달하는 데 최대 5분이 걸릴 수 있어요.

연결 및 접근 (Connection and access)

API 연결 및 인증 안내

https://hub.docker.com/v2

다음 대안 중 하나를 사용해요. 한 대안 안의 요구 사항은 함께 적용돼요.

  • bearerAuth

파라미터

org_name

path · 필수 — Docker Hub 조직 이름. 유형: string

{
  "type": "string"
}

policy_id

path · 필수 — 고유 정책 식별자. 유형: string

{
  "type": "string"
}

요청 및 응답

Media type: application/json

요청 (Request)

업데이트할 필드. 없는 필드는 그대로 남아요.

스키마: UpdatePolicyRequest

rename:

{
  "name": "Security Research"
}

scope:

{
  "scope": {
    "teams": [
      "d290f1ee-6c54-4b01-90e6-d701748f0851"
    ]
  }
}

응답 200

정책 업데이트됨, 이전과 새 상태 반환.

스키마: UpdatePolicyResponse

{
  "new": {
    "allowlist_v0": {
      "domain": "network",
      "rules": [
        {
          "actions": [
            "connect:tcp",
            "connect:udp"
          ],
          "decision": "allow",
          "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
          "name": "allow research mirrors",
          "resources": [
            "research.mitre.org",
            "cve.mitre.org"
          ]
        }
      ]
    },
    "created_at": "2026-04-22T00:00:00Z",
    "id": "pol_06evsmp24r1pg71cm8500546pkbn",
    "name": "Security Research",
    "org": "my-org",
    "scope": {
      "teams": [
        "d290f1ee-6c54-4b01-90e6-d701748f0851"
      ]
    },
    "updated_at": "2026-04-22T10:00:00Z"
  },
  "old": {
    "allowlist_v0": {
      "domain": "network",
      "rules": [
        {
          "actions": [
            "connect:tcp",
            "connect:udp"
          ],
          "decision": "allow",
          "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
          "name": "allow research mirrors",
          "resources": [
            "research.mitre.org",
            "cve.mitre.org"
          ]
        }
      ]
    },
    "created_at": "2026-04-22T00:00:00Z",
    "id": "pol_06evsmp24r1pg71cm8500546pkbn",
    "name": "Security Research — hardened",
    "org": "my-org",
    "scope": {
      "teams": [
        "d290f1ee-6c54-4b01-90e6-d701748f0851"
      ]
    },
    "updated_at": "2026-04-22T00:00:00Z"
  }
}

응답 400

Bad request · 스키마: Error

{
  "error": {
    "code": "invalid_argument",
    "message": "name is required"
  }
}

응답 401

Missing or invalid credentials · 스키마: Error

{
  "error": {
    "code": "unauthenticated",
    "message": "unauthenticated"
  }
}

응답 403

호출자가 이 조직에 대한 필수 권한이 없거나, 조직이 governance를 사용할 자격이 없거나(permission_denied), 생성 한도에 도달했을 때(limit_exceeded). 스키마: Error

limit_exceeded:

{
  "error": {
    "code": "limit_exceeded",
    "message": "organization has reached the maximum of 100 policies"
  }
}

permission_denied:

{
  "error": {
    "code": "permission_denied",
    "message": "permission denied"
  }
}

응답 404

Not found · 스키마: Error

{
  "error": {
    "code": "not_found",
    "message": "policy not found"
  }
}

응답 409

Conflict · 스키마: Error

{
  "error": {
    "code": "conflict",
    "message": "policy name already in use"
  }
}

응답 500

Internal server error · 스키마: Error

{
  "error": {
    "code": "internal",
    "message": "internal error"
  }
}

참조 스키마

  • #/components/schemas/UpdatePolicyRequest
  • #/components/schemas/UpdatePolicyResponse

요청 예시

curl \
  --request PATCH \
  --header "Authorization: Bearer ***" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "name": "Security Research"
}' \
  'https://hub.docker.com/v2/orgs//governance/policies/'

더 알아보기 (Learn more)