-
Notifications
You must be signed in to change notification settings - Fork 93
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
Sign VBA project #126
Comments
After reading into what VBA signing is, I figured out that Signing a VBA file is in fact done by SignedCms. Looking at the source from EPPlus I found that it is doing it that way. Except that we do not have a private key, the azure key vault has. So perhaps this issue is related And implemented into .net core 3.0 and newer Any idea's to support SignedCms inside AzureSignTool? Or am I missing something? |
Just wanted to add my name to this. As above. Would be great if this could be resolved. |
Need this functionality urgently. Government contract. Cert is an EV HSM-RSA AzureKeyVault cert. |
Adding my voice to the above, urgent need to sign VBA project in a local .xlsm file. As of recently, our certificate provider no longer allows their standard code signing certificates to be exported as a .pfx file, in order to comply with CA/B changes to improve private key protection: We are therefore unable to install the certificate on any machines, and can only apply digital signatures to VBA projects in .xlsm files using the FIPS 140‐2 Level 2 compliant secure USB token onto which the certificate has been installed... which can obviously be used by only one person at a time, and is therefore a single point of failure. This is particularly problematic given that I am that one person/SPoF, and I am a remote worker! As noted by @akamisarau above, I'm just getting the following when I try AzureSignTool from cmd: Please could you provide an update on progress with this much-needed functionality, thanks. |
I can confirm this is at least possible, I got a PoC working (not based on AzureSignTool though) |
Is there a call at which can be hooked? Because when I used the API Monitor and the SIP was signing data the process behaved differently then signtool doing MSI/EXE/DLL files. And I wasn't able to find hook for that process. |
Hooking is not necessary, you can simply just use the |
I also posted my C++ implementation of essentially the same thing: https://github.com/namazso/AzuKI Using the x86 signtool and x86 build following the earlier stackoverflow answer can correctly sign various office files with VBA. Not sure if they're supposed to be visible or have any effect (it still gets blocked by Excel), but it passes signtool verify. |
Ahh yes I too would like this facility. |
Adding my voice to this request, as well as a hearty thank you to everyone who has worked on this repo :-) I don't think I have the skills to do this myself, but if someone can talk me through the outlines of what would be required, happy to try and do the work... |
Adding my name to this. |
Adding another interested party for this feature. |
It is already possible to sign xlsm/... files with AzureSignTool. Thanks @vcsjones for the great work!
So does AzureSignTool. The important point here is that the Office SIPs are x86/32bit only and modern .NET apps tend to execute as 64bit. This works for me:
git clone https://github.com/vcsjones/AzureSignTool.git
cd AzureSignTool/src/AzureSignTool
dotnet run sign "D:\signtest.xlsm" -kvm -kvu https://contoso-codesigning.vault.azure.net/ -kvc contoso-codesigning-ov -tr http://timestamp.acs.microsoft.com/ -r win-x86
dotnet run sign "D:\signtest.xlsm" -kvm -kvu https://contoso-codesigning.vault.azure.net/ -kvc contoso-codesigning-ov -tr http://timestamp.acs.microsoft.com/ -r win-x86
dotnet run sign "D:\signtest.xlsm" -kvm -kvu https://contoso-codesigning.vault.azure.net/ -kvc contoso-codesigning-ov -tr http://timestamp.acs.microsoft.com/ -r win-x86
|
EDIT: it looks like I solved the problem below. The problem is that the Regsvr32 step required to install the SIP doesn't "stick around" - it needs to be run in the same terminal session as the actual signtool. In particular, if you're using github actions to do this, it needs to be run in the same run command First off, thanks so much for adding this feature! I tried all the steps, but unfortunately I'm getting this error: Signing failed with error 800403F4. I tried to follow the instructions here and use an older version of the C++ redistributables, but to no avail - same error. Any idea what might be going on? The error message is somewhat cryptic... Thanks so much! Full output: trce: AzureSignTool.SignCommand[0] |
I can confirm that these instructions did the trick for us. |
Can AzureSignTool sign VBA macro projects inside word, excel, etc?
Microsoft Signtool allows it when there is a special SIP package installed
https://stackoverflow.com/a/57039432/578552
The text was updated successfully, but these errors were encountered: