-
Notifications
You must be signed in to change notification settings - Fork 18
Ensure new-certificate can work without a profile, or document how to load profiles #353
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
Comments
While investigating this, have found that our check of LASTERROR is flawed in the same way as the AD integration's one:
(Edit: verified that this error is only produced with |
It seems like to make this "just work" will require us to use The second option - documenting what to do - seems best right now. However, the solution is effectively:
As a test user, this succeeds. BUT, if I specify my own username this fails on my machine because of the presence of a UAC requirement in Tentacle.exe.manifest:
I'm going to implement a "Knowledge Base" entry for the error, and I've raised #356 for the manifest issue hoping that can be cleared up easily. |
|
See whether CRYPT_MACHINE_KEYSET (32) can be used to make this work without a profile. |
Would it be possible to generate the certificate on a different machine under a process where the profile is loaded and then install the cert on the machine? |
Hi Eric, Yes, this can be done in theory - but hasn't been tested. On the source machine:
On the target machine:
Can't guarantee it will work but has a good chance. |
I think DPAPI is actually going to need the profile loaded. Which I cannot |
Local machine scope should do it, if that's possible. |
I think this boils down to the same issue that was document in this post. maybe my entire approach to automating the tentacle installation is wrong. |
Ick, no good then. Thanks for the info. I think PowerShell automation is the goal here, reopening this issue since we reverted the fix. Here's a workaround you might consider:
If that does solve the problem for you I'll look at how we might build this in (or even just provide a non-elevating executable cut from Thanks for the continued input. |
I spent the last two days trying variations of using start-process, cmd /c "echo password | runas /profile /user: ....... But I was not able to get that to run and accept the password. For now, I will have to pop up a rdp and let someone click on a batch file, Its too bad, I was able to install, team city, sql server, java, chrome, |
Hi Eric, I'm going to look at doing this without loaded profiles, but in the meantime - deleting Tentacle.exe.manifest did resolve problems with the RUNAS command for me. I know it was pretty fragile though, not a great experience. Will follow up here with our next attempt. BTW, @robdmoore might have encountered this building https://github.com/MRCollective/AzureWebFarm.OctopusDeploy --- any insights Rob? |
No, thankfully I didn't come across that problem, but that makes sense because I'm pretty sure that the RoleEntryPoint runs as a real user. @erichexter feel free to check out https://github.com/MRCollective/AzureWebFarm.OctopusDeploy :) |
@robdmoore thanks Rob! |
Thanks I checked it out. Cool project!. I think I will try running the configure as a scheduled task on the On Wednesday, January 8, 2014, Nicholas Blumhardt wrote:
Eric Hexter blog | http://Hex.LosTechies.com |
@erichexter just curious, is it possible to run Our other option seems to be to investigate a purely-managed API for cert generation, and possibly to bypass DPAPI when certs are configured this way. Trying to steer away from this because of the fragility that seems to come with all changes cryptographic. |
Let me see is I can get that to work with running dir or something else. On Wednesday, January 8, 2014, Nicholas Blumhardt wrote:
Eric Hexter blog | http://Hex.LosTechies.com |
I was able to get this working by invoking the process as a scheduled task Eric Hexter blog | http://Hex.LosTechies.com On Wed, Jan 8, 2014 at 8:18 PM, Eric Hexter eric.hexter@gmail.com wrote:
|
Eric - I am having the exact same issue. Any help you can post on how to do this with the schedule task is greatly appreciated. |
I was going to try to reply with the code inline, but that will be a mess. use invoke-command to remotely create a scheduled task .
|
Investigating the option of generating the cert on another maching, then importing it into Tentacle. This seems like it will be fine with machine-scoped DPAPI; the only real question is whether we should require a password on the exported certificates, which adds a little bit of effort. Close to having this PoC'd but now off for a short holiday, so picking this up on my return. |
Done; to create a certificate on a workstation machine run:
To import the certificate on the Tentacle machine, run:
(The target Tentacle should probably not be running when this is done.) The exported ceritificate format is a simple clear-text base-64 file; this should be protected/treated as sensitive configuration. Any issues (once dropped in 2.4) please let us know. Thanks for all the input! |
Hi, nblumhardt I just tried Tentacle.exe new-certificate --export-file="cert.txt" and received the following error. Im using Tentacle version 2.1.3.1223 A fatal exception occurred I've also tried --import-file bu this is not recognised. Are these arguments deprecated in V2 and is there another way of achieving this. My goal is to deploy tentacle via a Chef cookbook |
It will be in version 2.4 On Thursday, April 3, 2014, Nielsen Pierce notifications@github.com wrote:
Eric Hexter blog | http://Hex.LosTechies.com |
How close it 2.4 getting to a preview release? I am looking into vagrant Eric Hexter blog | http://Hex.LosTechies.com On Thu, Apr 3, 2014 at 10:02 AM, Eric Hexter eric.hexter@gmail.com wrote:
|
I could be optimistic, but it is looking like we'll have a -pre up within a week. HTH. |
^H^H^H^Ham known for always being optimistic ;) |
2.4.1 is in preview now. |
Great
Eric Hexter blog | http://Hex.LosTechies.com |
Are you passing the --console command line argument? |
Hey! Sorry for the lag in response; that’s why I deleted the post :D . Looking to migrate from Red Gate Deployment Manager to Octopus and still have to get used to great documentation Paul Zah From: Robert Moore [mailto:notifications@github.com] Are you passing the --console command line argument? — |
Hello. We are looking into migrating to Octopus from RGDM and I’m trying to write an automatic migration script. I’ve hit an issue I’ve been really struggling with for the couple of days (the only bit of documentationhttps://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/DeploymentProcesses that was not easy-to-understand). I am trying to add code-generated steps into a deployment process. The docs say that you can use a PUT request to /api/deploymentprocesses/{id}, but I have not been able to deduce the expected contents of the body of the request (I prefer API calls due to the nature of the Powershell migration script). I would really appreciate any assistance you could provide with this. Paul Zah From: Robert Moore [mailto:notifications@github.com] Are you passing the --console command line argument? — |
Hi @paulzah - thanks for getting in touch; automatic migration down this path sounds like a tricky undertaking, though we may have a few ideas to share. Can you please contact support@octopusdeploy.com so that we can continue the discussion there? Many thanks! |
Can I be included on that discussion? I'm really interested in the automated provision of OctopusDeploy steps... |
Hey Rob - the discussion will probably stick to how best to migrate from RGDM, so maybe not an exact match. Feel free to open another ticket with any Q's you have in that area though! |
Cool. Thanks. |
I've sent a message in to the support email, but am also looking for a way to deploy the Octopus tentacle agent to an Azure VM using WinRM / PowerShell. I have pretty much automated my entire environment setup in Azure, but its just the new-certificate part using Tentacle.exe that does not work without a profile. Have you guys got any workarounds or solutions to this? |
Yes, you need to run your tentacle registration as a scheduled task, on the Here is gist of two functions I use to do this in azure using remote Feel free to ask questions on this thread or comment on the gist itself and Eric Hexter blog | http://Hex.LosTechies.com On Thu, Aug 14, 2014 at 10:18 AM, Sean notifications@github.com wrote:
|
Ahh, brilliant stuff Eric. I will give this a go tonight or tomorrow - looks solid enough after having had a quick look at the gist. Thank you for your quick reply here 👍 |
I just ran into this trying to provision a tentacle via chef. We perform the initial provisioning run over winrm which has all the same restrictions as powershell remoting. @erichexter's approach is unfortunately the only approach likely to work here. I had success installing via boxstarter.org which basically does just that. It would be great if there was another way of generating the cert without needing the local user token. Scheduled tasks are such a pain. Funny, I just wrote a blog last week on this exact topic: http://www.hurryupandwait.io/blog/safely-running-windows-automation-operations-that-typically-fail-over-winrm-or-powershell-remoting |
I agree this approach sucks. But it has been reliable, we have scripted On Tuesday, January 27, 2015, Matt Wrock notifications@github.com wrote: |
Has there been any updates to this ? Or the only solution is to run the configuration as a scheduled task ? @PaulStovell @erichexter |
There is a new export and import commands on the tentacle exe On Saturday, September 26, 2015, Patrik notifications@github.com wrote: |
Thanks, that lead me to : http://docs.octopusdeploy.com/display/OD/Export+and+import+Tentacle+certificates+without+a+profile So now it's working :) |
@mwrock do you have a confirmed way to configure via chef ? |
Unfortunately I don't have access to those recipes anymore @erichexter . I do remember we had to have the recipe create a scheduled task which ran a script that did the install. We then polled the tentacle endpoint waiting or it to come online. |
I wrote a blog post on how we got around this using OpenSSL to pre-stage certificates for importing. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately. |
Issue:
http://help.octopusdeploy.com/discussions/problems/13114-tentacle-new-certificate-throwing-unauthorisedaccessexception
Can we try and reproduce this, and then:
The text was updated successfully, but these errors were encountered: