Skip to content

fix: authorize channel-project vended log delivery - #47

Merged
xnoto merged 1 commit into
mainfrom
fix/authorize-channel-project-vended-log-delivery
Sep 4, 2026
Merged

fix: authorize channel-project vended log delivery#47
xnoto merged 1 commit into
mainfrom
fix/authorize-channel-project-vended-log-delivery

Conversation

@xnoto

@xnoto xnoto commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the AWS-documented CloudWatch Logs V2 vended-delivery permission set and the cloudfront:AllowVendedLogDeliveryForResource authorization to the github-actions-channel-project-site-infrastructure role's inline policy.
  • Three new statements: ManageVendedLogDeliveries (read/write delivery actions scoped to this account's delivery, delivery-source, and delivery-destination ARNs in us-east-1), DescribeVendedLogDeliveries (describe-only actions, Resource: "*" as documented), and AuthorizeSiteVendedLogDelivery (the CloudFront service-specific action scoped to this account's distributions).

Fixes # N/A — evidence-driven follow-up to #44#46 for the channel-project CloudFront standard logging v2 delivery; no tracking issue.

Type of change

  • Bug fix
  • Feature / enhancement
  • Documentation
  • Infrastructure (OpenTofu root or module)
  • GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS secrets)
  • Container image
  • CI / reusable workflow
  • Refactor / cleanup
  • Breaking change

Validation

  • Required pull-request checks pass
  • Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — not applicable; canonical hand-authored OpenTofu.

No local OpenTofu, state, or provider operation was run or claimed. Evidence: the channel-project main apply (run 33914120213) created the distribution E3TJ32HSW2SEZ9, the origin bucket policy, and the PutDeliveryDestination object, then failed solely at PutDeliverySource with AccessDeniedException for cloudfront:AllowVendedLogDeliveryForResource on the distribution ARN. The added permission set follows the AWS-documented policy for V2 vended log delivery to Amazon S3 (CloudWatch Logs vended logs permissions V2 — S3 destinations and service-specific permissions), not mechanically inferred API names.

Impact and rollout

tfroot-aws remains the producer of this role; the consumer configuration in channel-project/tofu/aws/ is unchanged. After merge, the main apply updates only this role's inline policy — no other resource changes are expected in this root. The follow-up is a separately approved rerun of the failed consumer apply to create the two remaining log-delivery resources; nothing in this PR touches registrar, DNS, buckets, distribution configuration, or publication paths.

Safety and secrets

  • Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints
  • No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks
  • Breaking or irreversible effects are described above with rollback notes — none; additive IAM statements scoped to vended-log-delivery objects and distribution log-delivery authorization in this account

AI agent materially produced this change; reviewers should confirm the permission list against the cited AWS documentation and the ARN scoping before authorizing the merge.

Add the AWS-documented CloudWatch Logs V2 delivery permissions and the
CloudFront AllowVendedLogDeliveryForResource authorization to the
channel-project site-infrastructure role. The consumer apply that created
distribution E3TJ32HSW2SEZ9 failed only at PutDeliverySource with
AccessDeniedException for cloudfront:AllowVendedLogDeliveryForResource;
the permission set follows the documented S3-destination vended-delivery
policy, scoped to this account's delivery objects and distributions.
@xnoto
xnoto requested a review from a team as a code owner September 4, 2026 20:09
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Test

OpenTofu test passed.

View the workflow run.

View run output
Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu plan passed.

View the workflow run.

View run output
OpenTofu will perform the following actions:

  # aws_iam_role_policy.github_actions_channel_project_site_infrastructure will be updated in-place
  ~ resource "aws_iam_role_policy" "github_actions_channel_project_site_infrastructure" {
        id     = "github-actions-channel-project-site-infrastructure:channel-project-site-infrastructure"
        name   = "channel-project-site-infrastructure"
      ~ policy = jsonencode(
          ~ {
              ~ Statement = [
                    # (7 unchanged elements hidden)
                    {
                        Action   = [
                            "cloudfront:GetCachePolicy",
                            "cloudfront:GetResponseHeadersPolicy",
                            "cloudfront:ListCachePolicies",
                            "cloudfront:ListResponseHeadersPolicies",
                        ]
                        Effect   = "Allow"
                        Resource = "*"
                        Sid      = "ReadManagedCloudFrontPolicies"
                    },
                  + {
                      + Action   = [
                          + "logs:CreateDelivery",
                          + "logs:DeleteDelivery",
                          + "logs:DeleteDeliveryDestination",
                          + "logs:DeleteDeliveryDestinationPolicy",
                          + "logs:DeleteDeliverySource",
                          + "logs:GetDelivery",
                          + "logs:GetDeliveryDestination",
                          + "logs:GetDeliveryDestinationPolicy",
                          + "logs:GetDeliverySource",
                          + "logs:PutDeliveryDestination",
                          + "logs:PutDeliveryDestinationPolicy",
                          + "logs:PutDeliverySource",
                          + "logs:UpdateDeliveryConfiguration",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:logs:us-east-1:332355796717:delivery:*",
                          + "arn:aws:logs:us-east-1:332355796717:delivery-source:*",
                          + "arn:aws:logs:us-east-1:332355796717:delivery-destination:*",
                        ]
                      + Sid      = "ManageVendedLogDeliveries"
                    },
                  + {
                      + Action   = [
                          + "logs:DescribeConfigurationTemplates",
                          + "logs:DescribeDeliveries",
                          + "logs:DescribeDeliveryDestinations",
                          + "logs:DescribeDeliverySources",
                        ]
                      + Effect   = "Allow"
                      + Resource = "*"
                      + Sid      = "DescribeVendedLogDeliveries"
                    },
                  + {
                      + Action   = [
                          + "cloudfront:AllowVendedLogDeliveryForResource",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:cloudfront::332355796717:distribution/*",
                        ]
                      + Sid      = "AuthorizeSiteVendedLogDelivery"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
OpenTofu will perform the following actions:

  # aws_iam_role_policy.github_actions_channel_project_site_infrastructure will be updated in-place
  ~ resource "aws_iam_role_policy" "github_actions_channel_project_site_infrastructure" {
        id     = "github-actions-channel-project-site-infrastructure:channel-project-site-infrastructure"
        name   = "channel-project-site-infrastructure"
      ~ policy = jsonencode(
          ~ {
              ~ Statement = [
                    # (7 unchanged elements hidden)
                    {
                        Action   = [
                            "cloudfront:GetCachePolicy",
                            "cloudfront:GetResponseHeadersPolicy",
                            "cloudfront:ListCachePolicies",
                            "cloudfront:ListResponseHeadersPolicies",
                        ]
                        Effect   = "Allow"
                        Resource = "*"
                        Sid      = "ReadManagedCloudFrontPolicies"
                    },
                  + {
                      + Action   = [
                          + "logs:CreateDelivery",
                          + "logs:DeleteDelivery",
                          + "logs:DeleteDeliveryDestination",
                          + "logs:DeleteDeliveryDestinationPolicy",
                          + "logs:DeleteDeliverySource",
                          + "logs:GetDelivery",
                          + "logs:GetDeliveryDestination",
                          + "logs:GetDeliveryDestinationPolicy",
                          + "logs:GetDeliverySource",
                          + "logs:PutDeliveryDestination",
                          + "logs:PutDeliveryDestinationPolicy",
                          + "logs:PutDeliverySource",
                          + "logs:UpdateDeliveryConfiguration",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:logs:us-east-1:332355796717:delivery:*",
                          + "arn:aws:logs:us-east-1:332355796717:delivery-source:*",
                          + "arn:aws:logs:us-east-1:332355796717:delivery-destination:*",
                        ]
                      + Sid      = "ManageVendedLogDeliveries"
                    },
                  + {
                      + Action   = [
                          + "logs:DescribeConfigurationTemplates",
                          + "logs:DescribeDeliveries",
                          + "logs:DescribeDeliveryDestinations",
                          + "logs:DescribeDeliverySources",
                        ]
                      + Effect   = "Allow"
                      + Resource = "*"
                      + Sid      = "DescribeVendedLogDeliveries"
                    },
                  + {
                      + Action   = [
                          + "cloudfront:AllowVendedLogDeliveryForResource",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:cloudfront::332355796717:distribution/*",
                        ]
                      + Sid      = "AuthorizeSiteVendedLogDelivery"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

@xnoto
xnoto merged commit 6ea9ec1 into main Sep 4, 2026
4 checks passed
@xnoto
xnoto deleted the fix/authorize-channel-project-vended-log-delivery branch September 4, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant