Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automated "secure" code signing

I want to set up the jobs in our buildserver (Jenkins) to automatically sign the generated jars.

For obvious reasons I do not want to put the certificate and credentials in the version control, or even readable in the job configuration.

Ideally I want to have some kind of "signing server" where the buildserver can send a jar to, to be signed.

According to the documentation the Eclipse project has a system like that. But there's no mention on the technology they use.

So does anybody know of a "singing server" solution, or a different way to solve this problem?

like image 376
elmuerte Avatar asked Aug 13 '12 08:08

elmuerte


People also ask

What is the difference between code signing and EV code signing?

Regular Code Signing – both gives secure environment to developers for their software codes. EV code signing keeps the private key secret using hardware token whereas in Regular code signing the private key is not provided in a separate external drive.

Can I create my own code signing certificate?

If you don't use Microsoft Visual Studio 2012 to create and sign your app packages, you need to create and manage your own code signing certificates. You can create certificates by using MakeCert.exe and Pvk2Pfx.exe from the Windows Driver Kit (WDK).

What is a code signing machine?

Code signing is used on Windows and Mac OS X to authenticate software on first run, ensuring that the software has not been maliciously tampered with by a third-party distributor or download site.

What is code signing in security?

Code signing is a method of putting a digital signature on a program, file, software update or executable, so that its authenticity and integrity can be verified upon installation and execution. Like a wax seal, it guarantees to the recipient who the author is, and that it hasn't been opened and tampered with.


2 Answers

I am not sure about existing solution. However, I think you can build a solution on your own within a day:

Machine A will run Jenkins and have a shared folder Machine B will run any application/web server (as example Apache + PHP) and which has signing keys.

As part of Jenkins job you do following actions: a) Copy jars to shared folder b) Run shell script "wget http:// machineBURL /sign.php?filename=SomeJar.jar"

On Machine B you will have PHP script, which will get a passed filename, get the jar with this filename from shared folder, sign it and put it back in the same folder.

like image 81
Victor Ronin Avatar answered Sep 23 '22 13:09

Victor Ronin


Eclispe WIKI documented the sign process, for short

  • Use scp to copy the eclipse-master-${buildId}.zip to the eclipse.org signing staging area using pserver.

<exec dir="${packtmp}" executable="scp" output="signing.txt"> <arg line="${archiveName} dev.eclipse.org:${stagingDirectory}"/> </exec>

  • Invoke the signing script /usr/bin/sign on signing server.

<exec dir="." executable="ssh" output="signing.txt" append="true"> <arg line="build.eclipse.org "cd ${stagingDirectory}; /usr/bin/sign ${stagingDirectory}/${archiveName} mail ${stagingDirectoryOutput}""/> </exec>

  • Poll the server for the signed file in the output directory.

<exec dir="." executable="scp" output="signing.txt" append="true"> <arg line="dev.eclipse.org:${stagingDirectory}/${buildId}-out/${archiveName} ${buildDirectory}/${buildLabel}"/> </exec>

like image 35
Ted Shaw Avatar answered Sep 23 '22 13:09

Ted Shaw