-
Notifications
You must be signed in to change notification settings - Fork 110
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
Signing issue when keypair provisioned with Terraform #574
Comments
@authentichz, thank you for the ticket, we'll take a look. |
We have faced the same issue Debug mode Terraform configurationterraform {
required_providers {
artifactory = {
source = "jfrog/artifactory"
version = ">=6.11.0"
}
}
required_version = ">=1.2.2"
}
resource "artifactory_keypair" "passphrased_key_trace_test" {
pair_name = "passphrased_key_trace_test"
pair_type = "GPG"
alias = "passphrased_key_trace_test"
private_key = file(var.gpg_private_key_with_passphrase)
public_key = file(var.gpg_public_key_with_passphrase)
passphrase = var.gpg_key_passphrase
lifecycle {
ignore_changes = [
private_key,
passphrase,
]
}
}
Debug output2022-10-27T13:52:51.427Z [DEBUG] [aws-sdk-go] DEBUG: Request s3/PutObject Details:
---[ REQUEST POST-SIGN ]-----------------------------
PUT /artifactory-terraform/artifactory.tfstate HTTP/1.1
Host: s3-host.example.com
User-Agent: APN/1.0 HashiCorp/1.0 Terraform/1.2.2 aws-sdk-go/1.42.35 (go1.18.1; linux; amd64)
Content-Length: 307635
Authorization: AWS4-HMAC-SHA256 Credential=[MASKED]/20221027/default/s3/aws4_request, SignedHeaders=content-length;content-md5;content-type;host;x-amz-content-sha256;x-amz-date, Signature=cd1354e80ea8a95skdd874c5a67c7b2049b07cd92m5e3d52053fc349e0885614
Content-Md5: ijvz4RKjdyH9t8vxvs2fUg==
Content-Type: application/json
X-Amz-Content-Sha256: a0f57da0c9a257a64ca0888e4461c0c77abe3c3865744ad6ad34a7d5a727fd23
X-Amz-Date: 20221027T135251Z
Accept-Encoding: gzip
....
{
"mode": "managed",
"type": "artifactory_keypair",
"name": "passphrased_key_trace_test",
"provider": "provider[\"registry.terraform.io/jfrog/artifactory\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"alias": "passphrased_key_trace_test",
"id": "passphrased_key_trace_test",
"pair_name": "passphrased_key_trace_test",
"pair_type": "GPG",
"passphrase": "",
"private_key": "-----BEGIN PGP PRIVATE KEY BLOCK-----DATA_GOES_HERE_IN_PLAIN_TEXT-----END PGP PRIVATE KEY BLOCK-----",
"public_key": "-----BEGIN PGP PUBLIC KEY BLOCK-----DATA_GOES_HERE_IN_PLAIN_TEXT-----END PGP PUBLIC KEY BLOCK-----",
"unavailable": false
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
}
... The documentation says |
Hey @oleg-sapegin-quadcode - I wrote most/all of this code. Your observation about the passphrase is correct. If I remember right, when i tried to send the passphrase, it simply failed at the API level with no explanation. I tried anything I could think of, but it didn't work. The API documentation simply doesn't work as is and took a lot of reverse engineering to figure out how to get anything to work at all. You'll notice, for example, in the tests for this the public and private keys have to have literal @alexhung @danielmkn will almost certainly need to take this up with the artifactory/product team. I am pretty sure it's a bug. Even if it isn't, it's usage is not at all obvious |
Thanks, @chb0github! We are planning to look into it again, but I'm pretty sure we will have to just add some clarification to the attribute description since there is nothing to fix it in the provider. |
'passphrase' attribute was not in the unpack function, thus was never in the API call body. After the change, the Provider can successfully send the attribute value, and it's saved in the state.
GH-574 signing issue with the keypair
Fixed in |
We am using jfrog/artifactory v6.9.1:
We see the keypair within the UI so it gets created. The issue is that the Release file does not get signed so we enabled the Debian debug logs on Artifactory and see the following log:
2022-10-26 21:49:27,487Z [jfrt ] [DEBUG] [e42a9544c225f0db] [bianReleaseMetadataIndexer:115] [art-exec-8 ] - Skipping the creation of InRelease file: missing private signing key or password
2022-10-26 21:49:27,560Z [jfrt ] [DEBUG] [e42a9544c225f0db] [bianReleaseMetadataIndexer:252] [art-exec-8 ] - Skipping the signing process: missing private signing key or password
The issue looks to be with providing the passphrase, but we see other issues if we don't provide this passphrase.
The text was updated successfully, but these errors were encountered: