cyberark / terraform-provider-conjur

Terraform provider for Conjur
https://docs.conjur.org/Latest/en/Content/terraform_Provider.htm
Apache License 2.0
21 stars 16 forks source link

Error verifying GPG signature for provider "cyberark/conjur" #93

Open JfcAtCyberArk opened 3 years ago

JfcAtCyberArk commented 3 years ago

Summary

Unable to use Conjur provider for Terraform.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Using this simple main.tf
    
    provider "aws" {
    version = "~> 2.0"
    region = "eu-west-3"
    }

provider "cyberark/conjur" { version = "0.6.2" }

2. And this docker image: **hashicorp/terraform:latest** (2021/09/08)

3. `Terraform init` fails with the below error: 

Creating conjur_playground_terraform_run ... done

Initializing the backend...

Initializing provider plugins...

Error verifying GPG signature for provider "cyberark/conjur" Terraform was unable to verify the GPG signature of the downloaded provider files using the keys downloaded from the Terraform Registry. This may mean that the publisher of the provider removed the key it was signed with, or that the distributed files were changed after this version was released.

Error: unable to verify signature

ERROR: 1



## Expected Results
`Terraform init` succeeds 

## Actual Results (including error logs, if applicable)
`Terraform init` fails with GPG error (see above)

## Reproducible
   * [X ] Always 
   * [ ] Sometimes
   * [ ] Non-Reproducible

## Version/Tag number
latest (0.6.2) 
JfcAtCyberArk commented 3 years ago

EDIT I was using an older version of Terraform Docker image version 0.12 It works with actual latest image (2021/09/08 : 1.0.6)

ismarc commented 3 years ago

0.13.0 seems to work without issue with the following main.tf:

terraform {
  required_providers {
    conjur = {
      source = "cyberark/conjur"
      version = "0.6.2"
    }
  }
}

provider "conjur" {}

data "conjur_secret" "myfetchedsecret" {
  name = "dev/openshift/next/version"
}

resource "local_file" "myfetchedsecret-to-file" {
  content = data.conjur_secret.myfetchedsecret.value
  filename = "${path.module}/../myfetchedsecret"
  file_permission = "0664"
}
docker run --rm -it -v $(pwd):$(pwd) --workdir $(pwd) --entrypoint sh hashicorp/terraform:0.13.0
Unable to find image 'hashicorp/terraform:0.13.0' locally
0.13.0: Pulling from hashicorp/terraform
df20fa9351a1: Already exists
488a02600879: Pull complete
7813c92e63e1: Pull complete
Digest: sha256:a017ce0e0c8ba1c80dc2db519aa3aa969bf0e64d98c5a8b262267509a5d21a12
Status: Downloaded newer image for hashicorp/terraform:0.13.0
/Users/Matthew.Brace/temp/terraform-provider # terraform init

Initializing the backend...

Initializing provider plugins...
- Finding cyberark/conjur versions matching "0.6.2"...
- Finding latest version of hashicorp/local...
- Installing cyberark/conjur v0.6.2...
- Installed cyberark/conjur v0.6.2 (self-signed, key ID A83D2D8A08BEAA44)
- Installing hashicorp/local v2.1.0...
- Installed hashicorp/local v2.1.0 (self-signed, key ID 34365D9472D7468F)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/plugins/signing.html

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.

* hashicorp/local: version = "~> 2.1.0"

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
JfcAtCyberArk commented 3 years ago

Reproduced as well, many thanks @ismarc !