Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token request for impersonate his keep on terraform.tfstate #4011

Closed
akolacz opened this issue Jul 12, 2019 · 2 comments
Closed

token request for impersonate his keep on terraform.tfstate #4011

akolacz opened this issue Jul 12, 2019 · 2 comments
Labels
bug forward/review In review; remove label to forward service/iam-serviceaccount

Comments

@akolacz
Copy link

akolacz commented Jul 12, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Problem

I think it's a problem to have data for google_service_account_access_token in terraform.tftstate and we have token in clear on it, the another problem i think, is when we have deleted the impersonnate in your code terraform, we have still data of token request in your terraform.tfstate, so we have this error,(you can find error bellow).

Terraform Version

Terraform v0.11.14
+ provider.google v2.10.0

Affected Resource(s)

  • google_service_account_access_token

Terraform Configuration Files

provider "google" {
  version      = "~> 2.10"
  alias        = "default"

  scopes = [
    "https://www.googleapis.com/auth/cloud-platform",
    "https://www.googleapis.com/auth/userinfo.email",
  ]
}

data "google_service_account_access_token" "default" {
  provider               = "google.default"
  target_service_account = "terraform-service-account@myproject.iam.gserviceaccount.com"

  scopes = [
    "userinfo-email",
    "cloud-platform",
  ]

  lifetime = "1200s"
}

provider "google" {
  version      = "~> 2.10"
  access_token = "${data.google_service_account_access_token.default.access_token}"

  scopes = [
    "https://www.googleapis.com/auth/cloud-platform",
    "https://www.googleapis.com/auth/userinfo.email",
  ]
}

terraform.tfstate

"resources": {
                "data.google_service_account_access_token.default": {
                    "type": "google_service_account_access_token",
                    "depends_on": [],
                    "primary": {
                        "id": "2019-07-12 12:43:12.971312588 +0000 UTC",
                        "attributes": {
                            "access_token": "ya29.c.EpgCQwfAJs7BUHh14uKTEnQq5qfH0fhIWv76fakbfizabizab8098LPMyVYJoy_GUPUH1ipxd6NAy6Q-QN0WT9GKKIEUJ2v-m0je67020PhuL6UQrZFACdaudiuzabduo6528JGezVYfezfeaBDIA-Ni5qfqtaNDYVYL68jPzRbJwO5FCT75hQY2GyNMyTZRmjIjvFzFquyqIX03tKUUctxnpK_kOPFwquk2pt9u1VQoDXwYtv2-NDN7ZiYJt7u4DV90oQpv2qNF-FdkemHWPYFRsjCCfa88QbmVYrEYhlyzoFCvbr6UQ90s3H8KGe3n7SMV-Td-6jHRtg3uMi5lH3EIl2u-26l8qnn5-45b3VkTGdV6FauHEV32aTNdH-WdygniBfWFDhcuZEeY-UmpLWyE7YOIA",
                            "id": "2019-07-12 12:43:12.971312588 +0000 UTC",
                            "lifetime": "1200s",
                            "scopes.#": "2",
                            "scopes.1182828848": "userinfo-email",
                            "scopes.1693711811": "cloud-platform",
                            "target_service_account": "terraform-service-account@myproject.iam.gserviceaccount.com"
                        },
                        "meta": {},
                        "tainted": false
                    },
                    "deposed": [],
                    "provider": "provider.google.default"
                },

Debug Output

Error: Error asking for user input: 1 error occurred:
        * data.google_service_account_access_token.default: configuration for provider.google.default is not present; a provider configuration block is required for all operations
@ghost ghost added the bug label Jul 12, 2019
@slevenick
Copy link
Collaborator

Data in terraform state is explicitly clear text

See: https://www.terraform.io/docs/state/sensitive-data.html

@ghost
Copy link

ghost commented Aug 26, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 26, 2019
@ghost ghost removed the waiting-response label Aug 26, 2019
@github-actions github-actions bot added service/iam-serviceaccount forward/review In review; remove label to forward labels Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug forward/review In review; remove label to forward service/iam-serviceaccount
Projects
None yet
Development

No branches or pull requests

2 participants