Skip to content

GCP: VM SA created with official terraform module is missing permissions #3766

@heilerich

Description

@heilerich

Issue description

We are currently trying to deploy constellation in an enterprise GCP account with imposes some restrictions using organization policies. One of those is the unavailability of a default Service Account for Compute Instances which constellation previously relied upon to discover peer instances during bootstrapping (and possibly other things which I am not aware of). This was supposed to be fixed with #3656 in release v2.22.0.

We tried a fresh install using that release. The installation process was still hanging with the bootstrapper service never coming online.
The journal on the control plane machines contained the following error:

{
  "time": "<removed>",
  "level": "ERROR",
  "source": {
    "function": "github.com/edgelesssys/constellation/v2/disk-mapper/internal/rejoinclient.(*RejoinClient).Start",
    "file": "disk-mapper/internal/rejoinclient/rejoinclient.go",
    "line": 82
  },
  "msg": "Failed to get control-plane endpoints",
  "rejoinClient": {
    "error": "retrieving load balancer endpoint from cloud provider: getting regional forwarding rule: error listing global forwarding rules with UID <removed>: googleapi: Error 403: Required 'compute.forwardingRules.list' permission for 'projects/<removed>'"
  }
}

Currently the official terraform module sets the following permissions for the VM service account

permissions = [
"compute.instances.get",
"compute.instances.list",
"compute.subnetworks.get",
"compute.globalForwardingRules.list",
"compute.zones.list",
]

This includes compute.globalForwardingRules.list, but not compute.forwardingRules.list which the error in the bootstrapper log is asking for.

After manually granting the service account the compute.forwardingRules.list permission the constellation bootstrapping process successfully proceeded to starting the control plane processes.

Steps to reproduce the behavior

  • Create a GCP Project and disable the default service account
  • Booststrap constellation using the terraform module and provider

I assume this has been working in your test setup, so I am wondering what might be different in our environment compared your test setup. In order for the official terraform module to work in our GCP organization the additional permission would have to be added.

AFAIK the organization policies active in our environment are the default policy package that comes with an account the uses the Sovereign Cloud offering by T-Systems. We are not trying to install constellation in a sovereign cloud enabled GCP project though. It is just in the same GCP organization as sovereign cloud projects and therefore inherits some of the security policies set on the organization level.

Version

v2.22.0

Constellation Config

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions