-
Notifications
You must be signed in to change notification settings - Fork 6
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
Existing credential secrets can't be found on MacOS after upgrading to 0.0.12+ #96
Comments
Other observation: version 0.0.11 prompted me for keychain password, 0.0.12/0.0.13 did not prompt before failing. I also notice some slight differences in linked shared library references after 0.0.11 (notably, $ for bin in ./cf-vault-0.0.1*; do otool -L "$bin"; echo; done
./cf-vault-0.0.11:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1677.104.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59306.140.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
./cf-vault-0.0.12:
/usr/lib/libSystem.B.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 0.0.0, current version 0.0.0)
./cf-vault-0.0.13:
/usr/lib/libSystem.B.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 0.0.0, current version 0.0.0) Linked libraries for my locally built version (which would be $ go build .
$ otool -L cf-vault
cf-vault:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60158.100.133)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3) |
thanks for raising this. the 0.0.11+ releases were triggered by GoReleaser (config: https://github.com/jacobbednarz/cf-vault/blob/master/.goreleaser.yml) instead of me building on a local machine with using the only obvious thing i can see is the GCFLAGS missing from GoReleaser - https://github.com/jacobbednarz/cf-vault/blob/master/script/build#L35. i'll drop those into the configs and see if it helps out here. |
My other question is whether the keyring libraries handle linking properly if they're cross-compiled from Linux. Were you building the Darwin binaries on a Macos machine before? (GoReleaser would be building them on Ubuntu now?) |
fwiw, this is working on amd64 mac on 0.0.13 for me.
have i just botched the arm64 side of things? i will have to fire up some VMs to test the other platforms.
that is a good question! i don't know the answer unfortunately.
yep, a (local enough) amd64 machine with a bit more grunt than my daily driver.
correct - https://github.com/jacobbednarz/cf-vault/actions/runs/3034201381/jobs/4883046221#step:5:11 |
For reference, I get the same errors as noted previously if I use the |
I haven't found anything helpful while using XCode tooling to debug, but I confirmed I can replicate the issue by building locally using GoReleaser inside Docker: $ docker run --rm -it -v "$(pwd):/src" golang:bullseye /bin/bash
golang$ wget https://github.com/goreleaser/goreleaser/releases/download/v1.11.2/goreleaser_1.11.2_arm64.deb && dpkg -i goreleaser_1.11.2_arm64.deb && cd /src && git checkout 0.0.13 && goreleaser build
# ...
• starting build...
• loading config file file=.goreleaser.yml
• loading environment variables
• getting and validating git state
• building... commit=4720e71456e9ba1a8ce7db813d87152f2713ede3 latest tag=0.0.13
• parsing tag
• setting defaults
• checking distribution directory
• loading go mod information
• build prerequisites
• writing effective config file
• writing config=dist/config.yaml
• building binaries
• building binary=dist/cf-vault_freebsd_386/cf-vault
• building binary=dist/cf-vault_darwin_amd64_v1/cf-vault
• building binary=dist/cf-vault_freebsd_arm64/cf-vault
• building binary=dist/cf-vault_freebsd_amd64_v1/cf-vault
• building binary=dist/cf-vault_darwin_arm64/cf-vault
• building binary=dist/cf-vault_linux_amd64_v1/cf-vault
• building binary=dist/cf-vault_linux_arm64/cf-vault
• building binary=dist/cf-vault_linux_386/cf-vault
• building binary=dist/cf-vault_windows_amd64_v1/cf-vault.exe
• building binary=dist/cf-vault_windows_arm64/cf-vault.exe
• building binary=dist/cf-vault_windows_386/cf-vault.exe
• took: 55s
• storing release metadata
• writing file=dist/artifacts.json
• writing file=dist/metadata.json
• build succeeded after 55s Running that built binary outside of the Docker container results in the same issue again: $ ./dist/cf-vault_darwin_arm64/cf-vault exec read-only -- true
FATA[0000] failed to get item from keyring: the specified item could not be found in the keyring |
thanks. let me have a dig around the goreleaser issues and see if anyone else has come across this with ARM builds. |
do the versions pre 0.0.11 work for you if you build with goreleaser? just to rule out #63 somehow not working on ARM too. |
I can't build 0.0.11 (for Darwin) using GoReleaser:
|
hmm, probably just goreleaser issue then 😢 |
Today I upgraded to
I went through the setup process again and it's working fine, but with one difference -- where it was using the OSX keychain previously, now it's using JWTs in |
I did a little local dev on the codebase today, and found that it does seem to be related to the release/build process:
So: it seems the issue maybe in how the keychain provider is being chosen, and that is somehow different between local builds and those built for release? Both ways work for me, but it would be good to have it consistent so that folks could continue to use their existing keys when they upgrade. |
Looking historically:
At the moment though, even doing local dev right now I'm getting the file-based keychain, where earlier today I was getting the OSX keychain (I know this is accurate because that specific keychain has today's date on it, and I haven't otherwise touched it since this issue was opened). Happy to help troubleshoot further, just need to figure out what's happening here. |
i'm not getting the same behaviour here on mac 13.4.1 (22F82) amd64, when building locally.
couple of potentially related issues upstream which suggest to me that i'll need to fiddle with the goreleaser cross compiling to get this to work properly. |
cross compiling Go on GitHub Actions may be in the too hard basket for now. @liamdawson @simpsora can you confirm that the assets from https://github.com/jacobbednarz/cf-vault/releases/tag/0.0.15-rc3 work for you? if so, i'll just have to go back to manually building and distributing this package. |
@jacobbednarz I can confirm the opposite -- that version ( $ ./cf-vault -v exec admin-read-only
DEBU[0000] using profile: admin-read-only
Enter passphrase to unlock /<snip>/.cf-vault/keys/: $ sw_vers
ProductName: macOS
ProductVersion: 13.4.1
BuildVersion: 22F82 I'll experiment a bit more with the keychain and local dev tomorrow. Perhaps there's some other factor that's influencing the available keyring backends 🤔 |
hmm, that's interesting. those assets are using the same process I was using locally previously so there is something not quite right here. the easy solution would be to use the file system across all but at this point, I can't say why that is the easy fix. |
There's more discussion on this topic in #147. |
to address this, i'm going to stop building artifacts locally and instead lean on the formula via homebrew (instead of a cask) so that every version/update is built locally on the right arch. it's a bit more annoying but it will fix the cross arch issues we're seeing in the artifacts. |
After upgrading to
cf-vault
0.0.12+, I've been unable to runcf-vault exec
using credentials saved to my keychain. To test the theory that this was connected to versions, I've run a suite of commands against versions0.0.11
,0.0.12
and0.0.13
, allamd64
(my processor isarm64
, but there's noamd64
build of0.0.11
in the releases):Strangely enough, I can't reproduce this issue by building the latest commit (036eb96) locally:
The text was updated successfully, but these errors were encountered: