मुख्य सामग्री पर जाएँ
Skillpedia
डिप्लॉय और क्लाउड (DevOps)35k · #8042

implementing-gcp-binary-authorization

यह क्या करती है

यह टूल पक्का करता है कि आपके क्लाउड सिस्टम (GCP) पर केवल भरोसेमंद और सत्यापित सॉफ़्टवेयर ही इंस्टॉल हो। इसमें इंस्टॉल होने से पहले एक डिजिटल साइन (attestation) माँगा जाता है।

कब इस्तेमाल करें

  • ✓जब आप चाहते हों कि केवल मंज़ूर सॉफ़्टवेयर ही इंस्टॉल हो।
  • ✓जब किसी खास नियमों को पूरा करने के लिए सिक्योरिटी सेट करनी हो।
  • ✓जब आपके सिस्टम की सुरक्षा बनानी या बेहतर करनी हो।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-gcp-binary-authorization/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-gcp-binary-authorization/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“सिक्योरिटी ऐसी सेट करो कि Google Cloud Run पर केवल सत्यापित सॉफ़्टवेयर इमेज ही इस्तेमाल हो सकें।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल हर सॉफ़्टवेयर के लिए ऐसे नियम बनाता है जिनमें डिजिटल 'साइन' ज़रूरी हो। यह साइन सॉफ़्टवेयर के सिक्योरिटी जाँच पास करने के बाद बनता है। इस साइन के बिना सॉफ़्टवेयर इंस्टॉल नहीं होता।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Implementing GCP Binary Authorization

Overview

Binary Authorization is a Google Cloud deploy-time security control that ensures only trusted container images are deployed on GKE or Cloud Run. It works through a policy-based model where images must have cryptographic attestations confirming they passed predefined requirements such as vulnerability scans, code reviews, or build pipeline verification. Continuous validation (CV) monitors running pods against policies and logs violations.

When to Use

  • When deploying or configuring implementing gcp binary authorization capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • GCP project with Binary Authorization API enabled
  • GKE cluster or Cloud Run service
  • Container Analysis API enabled
  • KMS keys for attestation signing
  • Cloud Build or external CI/CD pipeline

Enable Binary Authorization

# Enable required APIs
gcloud services enable binaryauthorization.googleapis.com
gcloud services enable containeranalysis.googleapis.com
gcloud services enable container.googleapis.com

# Enable Binary Authorization on GKE cluster
gcloud container clusters update CLUSTER_NAME \
  --enable-binauthz \
  --zone us-central1-a

Create Attestor

Create a KMS key for signing

# Create keyring
gcloud kms keyrings create binauthz-keyring \
  --location global

# Create signing key
gcloud kms keys create attestor-key \
  --keyring binauthz-keyring \
  --location global \
  --algorithm ec-sign-p256-sha256 \
  --purpose asymmetric-signing

Create Container Analysis note

cat > /tmp/note.json << 'EOF'
{
  "attestation": {
    "hint": {
      "humanReadableName": "Production Build Attestor"
    }
  }
}
EOF

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  "https://containeranalysis.googleapis.com/v1/projects/PROJECT_ID/notes/?noteId=prod-build-note" \
  -d @/tmp/note.json

Create the attestor

gcloud container binauthz attestors create prod-build-attestor \
  --attestation-authority-note=prod-build-note \
  --attestation-authority-note-project=PROJECT_ID

# Add KMS key to attestor
gcloud container binauthz attestors public-keys add \
  --attestor=prod-build-attestor \
  --keyversion-project=PROJECT_ID \
  --keyversion-location=global \
  --keyversion-keyring=binauthz-keyring \
  --keyversion-key=attestor-key \
  --keyversion=1

Configure Policy

Default deny-all policy

# binauthz-policy.yaml
admissionWhitelistPatterns:
  - namePattern: "gcr.io/google_containers/*"
  - namePattern: "gcr.io/google-containers/*"
  - namePattern: "k8s.gcr.io/**"
  - namePattern: "gke.gcr.io/**"
  - namePattern: "gcr.io/stackdriver-agents/*"
defaultAdmissionRule:
  evaluationMode: REQUIRE_ATTESTATION
  enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG
  requireAttestationsBy:
    - projects/PROJECT_ID/attestors/prod-build-attestor
globalPolicyEvaluationMode: ENABLE
gcloud container binauthz policy import binauthz-policy.yaml

Per-cluster rules

admissionWhitelistPatterns:
  - namePattern: "gcr.io/google_containers/*"
clusterAdmissionRules:
  us-central1-a.production-cluster:
    evaluationMode: REQUIRE_ATTESTATION
    enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG
    requireAttestationsBy:
      - projects/PROJECT_ID/attestors/prod-build-attestor
  us-central1-a.staging-cluster:
    evaluationMode: ALWAYS_ALLOW
    enforcementMode: DRYRUN_AUDIT_LOG_ONLY
defaultAdmissionRule:
  evaluationMode: ALWAYS_DENY
  enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG

Create Attestations

Attest an image after successful build

# Get image digest
IMAGE_DIGEST=$(gcloud container images describe \
  gcr.io/PROJECT_ID/my-app:latest \
  --format='get(image_summary.digest)')

# Create attestation
gcloud container binauthz attestations sign-and-create \
  --artifact-url="gcr.io/PROJECT_ID/my-app@${IMAGE_DIGEST}" \
  --attestor="prod-build-attestor" \
  --attestor-project="PROJECT_ID" \
  --keyversion-project="PROJECT_ID" \
  --keyversion-location="global" \
  --keyversion-keyring="binauthz-keyring" \
  --keyversion-key="attestor-key" \
  --keyversion="1"

Cloud Build integration

# cloudbuild.yaml
steps:

…
अक्सर पूछे जाने वाले सवाल

'attestation' क्या है?

यह एक डिजिटल साइन जैसा है, जो साबित करता है कि कोई सॉफ़्टवेयर सिक्योरिटी जाँच पास कर चुका है और मंज़ूर है।

GKE और Cloud Run क्या हैं?

ये Google Cloud की सेवाएँ हैं जहाँ आप अपने प्रोग्राम (कंटेनर) चला सकते हैं। यह टूल इन सेवाओं पर सुरक्षा सुनिश्चित करता है।

क्या इसके लिए कोडिंग आनी चाहिए?

टूल कॉन्फ़िगरेशन कमांड इस्तेमाल करता है, लेकिन इसका मुख्य विचार सुरक्षा और सॉफ़्टवेयर की मंज़ूरी से जुड़ा है, कोड लिखने से नहीं।

जानकारी

लेखक का मूल विवरण

Implements GCP Binary Authorization end to end, including creating KMS-backed attestors, Container Analysis notes, deploy-time policies, and signing image attestations, so that only trusted, verified images deploy to GKE and Cloud Run. Use when enforcing container supply-chain integrity or deploy-time attestation checks on GCP.

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#8042
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills