นโยบายที่อิงกับลีฟเดียวที่ผู้เขียนเขียนไว้
ตัวอย่าง
สล็อต
ข้อมูล รับรอง เติม ได้ แต่ เติม โดย เขียน ข้อมูล รับรอง ลงใน ซอร์ส ของ พื้นที่ ทำงาน เอง ไม่ ได้
Releases สอง
ทุก
สล็อต และ Features สองรายการที่เติมสล็อตได้
core/datastore/mariadb ประกาศ
featuresSchema: root_password: required: true sensitive: true inject: [] description: Root database password. Recipe controls delivery (Black-Box).sensitive: true ตรงinject: [] ปิด
Features มาตรฐาน
| Feature | ใคร | สิ่ง |
|---|---|---|
core/secret-value | ผู้ | leaf สองvalues — ดู |
core/generated-secret | เอนจิน | ไม่มี: ไม่values |
core/secret-value ประกาศ leaf สอง
values: origin: { type: string, sensitive: true } key: { type: string, required: true, default: "value" }origin ถือkey เป็น
core/generated-secret ไม่values เลย จึง
Releases สองรายการ
aggregate-authored.yaml ผูก
features: root_password: type: core/secret-value values: key: MARIADB_ROOT_PASSWORD origin: root-password-in-the-clearฝั่งrelease-delegated.yaml จึงcore/generated-secret ที่db และ aggregate-delegated.yaml คือ Aggregate ที่features:
components: db: features: root_password: type: core/generated-secretReleases ทั้งmanifest.yaml ร่วม
components: type: core/datastore/mariadb:1.0.0: terraform/mariadb-rds:1.0.0 features: type: core/secret-value:1.0.0: terraform/variable-secret:1.0.0 core/generated-secret:1.0.0: terraform/generated-secret:1.0.0นโยบาย
policy.rego ซึ่ง
package house.governance
import rego.v1
deny contains msg if { some node_id, attachments in input.graph.spec.feature_values_mapping some attachment_name, attachment in attachments some leaf in attachment.sensitive_payload_leaves msg := sprintf("%v: the %v credential carries declared-sensitive material in its payload at %v", [node_id, attachment_name, leaf])}sensitive_payload_leaves แสดงdefault จึง
- ลีฟ
จะ ครอบคลุม ลีฟปรากฏ ก็ ต่อ เมื่อ มี การ ประกาศ นั้น — การ ประกาศ ระบุ ลีฟ นั้น โดยตรง หรือ ระบุ ออบเจ็กต์ ที่ มี ลีฟ นั้น อยู่ โดย จับ คู่ ที ละ เซกเมนต์ ตาม เส้น ทาง ที่ คั่น ด้วย จุด ไม่มี การ อ่าน สิ่ง ใด จาก ข้อความ ของ เส้น ทาง เอง และ ไม่มี การ ตรวจ ดู ค่า ใด เลย ดัง นั้น keyที่เขียน ไว้ ข้าง originในการ แนบ เดียวกัน จึง ไม่ ปรากฏ เลย เพราะ Feature ที่ เกี่ยวข้อง ไม่ ได้ ประกาศ สิ่ง ใด เกี่ยว กับ คีย์ นี้ - การ
แนบ ที่ เพย์โหลด ไม่มี สิ่ง ใด ที่ ลีฟ ที่ ประกาศ ไว้ จะ ไม่มี ส่วน เพิ่ม สิ่ง ใด ใน รายการ การ แนบ ของ Release แบบ มอบ หมาย มี คำ ตอบ ระดับ การ แนบ ทั้งหมด และ ไม่มี รายการ ราย ลีฟ เลย เพราะ คีย์ ถูก ละไว้ จาก wire เมื่อ รายการ นั้น จะ ว่าง เปล่า
การ.aggrega-config.yaml ที่ir-verdict ซึ่ง
plugins: governance: - uri: governance/rego:0.9.0 role: ir-verdict with: sources: - policy.regoบทบาท
บิลด์ทั้งสองรายการ
aggrega build --release release-negative-authored.yaml --auto-pull # expected to failaggrega build --release release-delegated.yaml --auto-pull--auto-pull เติมaggrega pull --release release-<arm>.yaml ที่
สิ่งที่ได้กลับมา
Release ที่1 E0005 คือ
[… omitted: the pull's lines — the same refusal among them — and a lint notice about core/secret-value][POLICY_ERROR E0005] policy plugin "rego" rejected the build: db: the root_password credential carries declared-sensitive material in its payload at values.origin caused by: policy violationอ่านvalues.origin และvalues.key ประโยค
การdist/infra-authored/ เลย จึง
Release แบบ0 และdist/infra-delegated/terraform/aggrega.modules.tf ซึ่ง
# Root configuration for this boundary. Each component rendered here is one# module block below, and the directory that block points at holds that# component's own files. One configuration means one dependency graph, which is# what lets a reference or a depends_on reach from one component to another.
module "db" { source = "./modules/db"}และ dist/infra-delegated/terraform/modules/db/main.tf ซึ่ง# ที่
terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 6.69" } }}
resource "aws_db_instance" "db" { identifier = "db" engine = "mariadb" engine_version = "11.4" port = 3306
## ── Compute ────────────────────────────────────────────── instance_class = "db.t3.small"
## ── Storage ────────────────────────────────────────────── allocated_storage = 100 storage_type = "gp3"
## ── Database ───────────────────────────────────────────── db_name = "appdb" username = "admin"
## Black-Box: RDS manages the password via Secrets Manager. manage_master_user_password = true
## ── HA ─────────────────────────────────────────────────── multi_az = false
## ── Backup ─────────────────────────────────────────────── backup_retention_period = 7
## ── Provider-specific overrides ──────────────────────────}
output "address" { value = aws_db_instance.db.address}manage_master_user_password = true คือ
กรณีควบคุม: ถามคำถามระดับการแนบทั้งหมดแทน
สลับ.aggrega-config.yaml:
sources: - policy-attachment-wide.regopolicy-attachment-wide.rego ไล่attachment.sensitive เป็น
deny contains msg if { some node_id, attachments in input.graph.spec.feature_values_mapping some attachment_name, attachment in attachments attachment.sensitive msg := sprintf("%v: the %v credential handles sensitive material", [node_id, attachment_name])}บิลด์ Releases ทั้งpolicy.rego กลับ
[… omitted: the pull's lines — the same refusal among them — and a lint notice about core/secret-value][POLICY_ERROR E0005] policy plugin "rego" rejected the build: db: the root_password credential handles sensitive material caused by: policy violationนี่sensitive อ่าน
ข้อsensitive_inject ก็provides ซึ่งprovides ดัง
สำหรับ
สิ่งที่เป้าหมายนี้ทำให้เห็นเกี่ยวกับรูปแบบที่เขียนเอง
Recipe ของ
นี่
ปลั๊กอินมาจากที่ใด
เอนทิตี.aggrega-config.yaml ระบุ หรือ--catalog
uri: governance/rego:0.9.0 ระบุ<pluginType>/<name> บวกoci://hub.aggrega.ai/plugin/governance/rego:0.9.0 เวอร์ชันaggrega เอง จะ
เมื่อ--catalog ที่aggrega ของaggrega หากhub.aggrega.ai
เอนจิน Rego ถูก
ไฟล์
aggregate-authored.yaml— สล็อตroot_passwordที่core/secret-valueผูกไว้ ใน Aggregate โดย เขียน ทั้ง คีย์ การ ส่ง มอบ และ ข้อมูล ลับ aggregate-delegated.yaml— ฐานข้อมูล เดียวกัน ที่ ไม่มี การ แนบ นัก พัฒนา ไม่ ผูก สิ่ง ใด เลย manifest.yaml— ผูกชนิด ส่วน ประกอบ และ ชนิด ของ Feature ทั้ง สอง กับ Recipes ของ Terraform ใช้ ร่วม กัน โดย Releases ทั้ง สอง release-negative-authored.yaml,release-delegated.yaml— ฝั่งละ หนึ่ง ไฟล์ โดย แต่ละ ไฟล์ มี directory:ของแนว เขต เป็น ของ ตนเอง ไม่มี แฟล็ก สำหรับ ตำแหน่ง เอาต์พุต ดัง นั้น Releases สอง รายการ ที่ ใช้ ไดเรกทอรี เดียวกัน จะ ทำให้ รายการ ที่ สอง เขียน ทับ รายการ แรก release-delegated.yamlยังผูก สล็อต ที่ รายการ ของ dbด้วยcore/generated-secretโดยไม่ เขียน สิ่ง ใด เลย Feature ใด เติม สล็อต และ ใน เอกสาร ใด เป็น ความ ต่าง เพียง อย่าง เดียว ระหว่าง สอง ฝั่ง policy.rego— กฎประจำ องค์กร ที่ ใช้ การ ทำ เครื่องหมาย ราย ลีฟ เป็น คีย์ policy-attachment-wide.rego— กรณีควบคุม ที่ ใช้ คำ ตอบ ระดับ การ แนบ ทั้งหมด เป็น คีย์ ไม่ ได้ แนบ เป็น ค่า เริ่ม ต้น .aggrega-config.yaml— รีจิสทรีค่า เริ่ม ต้น และ การ แนบ ด้าน การ กำกับ ดูแล
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example policy-payload-leaf-sensitivityจาก
cd policy-payload-leaf-sensitivityบิลด์
aggrega build --release release-negative-authored.yaml --auto-pull # refused; exits 1aggrega build --release release-delegated.yaml --auto-pull # buildsกับผู้ช่วย AI
ผู้
ใช้เครื่องมือของ Aggrega เท่านั้น และอย่าสร้างโฟลเดอร์เอง หากโฟลเดอร์พื้นที่ทำงานยังไม่มีโฟลเดอร์ `policy-payload-leaf-sensitivity` ให้เรียกเครื่องมือ `draft` หนึ่งครั้งโดยตั้ง `example` เป็น `policy-payload-leaf-sensitivity` และไม่ระบุ `dir` เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `policy-payload-leaf-sensitivity` ใหม่ จากนั้นเรียกเครื่องมือ `build` โดยตั้ง `workspace_root` เป็น `policy-payload-leaf-sensitivity` ตั้ง `release` เป็น `release-negative-authored.yaml` ตั้ง `auto_pull` เป็น true และตั้ง `write` เป็น true การเรียกนี้ตั้งใจให้ถูกปฏิเสธ ดังนั้นแจ้งข้อความการปฏิเสธนั้นให้ฉันทราบ แล้วเรียกเครื่องมือ `build` แบบเดียวกันโดยตั้ง `release` เป็น `release-delegated.yaml` บอกฉันว่าการบิลด์ครั้งที่สองเขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใน `policy-payload-leaf-sensitivity/dist/`