-
Notifications
You must be signed in to change notification settings - Fork 3
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
Agent (facter?) doesn't find credentials in WinCred #47
Comments
|
Running above w/ PuppetMaster & Agent v6.7.2 |
|
For comparison - a run against the same PuppetMaster instance from a Linux node: |
|
Because of this: I suspected the API key is getting rotated on every run. The following workflow seems to confirm that.
|
|
Net-net is while the host identity is created and secrets are pulled correctly, the identity is effectively being recreated on every run, which w/ HF token simply rotates the API key on the second-nth run. At scale this will cause concurrency conflict at the Master, and Puppet nodes will be unable to retrieve secrets at all once the HF token expires. This needs to be addressed before customers can use the Puppet Windows module in production. |
|
This bit of discussion from Slack gives some insight into this bug re:
I tried the flow and on first glance it seems as though suspected current IS current, but it’s not. It only seems that way because there’s a bug in how machine identity is retrieved/persisted into wincreds. Before digging into the wincred issue it’s worth mentioning that the logic responsible for machine identity taking precedence over the host factory token can be found here https://github.com/cyberark/conjur-puppet/blob/conjur-puppet/manifests/init.pp#L20. It shows that host factory tokens are the last to be considered. The reason why suspected current SEEMS like current right now when you run through the flow with an expired HFT after the first successful run is because there’s a mismatch between persistence and retrieval. Suppose you have Appliance URL
You’ll see from above that for appliance URLs (with ports) the machine identity persisted (BY the conjur module from Puppet Server) can never be retrieved. This actually means that any subsequent runs beyond the initial one where machine identity is established will fail. Pre-provisioned machine identity however might work for multiple runs if you happen to have used a manually set target name that can be retrieved from the appliance URL (e.g. respectively NOTE that persistence (potentially overwriting) is only carried out by the conjur module when the server has the authn_api_key as a fact. This happens when
Once persistence occurs To reiterate, the bug here is that whenever persistence of machine identity is carried out by the conjur module it is highly likely that there will be a mismatch of the wincred target name used to store machine identity and the rules used to retrieve the machine identity, there are certain values of appliance URLs where this isn’t an issue. Where the mismatch IS an issue it results in machine identity not being retrievable on subsequent puppet runs. This results in an auth error where the agent says it can’t find machine identity. In the case where the manifest on the server has a host factory token then the precedence (https://github.com/cyberark/conjur-puppet/blob/conjur-puppet/manifests/init.pp#L20) of machine identity is lost and the logic falls back to using the host factory token. THIS is what makes it seems as though the suspected current IS current. To fix this we simply need to reconcile how machine identity is stored and retrieved. For persistence this must be reflected both in the conjur module and our recommendations for the target name to use when preprovisioning machine identity. |
|
@jodyhuntatx we believe we fixed this in #124. Do you still have an environment that you could try our local version of the plugin with to validate that you are no longer impacted by this issue? Please let us know if you'd like to try to see if your issue is resolved, either now or in a week or so once we have a new tag with the fix. If not, we'll close this issue - please report if you see any kind of problem like this again, we'll be glad to get it fixed up! |
Initial run on new Winserver 2008 R2 VM - new host identity correctly created w/ host factory:
Second run - identity not found, seems to be updating the existing credential:
Test code in: https://github.com/jodyhuntatx/dap-demo-env/tree/master/PUPPET_demo
The text was updated successfully, but these errors were encountered: