carlos / platform Public

census: correct four media-engine claims after Astra's approval

Astra approved every unit and envelope at 57f5e6c7 and asked for four
claim wordings to match the diff: the ECR repository and drill grant
live in main.tf, the drill ARN pattern restricts type and name (main.tf
checks the account), versions.tf also pins the archive provider, and the
media-engine tests include mocked apply runs that write the reaper ZIP
locally. Re-proposed; no unit or verdict changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 3577bbed21e5105cc54abae6c6371a4d0edaf334 parent 676fe1b
4 files changed, +17 −17
  • docs/superpowers/notes/census-claims-media-conversion.tsv +5 −5
  • docs/superpowers/notes/census-proposal-media-conversion.md +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-media-conversion.tsv +10 −10

CI failed — run details

diff --git a/docs/superpowers/notes/census-claims-media-conversion.tsv b/docs/superpowers/notes/census-claims-media-conversion.tsv
index e3bfbcad8..fb2bbe7e5 100644
--- a/docs/superpowers/notes/census-claims-media-conversion.tsv
+++ b/docs/superpowers/notes/census-claims-media-conversion.tsv
@@ -74,14 +74,14 @@ infra/modules/region-host/tests/analytics_prune.tftest.hcl:external mock-plan as
infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl:external mock-plan runs for the managed fleet policy and attachment, the two-apply retirement, the 6,144 refusal on retirement, three regions accepted inline-only, the complete console role's inline total with conversion on, and the conversion prefix refusals with fleets on and off; no apply, no AWS access.
infra/modules/region-host/variables.tf:external two variables: store_conversion (bool, default false) and managed_fleets_inline_retired (bool, default false, temporary); operator Terraform input only; no box runtime read.
infra/modules/region-host/tests/store_conversion.tftest.hcl:external new mock-plan test: store_conversion off creates nothing and leaves the boundary byte for byte; on grants exactly nine actions on the store prefix, adds the two multipart actions to the boundary, denies the writes on the deployment and data buckets, and refuses broad, overlapping or empty prefixes; no apply, no AWS access.
-infra/modules/media-engine/main.tf:external new module (Task 11): locals and the region precondition (region == store_region) for a per-conversion Fargate engine; tofu only, operator machine; nothing on a box reads it.
+infra/modules/media-engine/main.tf:external new module (Task 11): locals and the region precondition (region == store_region); the ECR repository (immutable tags, scan on push); the repository policy, created only by the drill input and granting pull to one operator-chosen foreign drill user, with a precondition refusing a principal in this module's own account; the engine log group. tofu only, operator machine; nothing on a box reads it.
infra/modules/media-engine/network.tf:external new: a VPC with two private subnets, no internet gateway, NAT or default route; a tasks security group with no ingress and HTTPS egress only to the S3 prefix list and the endpoints; S3 gateway and ECR/logs interface endpoints with principal-scoped policies; a Route 53 Resolver DNS firewall allowing only the S3, ECR and logs names (TRUST_REDIRECTION_DOMAIN on that ALLOW only) and blocking the rest with NXDOMAIN, fail-closed; the drill input changes only the four endpoint policies and the repository policy.
infra/modules/media-engine/iam.tf:external new: task execution role (ECR pull and the log group only); conversion role trusted only by the console role, Allow GetObject on store objects and PutObject on derived/ and media-results/, Deny GetObject on infected objects and any PutObject setting carlos-scan tags, 1 h sessions; the console role's customer-managed policy: AssumeRole on the conversion role, RunTask on this engine's task definitions in its cluster, Describe/Stop/List tasks in the cluster, DescribeTaskDefinition, PassRole of the execution role to ecs-tasks, ListBucket on the deployment bucket.
-infra/modules/media-engine/ecs.tf:external new: ECR repository (immutable tags, scan on push), Fargate-only cluster, four task definitions (deadline + codec containers, entryPoint /usr/local/bin/carlos-media, read-only root, user 65534, caps dropped, no task role, image by digest) created only once image_digest is set, with skip_destroy so a rollout keeps the revisions a running console uses.
+infra/modules/media-engine/ecs.tf:external new: Fargate-only cluster and four task definitions (deadline + codec containers, entryPoint /usr/local/bin/carlos-media, read-only root, user 65534, caps dropped, no task role, image by digest) created only once image_digest is set, with skip_destroy so a rollout keeps the revisions a running console uses.
infra/modules/media-engine/reaper.tf:external new: a Python 3.13 Lambda on a 1-minute EventBridge rule that stops this cluster's tasks older than reaper_max_age_minutes; its role can only list, describe and stop tasks in this cluster and log to its own group.
infra/modules/media-engine/reaper/reaper.py:external new Lambda handler: lists RUNNING tasks in CLUSTER, describes them in batches, stops those older than MAX_AGE_MINUTES; reads no other input; runs in AWS, not on a box.
infra/modules/media-engine/reaper/reaper_test.py:external new stdlib unittest with a stub ECS client; no AWS access.
infra/modules/media-engine/outputs.tf:external new: carlos_media_engine (JSON of the mediaaws Config, empty until a digest exists), repository URL, cluster ARN, conversion role ARN; the operator copies carlos_media_engine into CARLOS_MEDIA_ENGINE on the console.
-infra/modules/media-engine/variables.tf:external new: operator inputs (name, regions, store prefix, deployment bucket, console role, image digest and metadata, VPC CIDR, logs, reaper age, task classes, drill object default null with an ARN pattern refusing roles and same-account principals).
-infra/modules/media-engine/versions.tf:external new: OpenTofu and AWS provider version constraints.
-infra/modules/media-engine/tests/media_engine.tftest.hcl:external new mock-plan tests (24 runs): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses; no apply, no AWS access.
+infra/modules/media-engine/variables.tf:external new: operator inputs (name, regions, store prefix, deployment bucket, console role, image digest and metadata, VPC CIDR, logs, reaper age, task classes, drill object default null whose ARN pattern admits only an IAM user named carlos-media-drill-<16 hex>; the same-account refusal is main.tf's precondition).
+infra/modules/media-engine/versions.tf:external new: OpenTofu, AWS provider and archive provider version constraints.
+infra/modules/media-engine/tests/media_engine.tftest.hcl:external new OpenTofu tests (24 runs: 9 plan and 15 apply, all against mock_provider aws, so no AWS access): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses. The archive provider is real and writes the reaper's ZIP to a local path during the test.
diff --git a/docs/superpowers/notes/census-proposal-media-conversion.md b/docs/superpowers/notes/census-proposal-media-conversion.md
index 6f6d2c47d..88894cbbe 100644
--- a/docs/superpowers/notes/census-proposal-media-conversion.md
+++ b/docs/superpowers/notes/census-proposal-media-conversion.md
@@ -37,6 +37,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `infra/modules/media-engine/versions.tf:external`: reads +file:external; written legacy, accepted-legacy, frozen
- new `infra/modules/region-host/tests/store_conversion.tftest.hcl:external`: reads +file:external; written legacy, accepted-legacy, frozen
-Seal: `ec3c40098ec0a652c735d54925f334b9b9680c9e2b6cd0c3d9497b8a615fb86f` → `077b712b28085ce0b330cbbfa3e410dfa8dc1569aa89859935e1e0e67e57c6a3`.
+Seal: `ec3c40098ec0a652c735d54925f334b9b9680c9e2b6cd0c3d9497b8a615fb86f` → `b8fce3e28c1bc5ca00bb0ff3c44e9b443be11771d578b9ca9d7bc129b16f1903`.
Overlay: `internal/provision/testdata/plan14-root-reads-media-conversion.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index c9efc7363..c9bf29e3a 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -248,4 +248,4 @@ plan14-root-reads-mail-submission-followups.tsv c9cd3c8fdf31240b83affa0b2798422f
plan14-root-reads-staticcheck-sa4006.tsv 33e5eaaa9b2d80f6f8f5de8d04e908e39ecfc820c5fe7b44c870e671565e1063
plan14-root-reads-aws-followups-1143.tsv 33e5eaaa9b2d80f6f8f5de8d04e908e39ecfc820c5fe7b44c870e671565e1063
plan14-root-reads-fix-dbforward-reuse-1032.tsv ec3c40098ec0a652c735d54925f334b9b9680c9e2b6cd0c3d9497b8a615fb86f
-plan14-root-reads-media-conversion.tsv 077b712b28085ce0b330cbbfa3e410dfa8dc1569aa89859935e1e0e67e57c6a3
+plan14-root-reads-media-conversion.tsv b8fce3e28c1bc5ca00bb0ff3c44e9b443be11771d578b9ca9d7bc129b16f1903
diff --git a/internal/provision/testdata/plan14-root-reads-media-conversion.tsv b/internal/provision/testdata/plan14-root-reads-media-conversion.tsv
index 211f5ffc8..ffea51524 100644
--- a/internal/provision/testdata/plan14-root-reads-media-conversion.tsv
+++ b/internal/provision/testdata/plan14-root-reads-media-conversion.tsv
@@ -6,34 +6,34 @@
@legacy 3bf6179fdd9549cba935b89cef2a9bc61511bddf2e81cf0ab87342453049eb91 infra/modules/region-host/tests/analytics_prune.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-stats-prune-400;basis=new mock-plan test: the analytics version-prune grant is absent by default and, when on, grants exactly the analytics day-file versions; test-only Terraform, no runtime reads;rev3=census-ruling-media-conversion;basis=mock-plan assertions follow host_analytics_prune to its managed policy and attachment; same grant pinned; no apply, no AWS access. file:external@0 41f2b88e627bb448e7a9b8cfea071a3d4f6e2befafbbd584df928ddb6dceaae7
@legacy feda52a35722c88067f8961ba6147fda9f2d389f8297ff39865ae68e3c4c4151 infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-managed-fleets-2b1;basis=managed fleets 2b-1 Task 5 (new file): 32 OpenTofu test runs, every one command = plan against mock_provider aws (no apply, no AWS access), pinning the rendered grant and boundary to internal/awsmanaged/testdata fixtures, the off and store-only renderings byte for byte, and the variable refusals; run only on a developer's or operator's machine with tofu test; nothing on a box or in any binary reads the file;rev3=census-ruling-media-conversion;basis=mock-plan runs for the managed fleet policy and attachment, the two-apply retirement, the 6,144 refusal on retirement, three regions accepted inline-only, the complete console role's inline total with conversion on, and the conversion prefix refusals with fleets on and off; no apply, no AWS access. file:external@0 621ec28e2b476f0069ec98199a772586198066c5773b1bcd01b1d7e6ab78b7b1
@legacy 80a04ad89a36c20ac34cd6b0e6fcd13efed19c24d0b81036b3bc7b4e055b27ea infra/modules/region-host/variables.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-invite-delivery;basis=tofu on an operator's machine with the operator's AWS credentials (no box unit; no binary embeds the file): main's variables with console_mail_from (validated as one lowercase address) and console_mail_region, both empty by default; no read is added and nothing on a box reads the file;rev3=census-ruling-hunt-account-root-hardening;basis=adds deny_release_key_reads (bool, default true); no read is added and nothing on a box reads the file;rev3=census-ruling-region-ha-p3b;basis=Add default-fixed mode and validated group count, zones, pinned image/release/template, ingress, configuration key and transaction-open refusal. Operator-supplied Terraform values select root boot inputs; no direct box runtime read and no group activation by default.;rev3=census-ruling-region-ha-g2-fixes;basis=Add an empty-default set of additional alert topic ARNs, validating concrete SNS topic syntax and excluding wildcards/subscriptions; operator Terraform input, no box runtime read.;rev3=census-ruling-region-ha-g3-fixes;basis=Add optional alerts_topic_arn with concrete same-region SNS ARN validation and mutual exclusion with alerts_email. The caller owns the existing topic policy and subscriptions; no runtime sink is configured and no new root read is added.;rev3=census-ruling-managed-fleets-2b1;basis=managed fleets 2b-1 Task 5: five variables, managed_fleets_enabled (bool, default false, refused unless mode is fixed), managed_fleets_deployment, managed_fleets_regions (concrete ami/subnet/sg IDs, arm64 types, no ID in two regions), managed_fleet_bucket_prefix (1-24 chars, no reserved prefix, must not cover the deployment, data or staging buckets, disjoint from store_bucket_prefix) and managed_fleet_user_path (literal IAM path, disjoint from store_user_path); store_bucket_prefix and store_user_path gain a validation refusing *, ? or ${ only when managed fleets and object storage are both on; operator Terraform input only; no box runtime read and nothing on a box reads the file;rev3=census-ruling-fixedbox-health-alarms;basis=Add optional health_alerts_topic_arn (concrete same-region SNS ARN validation, empty default); enable_auto_recovery description covers both status alarms. Operator Terraform input; no box runtime read.;rev3=census-ruling-w6-ingress-drain;basis=new variable ingress_target_group_arns (list(string), default [], non-nullable) validated as distinct ELB target group ARNs (arn:aws(-x)*:elasticloadbalancing:<region>:<12 digits>:targetgroup/<name>/<16 hex>); drives the IAM policy and output above. No read added.;rev3=census-ruling-stats-prune-400;basis=new variable enable_analytics_version_prune (bool, default false) driving the policy above; operator Terraform input; no box runtime read;rev3=census-ruling-platform-mail-submission;basis=Task 8: variable "mailer", an object {ses_region, ses_account_id, deployment_bucket_region, optional deployment_bucket_kms_key_arn} defaulting to null, which creates nothing; validated (AWS region shapes, 12-digit account, KMS ARN or empty).;rev3=census-ruling-media-conversion;basis=two variables: store_conversion (bool, default false) and managed_fleets_inline_retired (bool, default false, temporary); operator Terraform input only; no box runtime read. file:external@0 da31f31bcdcf0369954fe21b730589b456605a92b6b07674a7e48b76a75b8dca
-@legacy bbaec2569babafbd4c5191f0cd9b98f649683862f83783627ecd8c41ef30a443 infra/modules/media-engine/ecs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: ECR repository (immutable tags, scan on push), Fargate-only cluster, four task definitions (deadline + codec containers, entryPoint /usr/local/bin/carlos-media, read-only root, user 65534, caps dropped, no task role, image by digest) created only once image_digest is set, with skip_destroy so a rollout keeps the revisions a running console uses. file:external@0 e2235db156b7cf1f4c70ebd7515c0c6e27bab4ad2b73af4eb232498733672c90
+@legacy 2300a2cad317843b4be32c0ea17fc1317f0a2dd56cced1ac42685ccb90e75a75 infra/modules/media-engine/ecs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: Fargate-only cluster and four task definitions (deadline + codec containers, entryPoint /usr/local/bin/carlos-media, read-only root, user 65534, caps dropped, no task role, image by digest) created only once image_digest is set, with skip_destroy so a rollout keeps the revisions a running console uses. file:external@0 e2235db156b7cf1f4c70ebd7515c0c6e27bab4ad2b73af4eb232498733672c90
@legacy 7141b316421c64e8d198e7d8def05c2525d20bc229cbb907c793fb5237ec1dc3 infra/modules/media-engine/iam.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: task execution role (ECR pull and the log group only); conversion role trusted only by the console role, Allow GetObject on store objects and PutObject on derived/ and media-results/, Deny GetObject on infected objects and any PutObject setting carlos-scan tags, 1 h sessions; the console role's customer-managed policy: AssumeRole on the conversion role, RunTask on this engine's task definitions in its cluster, Describe/Stop/List tasks in the cluster, DescribeTaskDefinition, PassRole of the execution role to ecs-tasks, ListBucket on the deployment bucket. file:external@0 d97d49b0881fa91f8a1aff3bfa9bd10eb152254b9c0014bc75c36976f9d52645
-@legacy 5658257388bc56e26fce734bdf878eff83c0d8c517d51001aa2c347aa38b4a0b infra/modules/media-engine/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new module (Task 11): locals and the region precondition (region == store_region) for a per-conversion Fargate engine; tofu only, operator machine; nothing on a box reads it. file:external@0 87586e2a1c7a61538170864dbef9507ffca30858b4d2db398962745b35e99c60
+@legacy 8491b002119223461f1d8b64e4e315b6416b1da9d2af4cbeef965673e68cac69 infra/modules/media-engine/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new module (Task 11): locals and the region precondition (region == store_region); the ECR repository (immutable tags, scan on push); the repository policy, created only by the drill input and granting pull to one operator-chosen foreign drill user, with a precondition refusing a principal in this module's own account; the engine log group. tofu only, operator machine; nothing on a box reads it. file:external@0 87586e2a1c7a61538170864dbef9507ffca30858b4d2db398962745b35e99c60
@legacy 6d780488b947e672fbc1205827ee56850b4ae5e624810601aa9af61560ed8152 infra/modules/media-engine/network.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: a VPC with two private subnets, no internet gateway, NAT or default route; a tasks security group with no ingress and HTTPS egress only to the S3 prefix list and the endpoints; S3 gateway and ECR/logs interface endpoints with principal-scoped policies; a Route 53 Resolver DNS firewall allowing only the S3, ECR and logs names (TRUST_REDIRECTION_DOMAIN on that ALLOW only) and blocking the rest with NXDOMAIN, fail-closed; the drill input changes only the four endpoint policies and the repository policy. file:external@0 47665cc7dcac49d5287851ba3dee2f49c04f11aece10e6870de1dcbb9b997932
@legacy b465499ea908b856982235902198c940af11575dffc008c0259a9aa2bc760f33 infra/modules/media-engine/outputs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: carlos_media_engine (JSON of the mediaaws Config, empty until a digest exists), repository URL, cluster ARN, conversion role ARN; the operator copies carlos_media_engine into CARLOS_MEDIA_ENGINE on the console. file:external@0 f2d0a22caee4b25bef387cc5c2ac4a00c3a3becd324ee05581405df6489d6801
@legacy e26946827975fc4c1bbdcaf2af008d7c0f81c6f6f6dd6d32a51c13c288b109f3 infra/modules/media-engine/reaper.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: a Python 3.13 Lambda on a 1-minute EventBridge rule that stops this cluster's tasks older than reaper_max_age_minutes; its role can only list, describe and stop tasks in this cluster and log to its own group. file:external@0 06ac29d314be92a4109e33dced1572d4c684882108d627764714b883b62feb44
@legacy 2c3249ffa9eb10070ec084a85f6896e3a7099103f52327c30d4ccbed53b91dff infra/modules/media-engine/reaper/reaper.py external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new Lambda handler: lists RUNNING tasks in CLUSTER, describes them in batches, stops those older than MAX_AGE_MINUTES; reads no other input; runs in AWS, not on a box. file:external@0 aaeec79227dfdc851b9ca9fd789e36c6e7a5cc1deb44eea47c88fd8a09a6be86
@legacy 6cb94cf1b846cadb1f305312d4e363ab0087022a8196b1b4b673fd0f34161b7d infra/modules/media-engine/reaper/reaper_test.py external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new stdlib unittest with a stub ECS client; no AWS access. file:external@0 ccd9ca7a2ffb86c812412915754da6cf875db5bc4f2f63faefb4175fecbada5d
-@legacy 3030cebdbc2d9f0cbd6020543da1cc557bd47823af1f3b2b028626b8fcac8193 infra/modules/media-engine/tests/media_engine.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new mock-plan tests (24 runs): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses; no apply, no AWS access. file:external@0 688688b4556ef58d489fa6dcdcdab4e3af823fd0c4e8620c53a73d54e4cfb43c
-@legacy 5cefadcec9844acd626bf7ffe1fc6dd8daebe4fa59b127c59757d9173b03e29e infra/modules/media-engine/variables.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: operator inputs (name, regions, store prefix, deployment bucket, console role, image digest and metadata, VPC CIDR, logs, reaper age, task classes, drill object default null with an ARN pattern refusing roles and same-account principals). file:external@0 89293c62780f0fef3315f6e5a9bd7b2a12d951cb573e75e4dd19d5ab835c1dc1
-@legacy 8faa490ab63a7036585b49a14dc09859ca36e52e78d17b17b5719a24de3c2b76 infra/modules/media-engine/versions.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: OpenTofu and AWS provider version constraints. file:external@0 6f469b46ad4df2c72c4f6a2869c1954b1556357fc5f084845547330634f3826a
+@legacy 4bb45f3f4fe3713b6b507ddcd2ccda6206fe014da495eb25ba1eec6c9077d34d infra/modules/media-engine/tests/media_engine.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new OpenTofu tests (24 runs: 9 plan and 15 apply, all against mock_provider aws, so no AWS access): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses. The archive provider is real and writes the reaper's ZIP to a local path during the test. file:external@0 688688b4556ef58d489fa6dcdcdab4e3af823fd0c4e8620c53a73d54e4cfb43c
+@legacy e1fb58015cdd7c98ea4d7ea248a831b6851a506a78584e65a133161dc1d5b861 infra/modules/media-engine/variables.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: operator inputs (name, regions, store prefix, deployment bucket, console role, image digest and metadata, VPC CIDR, logs, reaper age, task classes, drill object default null whose ARN pattern admits only an IAM user named carlos-media-drill-<16 hex>; the same-account refusal is main.tf's precondition). file:external@0 89293c62780f0fef3315f6e5a9bd7b2a12d951cb573e75e4dd19d5ab835c1dc1
+@legacy 29b43ff63bb3dde421dc91563549800ae1be5d23db103a9a22f8f05bda3d593a infra/modules/media-engine/versions.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: OpenTofu, AWS provider and archive provider version constraints. file:external@0 6f469b46ad4df2c72c4f6a2869c1954b1556357fc5f084845547330634f3826a
@legacy 03ba5a1a6250d44bd8e570c2da010e414c58ab39e0aef21371120be28d7b89a0 infra/modules/region-host/tests/store_conversion.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new mock-plan test: store_conversion off creates nothing and leaves the boundary byte for byte; on grants exactly nine actions on the store prefix, adds the two multipart actions to the boundary, denies the writes on the deployment and data buckets, and refuses broad, overlapping or empty prefixes; no apply, no AWS access. file:external@0 c5c7ba27dc56f32115410573b21b9506aec439218315652acb6b50db9db899f5
infra/modules/region-host/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-invite-delivery;basis=tofu on an operator's machine with the operator's AWS credentials (no box unit; no binary embeds the file): main's module with one optional aws_iam_role_policy, host_console_mail, count 0 unless console_mail_from is set; it grants the host role ses:SendEmail on the one sending identity, the carlos-bab configuration set and its tenants, conditioned on ses:FromAddress equal to console_mail_from; no read is added and nothing on a box reads the file;rev3=census-ruling-sec-host-imdsv2-module;basis=aws_instance.host gains metadata_options (IMDSv2 required, hop limit 1, endpoint enabled), matching scanner-host; tofu configuration only, run on an operator's machine; no read, file or record write is added; applies in place on a running instance with no restart;rev3=census-ruling-hunt-account-root-hardening;basis=adds aws_iam_role_policy host_release_key_deny (count from deny_release_key_reads, default true): an explicit Deny on ssm:GetParameter, GetParameters and GetParameterHistory for parameter/carlos/release-key, and on GetParametersByPath for its ancestor paths; tofu only, run on an operator's machine; no read is added and nothing on a box reads the file;rev3=census-ruling-region-host-store-deny;basis=host_store policy: the explicit Deny on the deployment's own buckets drops s3:DeleteObject and keeps s3:DeleteBucket and s3:CreateBucket (lease release, retention and prune are DeleteObject); tofu only, run on an operator machine; no read is added and nothing on a box reads the file;rev3=census-ruling-region-ha-p3b;basis=Select default fixed resources through counted addresses and explicit moves; group mode selects scoped bucket/SSM policy, partition-aware ARNs and refuses fixed-only settings. Operator Terraform controls the instance role that can read boot parameters and write runtime bucket objects; release-key Deny and fixed-mode policy remain.;rev3=census-ruling-region-ha-g3-fixes;basis=Enable the fixed-host memory alarm with either alert input and use the selected topic for alarm and recovery notifications. Preserve module topic/subscription creation for alerts_email only. No new root runtime read or box authority.;rev3=census-ruling-managed-fleets-2b1;basis=managed fleets 2b-1 Task 5: aws_iam_policy.store_user_boundary is now counted when store_bucket_prefix is set or managed_fleets_enabled is true; its statements are concat of the unchanged object-storage pair (only with a store prefix, moved into local.store_boundary_statements byte for byte) and local.managed_boundary_statements (only with managed fleets: the fleet-data Allows on <managed_fleet_bucket_prefix>* buckets); name unchanged, description conditional on store prefix with lifecycle ignore_changes on description so a later feature switch never replaces the policy; tofu only, run on an operator's machine with the operator's AWS credentials; no box unit, user_data or binary reads the file; no read is added; default (both features off) plans no change;rev3=census-ruling-fixedbox-health-alarms;basis=Fixed host EC2 status-check alarms: auto-recover gains SNS alarm/ok actions (ec2:recover kept); new host_instance_check alarm (StatusCheckFailed_Instance 3 of 3 x 60 s -> ec2:reboot + SNS). tofu only, run on an operator machine; no read is added and nothing on a box reads the file.;rev3=census-ruling-fixed-host-ignore-user-data;basis=aws_instance.host lifecycle ignore_changes gains user_data (was [ami]): a user_data edit no longer plans an in-place update (stop/start) of a live fixed host; a new box still boots with the given script. tofu only, run on an operator machine; no read is added and nothing on a box reads the file.;rev3=census-ruling-w6-ingress-drain;basis=new aws_iam_role_policy.host_ingress_drain, count 1 only in fixed mode with ingress_target_group_arns non-empty: Allow elasticloadbalancing:DescribeTargetGroupAttributes and elasticloadbalancing:DescribeTargetHealth on Resource "*" (neither action takes a resource type). Read-only; no ELB write right. aws_iam_role.host's group-mode precondition gains length(var.ingress_target_group_arns) == 0, so group mode refuses the input. New AWS read right for the box role (the agent's drain reads); nothing a tenant or app can name.;rev3=census-ruling-stats-prune-400;basis=new aws_iam_role_policy for the console host role, count 1 only when enable_analytics_version_prune is true (default false, refused in group mode): s3:ListBucketVersions on the deployment bucket conditioned on s3:prefix apps/*, and s3:DeleteObjectVersion on deployment_bucket_arn/apps/*/*/analytics/*/days/* only; existing grants and denies unchanged; tofu only, run on an operator machine; no read is added and nothing on a box reads the file;rev3=census-ruling-media-conversion;basis=store_conversion (bool, default false) adds the customer-managed policy host_store_conversion attached to the host role: nine bucket-configuration actions (Get/PutBucketCORS, Get/PutLifecycleConfiguration, Get/PutBucketTagging, GetBucketPolicy, GetEncryptionConfiguration, GetBucketVersioning) on arn:aws:s3:::<store_bucket_prefix>* only, with an explicit Deny of the three writes on the deployment and data buckets; preconditions refuse it unless the prefix is a dedicated literal lower-case prefix ending in -store-, no deployment, data or sibling staging bucket starts with it, and it does not overlap a configured fleet prefix whatever managed_fleets_enabled says. The store user boundary gains s3:AbortMultipartUpload and s3:ListMultipartUploadParts only when the switch is on (off renders byte for byte as before). host_analytics_prune moves from inline to a customer-managed attached policy with identical statements and switch. Default plans no change apart from that policy's type. file:external@0 96116e2bf6ce4afe053afc26312cd3db901f7a11611287ad28fc55114edd96e5
infra/modules/region-host/managed_fleets.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-managed-fleets-2b1;basis=managed fleets 2b-1 Task 5 (new file): locals building the console host role's managed fleet grant and the fleet boundary statements, plus one aws_iam_role_policy host_managed_fleets on the existing aws_iam_role.host, count 0 unless managed_fleets_enabled; EC2 RunInstances only with the approved images, subnets, security groups and types, the four carlos identity tags, IMDSv2, hop limit 1 and no instance profile; CreateTags only at RunInstances; TerminateInstances and GetConsoleOutput only on instances carrying the deployment tag and all four identity tags; Describe{Images,Instances} region-conditioned; S3 bucket create/tag/configure on <managed_fleet_bucket_prefix>* only with an explicit Deny on the deployment, data and staging buckets; IAM user lifecycle on <managed_fleet_user_path>* with CreateUser/PutUserPolicy conditioned on the boundary ARN; no role, PassRole, SSM, instance profile or object access; a precondition refuses the plan past IAM's 10,240-character inline total; tofu only, run on an operator's machine; no box unit, user_data or binary reads the file; no read is added;rev3=census-ruling-media-conversion;basis=the console's managed fleet grant becomes a customer-managed attached policy with identical statements; a temporary input managed_fleets_inline_retired (default false) keeps the old inline copy beside it so the first apply only adds, and true removes the copy; a grant over 6,144 characters stays inline-only and is refused only on retirement; the inline-total precondition now counts every inline policy the module puts on the role, the inline copy included while it exists. No new action, resource or principal. file:external@0 c79539d039dc227dbcb404a8ea65d841ac625293b0afef3df121e4c062a81040
infra/modules/region-host/tests/analytics_prune.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-stats-prune-400;basis=new mock-plan test: the analytics version-prune grant is absent by default and, when on, grants exactly the analytics day-file versions; test-only Terraform, no runtime reads;rev3=census-ruling-media-conversion;basis=mock-plan assertions follow host_analytics_prune to its managed policy and attachment; same grant pinned; no apply, no AWS access. file:external@0 41f2b88e627bb448e7a9b8cfea071a3d4f6e2befafbbd584df928ddb6dceaae7
infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-managed-fleets-2b1;basis=managed fleets 2b-1 Task 5 (new file): 32 OpenTofu test runs, every one command = plan against mock_provider aws (no apply, no AWS access), pinning the rendered grant and boundary to internal/awsmanaged/testdata fixtures, the off and store-only renderings byte for byte, and the variable refusals; run only on a developer's or operator's machine with tofu test; nothing on a box or in any binary reads the file;rev3=census-ruling-media-conversion;basis=mock-plan runs for the managed fleet policy and attachment, the two-apply retirement, the 6,144 refusal on retirement, three regions accepted inline-only, the complete console role's inline total with conversion on, and the conversion prefix refusals with fleets on and off; no apply, no AWS access. file:external@0 621ec28e2b476f0069ec98199a772586198066c5773b1bcd01b1d7e6ab78b7b1
infra/modules/region-host/variables.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-invite-delivery;basis=tofu on an operator's machine with the operator's AWS credentials (no box unit; no binary embeds the file): main's variables with console_mail_from (validated as one lowercase address) and console_mail_region, both empty by default; no read is added and nothing on a box reads the file;rev3=census-ruling-hunt-account-root-hardening;basis=adds deny_release_key_reads (bool, default true); no read is added and nothing on a box reads the file;rev3=census-ruling-region-ha-p3b;basis=Add default-fixed mode and validated group count, zones, pinned image/release/template, ingress, configuration key and transaction-open refusal. Operator-supplied Terraform values select root boot inputs; no direct box runtime read and no group activation by default.;rev3=census-ruling-region-ha-g2-fixes;basis=Add an empty-default set of additional alert topic ARNs, validating concrete SNS topic syntax and excluding wildcards/subscriptions; operator Terraform input, no box runtime read.;rev3=census-ruling-region-ha-g3-fixes;basis=Add optional alerts_topic_arn with concrete same-region SNS ARN validation and mutual exclusion with alerts_email. The caller owns the existing topic policy and subscriptions; no runtime sink is configured and no new root read is added.;rev3=census-ruling-managed-fleets-2b1;basis=managed fleets 2b-1 Task 5: five variables, managed_fleets_enabled (bool, default false, refused unless mode is fixed), managed_fleets_deployment, managed_fleets_regions (concrete ami/subnet/sg IDs, arm64 types, no ID in two regions), managed_fleet_bucket_prefix (1-24 chars, no reserved prefix, must not cover the deployment, data or staging buckets, disjoint from store_bucket_prefix) and managed_fleet_user_path (literal IAM path, disjoint from store_user_path); store_bucket_prefix and store_user_path gain a validation refusing *, ? or ${ only when managed fleets and object storage are both on; operator Terraform input only; no box runtime read and nothing on a box reads the file;rev3=census-ruling-fixedbox-health-alarms;basis=Add optional health_alerts_topic_arn (concrete same-region SNS ARN validation, empty default); enable_auto_recovery description covers both status alarms. Operator Terraform input; no box runtime read.;rev3=census-ruling-w6-ingress-drain;basis=new variable ingress_target_group_arns (list(string), default [], non-nullable) validated as distinct ELB target group ARNs (arn:aws(-x)*:elasticloadbalancing:<region>:<12 digits>:targetgroup/<name>/<16 hex>); drives the IAM policy and output above. No read added.;rev3=census-ruling-stats-prune-400;basis=new variable enable_analytics_version_prune (bool, default false) driving the policy above; operator Terraform input; no box runtime read;rev3=census-ruling-platform-mail-submission;basis=Task 8: variable "mailer", an object {ses_region, ses_account_id, deployment_bucket_region, optional deployment_bucket_kms_key_arn} defaulting to null, which creates nothing; validated (AWS region shapes, 12-digit account, KMS ARN or empty).;rev3=census-ruling-media-conversion;basis=two variables: store_conversion (bool, default false) and managed_fleets_inline_retired (bool, default false, temporary); operator Terraform input only; no box runtime read. file:external@0 da31f31bcdcf0369954fe21b730589b456605a92b6b07674a7e48b76a75b8dca
-infra/modules/media-engine/ecs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: ECR repository (immutable tags, scan on push), Fargate-only cluster, four task definitions (deadline + codec containers, entryPoint /usr/local/bin/carlos-media, read-only root, user 65534, caps dropped, no task role, image by digest) created only once image_digest is set, with skip_destroy so a rollout keeps the revisions a running console uses. file:external@0 e2235db156b7cf1f4c70ebd7515c0c6e27bab4ad2b73af4eb232498733672c90
+infra/modules/media-engine/ecs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: Fargate-only cluster and four task definitions (deadline + codec containers, entryPoint /usr/local/bin/carlos-media, read-only root, user 65534, caps dropped, no task role, image by digest) created only once image_digest is set, with skip_destroy so a rollout keeps the revisions a running console uses. file:external@0 e2235db156b7cf1f4c70ebd7515c0c6e27bab4ad2b73af4eb232498733672c90
infra/modules/media-engine/iam.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: task execution role (ECR pull and the log group only); conversion role trusted only by the console role, Allow GetObject on store objects and PutObject on derived/ and media-results/, Deny GetObject on infected objects and any PutObject setting carlos-scan tags, 1 h sessions; the console role's customer-managed policy: AssumeRole on the conversion role, RunTask on this engine's task definitions in its cluster, Describe/Stop/List tasks in the cluster, DescribeTaskDefinition, PassRole of the execution role to ecs-tasks, ListBucket on the deployment bucket. file:external@0 d97d49b0881fa91f8a1aff3bfa9bd10eb152254b9c0014bc75c36976f9d52645
-infra/modules/media-engine/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new module (Task 11): locals and the region precondition (region == store_region) for a per-conversion Fargate engine; tofu only, operator machine; nothing on a box reads it. file:external@0 87586e2a1c7a61538170864dbef9507ffca30858b4d2db398962745b35e99c60
+infra/modules/media-engine/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new module (Task 11): locals and the region precondition (region == store_region); the ECR repository (immutable tags, scan on push); the repository policy, created only by the drill input and granting pull to one operator-chosen foreign drill user, with a precondition refusing a principal in this module's own account; the engine log group. tofu only, operator machine; nothing on a box reads it. file:external@0 87586e2a1c7a61538170864dbef9507ffca30858b4d2db398962745b35e99c60
infra/modules/media-engine/network.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: a VPC with two private subnets, no internet gateway, NAT or default route; a tasks security group with no ingress and HTTPS egress only to the S3 prefix list and the endpoints; S3 gateway and ECR/logs interface endpoints with principal-scoped policies; a Route 53 Resolver DNS firewall allowing only the S3, ECR and logs names (TRUST_REDIRECTION_DOMAIN on that ALLOW only) and blocking the rest with NXDOMAIN, fail-closed; the drill input changes only the four endpoint policies and the repository policy. file:external@0 47665cc7dcac49d5287851ba3dee2f49c04f11aece10e6870de1dcbb9b997932
infra/modules/media-engine/outputs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: carlos_media_engine (JSON of the mediaaws Config, empty until a digest exists), repository URL, cluster ARN, conversion role ARN; the operator copies carlos_media_engine into CARLOS_MEDIA_ENGINE on the console. file:external@0 f2d0a22caee4b25bef387cc5c2ac4a00c3a3becd324ee05581405df6489d6801
infra/modules/media-engine/reaper.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: a Python 3.13 Lambda on a 1-minute EventBridge rule that stops this cluster's tasks older than reaper_max_age_minutes; its role can only list, describe and stop tasks in this cluster and log to its own group. file:external@0 06ac29d314be92a4109e33dced1572d4c684882108d627764714b883b62feb44
infra/modules/media-engine/reaper/reaper.py external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new Lambda handler: lists RUNNING tasks in CLUSTER, describes them in batches, stops those older than MAX_AGE_MINUTES; reads no other input; runs in AWS, not on a box. file:external@0 aaeec79227dfdc851b9ca9fd789e36c6e7a5cc1deb44eea47c88fd8a09a6be86
infra/modules/media-engine/reaper/reaper_test.py external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new stdlib unittest with a stub ECS client; no AWS access. file:external@0 ccd9ca7a2ffb86c812412915754da6cf875db5bc4f2f63faefb4175fecbada5d
-infra/modules/media-engine/tests/media_engine.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new mock-plan tests (24 runs): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses; no apply, no AWS access. file:external@0 688688b4556ef58d489fa6dcdcdab4e3af823fd0c4e8620c53a73d54e4cfb43c
-infra/modules/media-engine/variables.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: operator inputs (name, regions, store prefix, deployment bucket, console role, image digest and metadata, VPC CIDR, logs, reaper age, task classes, drill object default null with an ARN pattern refusing roles and same-account principals). file:external@0 89293c62780f0fef3315f6e5a9bd7b2a12d951cb573e75e4dd19d5ab835c1dc1
-infra/modules/media-engine/versions.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: OpenTofu and AWS provider version constraints. file:external@0 6f469b46ad4df2c72c4f6a2869c1954b1556357fc5f084845547330634f3826a
+infra/modules/media-engine/tests/media_engine.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new OpenTofu tests (24 runs: 9 plan and 15 apply, all against mock_provider aws, so no AWS access): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses. The archive provider is real and writes the reaper's ZIP to a local path during the test. file:external@0 688688b4556ef58d489fa6dcdcdab4e3af823fd0c4e8620c53a73d54e4cfb43c
+infra/modules/media-engine/variables.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: operator inputs (name, regions, store prefix, deployment bucket, console role, image digest and metadata, VPC CIDR, logs, reaper age, task classes, drill object default null whose ARN pattern admits only an IAM user named carlos-media-drill-<16 hex>; the same-account refusal is main.tf's precondition). file:external@0 89293c62780f0fef3315f6e5a9bd7b2a12d951cb573e75e4dd19d5ab835c1dc1
+infra/modules/media-engine/versions.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: OpenTofu, AWS provider and archive provider version constraints. file:external@0 6f469b46ad4df2c72c4f6a2869c1954b1556357fc5f084845547330634f3826a
infra/modules/region-host/tests/store_conversion.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new mock-plan test: store_conversion off creates nothing and leaves the boundary byte for byte; on grants exactly nine actions on the store prefix, adds the two multipart actions to the boundary, denies the writes on the deployment and data buckets, and refuses broad, overlapping or empty prefixes; no apply, no AWS access. file:external@0 c5c7ba27dc56f32115410573b21b9506aec439218315652acb6b50db9db899f5
@coverage . 699eeea678ad9cb20166ff9413e33c6108d54c827b7659e2abaa65cd23e25487
@coverage infra/modules/media-engine d198b1211971a88612f806ea1f195a9627d5829f09ba510017075fe7a04ef73b