Utilisez ceci si
Add a lightweight CI step that sends deploy context to your tenant and gets an allow, warn, or deny decision back without self-hosting OPA.
Add a lightweight CI step that sends deploy context to your tenant and gets an allow, warn, or deny decision back without self-hosting OPA. Audience: Platform engineers, release managers, and security engineers. Temps moyen de mise en place: 10 minutes.
Add a lightweight CI step that sends deploy context to your tenant and gets an allow, warn, or deny decision back without self-hosting OPA.
Copiez une configuration de démarrage, exécutez-la dans votre environnement, puis revenez ici pour les détails avancés.
Demonstration only
This configuration is designed for ease of use. To deploy scanner clients at scale, please plan your deployment architecture accordingly or contact us for enterprise best practices.
Download the exact source files referenced on this page, or run the one-command installer to write them locally before following the deployment steps.
Writes `.github/workflows/deploy-guardrails.yml` with a hosted policy decision step that runs before production deploys.
BLACKSHIELD_POLICY_IMAGE=public.ecr.aws/blackshield-security/policy-client:1.0.12 \
bash <(curl -fsSL https://blackshield.chaplau.com/source-bundles/github-policy-guardrails.sh)Writes `.gitlab/deploy-guardrails.yml` with a reusable hosted policy decision job and the current platform API URL prefilled for production deployments.
BLACKSHIELD_POLICY_IMAGE=public.ecr.aws/blackshield-security/policy-client:1.0.12 \
BLACKSHIELD_API_URL=https://api.blackshield.chaplau.com \
bash <(curl -fsSL https://blackshield.chaplau.com/source-bundles/gitlab-policy-guardrails.sh)Installs the authenticated policy-client admission proxy, TLS service, and validating webhook using the immutable 1.0.9 image.
BLACKSHIELD_POLICY_IMAGE=public.ecr.aws/blackshield-security/policy-client:1.0.12 \
bash <(curl -fsSL https://blackshield.chaplau.com/source-bundles/kubernetes-policy-admission.sh)docker run --rm \
-e BLACKSHIELD_API_URL=https://api.blackshield.chaplau.com \
-e BLACKSHIELD_API_KEY=sp_xxxx \
-e POLICY_SERVICE_ID=payment-gateway \
-e POLICY_TARGET_ENVIRONMENT=prod \
-e POLICY_REPOSITORY=acme/payment-gateway \
-e POLICY_ARTIFACT=ghcr.io/acme/payment-gateway:${GIT_SHA:-latest} \
-e POLICY_BRANCH=main \
-e POLICY_CONTEXT_JSON='{"reviewer":"release-manager","change_ticket":"CAB-2026-0321"}' \
public.ecr.aws/blackshield-security/policy-client:1.0.12- name: Evaluate hosted deploy guardrails
run: |
docker run --rm \
-e BLACKSHIELD_API_URL="${{ vars.BLACKSHIELD_API_URL }}" \
-e BLACKSHIELD_API_KEY="${{ secrets.BLACKSHIELD_API_KEY }}" \
-e POLICY_SERVICE_ID="payment-gateway" \
-e POLICY_TARGET_ENVIRONMENT="prod" \
-e POLICY_REPOSITORY="${{ github.repository }}" \
-e POLICY_ARTIFACT="ghcr.io/acme/payment-gateway:${{ github.sha }}" \
-e POLICY_COMMIT_SHA="${{ github.sha }}" \
-e POLICY_BRANCH="${{ github.ref_name }}" \
-e POLICY_ACTOR="${{ github.actor }}" \
-e POLICY_CONTEXT_JSON='{"reviewer":"${{ github.actor }}","pipeline":"deploy-production"}' \
public.ecr.aws/blackshield-security/policy-client:1.0.12deploy-guardrails:
stage: deploy
image: public.ecr.aws/blackshield-security/policy-client:1.0.12
script:
- python -m policy.entrypoint
variables:
BLACKSHIELD_API_URL: "https://api.blackshield.chaplau.com"
# BLACKSHIELD_API_KEY: set in CI/CD -> Variables (masked)
POLICY_SERVICE_ID: "payment-gateway"
POLICY_TARGET_ENVIRONMENT: "prod"
POLICY_REPOSITORY: "$CI_PROJECT_PATH"
POLICY_ARTIFACT: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
POLICY_COMMIT_SHA: "$CI_COMMIT_SHA"
POLICY_BRANCH: "$CI_COMMIT_REF_NAME"
POLICY_ACTOR: "$GITLAB_USER_LOGIN"
POLICY_CONTEXT_JSON: '{"reviewer":"$GITLAB_USER_LOGIN","pipeline":"deploy-production"}'Suivez les étapes ci-dessous pour adapter le déploiement, vérifier les accès et étendre l'infrastructure en toute sécurité.
Étape 1
Open the Policies console, keep the starter pack in advisory mode first, and tune thresholds before enforcing production blocks.
Critères de réussite
Tenant Rego runs in disposable workers with source/test-size, timeout, memory, and concurrency limits.
Étape 2
Use the managed integration wizard to create a ten-minute single-use bootstrap token. Its command creates and stores a policies:read key without exposing it in browser state or shell history.
Critères de réussite
Start with advisory rollout mode so warn outcomes surface without blocking releases.
Étape 3
Run the policy client before the real deployment step. It posts the deploy request, prints reasons, and exits non-zero only when the final decision is deny.
Critères de réussite
Place the job immediately before the production deploy so the decision reflects the current release candidate.
Keep your rollout moving with the next recommended step.
Examiner et prioriser les détections