-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Revoke-ACMECertificiate - Given Certificate as Input (rather than an order) #108
Comments
Hi George, ACME allows two ways to revoke the certificate: The first one is implemented (via passing the order, which will (if not called with the paramters preventing it) store the certificate pem along the order itself) but untested. The second one is currently not implemented, and I am not sure, HOW I would implement it. I'll (try to) provide the following parameter sets:
|
Since we don't keep orders beyond their initial use (ie. acquiring the new certificate), we are in favor of the "PFX" approach. We are already using OpenSSL to convert PFX to PEM (and vice-versa) to resolve another issue (don't recall the issue number), so we know a PEM file can contain the certificate's private key. If the PEM already contains the certificate key, what did you mean by "or via certificate pem and certificate key" ? |
if you want to revoke a certificate the request needs to be signed. Either with the account key (simple, since it's implemented) or via the certificate key (probably simple, but needs to be converted into Json Web Key). I can implement State + PEM (public key only) very easily. Will do on the weekend. |
Can you get the certificate key (the private key, used for signing the revocation request) from the PEM as well? |
I will tell you as soon as I know the answer. |
It seems i can export the public key from the pfx, so it should be possible to implement it. (at least some tests around the matter have been successfull today) |
FYI, I found this: Revoking certificates (see "Using the certificate private key"). While a simple revocation call makes our lives easier, can you imagine the havoc a hacker could inflict if and when he gets a hold of your private key? It's not just about faking your site and swindling users (hard), but with access to a simple revocation mechanism a hacker can easily bring down your site by invalidating your certificate (again, assuming the private key has been compromised). I really expected that revocation would have entailed a challenge from a site-owned server (similar to what's required for getting the certificate in the first place). But hey, what do I know! |
I think, if a hacker gets hold of your private key, the revocation of an ssl certificate might be one of the smaller problems your environment has (hey, thanks to LE you might just get a new cert). |
If you are feeling lucky, you might want to take a look into the dist folder of cert-revokation branch. |
Any sense for an ETA on the cert key implementation Thomas? |
Not yet, I have some work to do for my customers, which has priority over this (I think it's two weeks worth of work). |
So I was looking into the whole complex around using certificates to revoke a certificate and .. uff .. That's a lot of work - especially since I'd probably need more dependencies to NuGet packages, which will allow JW-Tokens, -Keys, etc. from X509Certificates. So I won't make any promises about when that'll make it into the module. |
1.4.0-beta includes |
Sorry for the delay getting to this Thomas. Would you prefer the typical bug report (ie. new issue)? Or would you prefer that I paste what I am seeing here? |
I'll just put it here for now (will move it later if you like): Revoke-ACMECertificate
|
😂 that's a nice typo I made there
Am 03.03.2021 21:11 schrieb George Schiro <[email protected]>:
I'll just put it here for now (will move it later if you like):
Revoke-ACMECertificate
Cannot find the type for custom attribute 'Paremeter'. Make sure that the assembly that contains this type is loaded.
At C:\Users\admin\Desktop\GetCert2\ACME-PS\1.4.0\ACME-PS.psm1:2376 char:9
+ [Paremeter(ParameterSetName = "ByCert")]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ([Paremeter(ParameterSetName = "ByCert")]:AttributeAst) [], RuntimeException
+ FullyQualifiedErrorId : CustomAttributeTypeNotFound
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#108 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACNPDCDZGVBE3QLIUS3CR23TB2JXPANCNFSM4VWJK7BA>.
|
I assume you take the code from the dist folder? If yes, the fix is available. |
Good news, we are no longer seeing an exception. Bad news, we aren't see a PFX option either. Here's the currently supported parameters:
Here's what you wrote last month Thomas:
Looking at the latest in the dist folder, this is what we are seeing (in "ACME-PS.psd1"):
Does that make sense? |
Sources are here: https://github.com/PKISharp/ACME-PS/tree/cert-revocation/dist/ACME-PS |
It's not yet in the master-branch |
Sorry Thomas. I've been running around today. Wrong branch - well duh! Ok, I can see it doesn't prompt for arguments this time with "Revoke-ACMECertificate" by itself. Looking more closely at the code I can see something unexpected (before really thinking about it). Here's what we were hoping for (perhaps naively):
That said, let me know if we need to create new state for the purpose of running just "Revoke-ACMECertificate", for example:
Say the word and that's what we'll test. If there's a way to reduce some of the above, please let me know. |
The state is neccessary, since it's used to create urls and nonce - there is an in memory variant, which you can create with |
NP, we will test without the account details. Thanks! |
Here are the preliminary results:
|
Hey Thomas! I hope all is well. Can you please give me a sense for when you might have some time for this? Any feedback will be appreciated. Thanks! |
I have my test-platform up again, but did not yet have the try revoke certificates. |
I just tested it, and it's .. difficult to say the least .. This means to implement this, for PS-Core I'll need another code path to Invoke-ACMEWebRequest, which can work with I've found some errors, about the revocation with order and account key, which I'll solve, but I don't see how the other code-path would work. |
Well that's disappointing Thomas. Golly, since we can currently import any "Let's Encrypt" PFX file into any local certificate store, successfully bind it to any port and then use its private key for valid SSL requests, I would think you could do the same to get to the PFX's private key for revocation purposes. Why doesn't that make sense? |
It seems the certificate classes have not been build with files in mind, but certificates from the windows store - and this reflects here. Which gives an additional opportunity to (windows users at least). It might be possible to read the cert directly from the store, when it's there ... |
Solved. |
Sorry Thomas. I meant to give it a look over the weekend. Got bogged down with other things. I will take a look soon. Thanks! |
I already tested it for Windows Powershell and it's running. |
Great! Were you able to make it work given just the PFX file (w/PW) and nothing else (other than state)? In other words, does the syntax still look like this:
|
Jep. You're guilty of having me rewrite the authentication-core of ACME-PS ;-) |
LOL NP, I will test it with fresh state and password. Thanks Thomas! |
Well I finally got a chance to test your latest revocation fix. It works! Note: earlier you felt that AccountKey and Account should not be necessary. If you are starting from scratch (ie. entirely new state) these values are indeed necessary. So here's what worked for me:
Thank you for doing this Thomas. Your efforts are greatly appreciated. |
Needing the account key should be a bug here...
|
Yep - definately a bug: ACME-PS/ACME-PS/functions/Certificate/Revoke-Certificate.ps1 Lines 43 to 47 in 0826f08
But simple to fix. |
Hey Thomas! We are ready to start full integration and regression testing the latest version of ACME-PS (we are still using version 1.1.5 in our production systems). It would be nice to test the new revocation feature (sans the account stuff). Do you have a sense for when we might be able to do that? |
It's not in the PSG, yet, but you can get 1.5.1 from /dist/ |
Thank you Thomas. I ran this test through the staging system:
Here's what I am seeing:
|
Anyway, everything else checks out fine, including revocation using the account details (as described on May 8th, see above). So we will proceed with 1.5.1 as it is. Thanks again Thomas. |
The error message indicates, it did not call the code path for an existing private key, thus it tried to get the account key from the state. |
Happy New Year!
In #13 we briefly discussed certificate revocation. You suggested that you could add an implementation that accepts the certificate itself as input (rather than an ACME order).
I responded "Clearly you must be given the private key. In what form? PFX file?"
Any feel for when you might work on this Thomas?
The text was updated successfully, but these errors were encountered: