InnoSetup | Azure Artifact Signing | PFX | Codesigning | jsign
794
The Docker Image is based on Debian and has the following components installed:
aas-codesign.sh and pfx-codesign.sh.pfx
aas-codesign.sh [FILE] [PATTERN] [@FILELIST]...pfx-codesign.sh [FILE] [PATTERN] [@FILELIST]...[FILE] [PATTERN] [@FILELIST]...iscc.sh '[InnoSetup Parameters]'aas-codesign.bat | pfx-codesign.bat.pfxSource:
Please refer to the documentation of the included tools:
You can use this Docker Image to do Windows Code Signing using Azure Artifact Signing or a codesign certificate .pfx.
Please refer to the examples of the Docker Image jotools/codesign.
Note
Only use this Docker Image to build windows installers using InnoSetup.
If you intend to only use codesigning (without creating windows installers), head over to the smaller Docker Imagejotools/codesign.
Note
InnoSetup is running as a windows application.
So it's parameters need to be in windows style.
The drive letterZ:\will be the Docker Container's root/.
SoZ:\datawill be the mounted/data.
Note
You can skip the Configuration for Codesigning if you just want to build a windows installer without codesigning.
Create the following two .json files on your host machine:
azure.json
{
"TenantId": "[Azure Tenant Id]",
"ClientId": "[Azure Client Id]",
"ClientSecret": "[Azure Client Secret]"
}
acs.json
{
"Endpoint": "https://weu.codesigning.azure.net",
"CodeSigningAccountName": "[ACS Code Signing Account Name]",
"CertificateProfileName": "[ACS Certificate Profile Name]"
}
And mount them into the following location when running the Docker Container:
/etc/aas-codesign/azure.json
/etc/aas-codesign/acs.json
Instead of mounting the two .json files, you can also provide the configuration via Environment Variables:
AZURE_TENANT_ID=[Azure Tenant Id]
AZURE_CLIENT_ID=[Azure Client Id]
AZURE_CLIENT_SECRET=[Azure Client Secret]
ACS_ENDPOINT=https://weu.codesigning.azure.net
ACS_ACCOUNT_NAME=[ACS Code Signing Account Name]
ACS_CERTIFICATE_PROFILE_NAME=[ACS Certificate Profile Name]
The Timestamp Server will be automatically chosen by jsign.
To change it you can set the Environment Variables:
TIMESTAMP_SERVER=http://timestamp.domain.org
TIMESTAMP_MODE=[RFC3161|Authenticode]
Create the following .json file on your host machine:
pfx.json
{
"Password": "pfx-password",
"TimestampServer": "http://timestamp.digicert.com",
"TimestampMode": "Authenticode"
}
Have your codesign certificate certificate.pfx located on your host machine.
Mount them into the following location when running the Docker Container:
/etc/pfx-codesign/pfx.json
/etc/pfx-codesign/certificate.pfx (Note: always required)
Instead of mounting the .json file, you can also provide the configuration via Environment Variable:
PFX_PASSWORD=[PFX Password]
TIMESTAMP_SERVER=http://timestamp.domain.org
TIMESTAMP_MODE=[RFC3161|Authenticode]
iscc.shThe included Shell Script iscc.sh is a helper script which will
aas-codesign.bat or pfx-codesign.bat, which will call aas-codesign.sh or pfx-codesign.sh in the linux environment to
.json filesThe following example will
jotools/innosetup.json files stored on the host machine/datamy-installer.issiscc.shdocker run \
--rm \
-v /local/path/to/acs.json:/etc/aas-codesign/acs.json \
-v /local/path/to/azure.json:/etc/aas-codesign/azure.json \
-v /local/path/to/build-folder:/data \
-w /data \
--entrypoint iscc.sh \
jotools/innosetup \
'"/SCodeSignScript=Z:/usr/local/bin/aas-codesign.bat \$f" /O"Z:/data" /Dsourcepath="Z:/data/My Windows Application" "Z:/data/my-installer.iss"'
The following example will
acs.json and azure.json/datashiscc.sh '"/SCodeSignAAS=Z:/usr/local/bin/aas-codesign.bat \$f" /O"Z:/data" /Dsourcepath="Z:/data/My Windows Application" "Z:/data/my-installer.iss"'docker run \
--rm \
-it \
--entrypoint sh \
-v /local/path/to/acs.json:/etc/aas-codesign/acs.json \
-v /local/path/to/azure.json:/etc/aas-codesign/azure.json \
-v /local/path/to/build-folder:/data \
jotools/innosetup
The following example will
jotools/innosetup.pfx and configuration pfx.json stored on the host machine/datamy-installer.issiscc.shdocker run \
--rm \
-v /local/path/to/pfx.json:/etc/pfx-codesign/pfx.json \
-v /local/path/to/my-certificate.pfx:/etc/pfx-codesign/certificate.pfx \
-v /local/path/to/build-folder:/data \
-w /data \
--entrypoint iscc.sh \
jotools/innosetup \
'"/SCodeSignScript=Z:/usr/local/bin/pfx-codesign.bat \$f" /O"Z:/data" /Dsourcepath="Z:/data/My Windows Application" "Z:/data/my-installer.iss"'
The following example will
.pfx and configuration pfx.json stored on the host machine/datashiscc.sh '"/SCodeSignScript=Z:/usr/local/bin/pfx-codesign.bat \$f" /O"Z:/data" /Dsourcepath="Z:/data/My Windows Application" "Z:/data/my-installer.iss"'docker run \
--rm \
-it \
--entrypoint sh \
-v /local/path/to/pfx.json:/etc/pfx-codesign/pfx.json \
-v /local/path/to/my-certificate.pfx:/etc/pfx-codesign/certificate.pfx \
-v /local/path/to/build-folder:/data \
jotools/innosetup
The following example will
jotools/innosetup/datamy-installer.issiscc.shdocker run \
--rm \
-v /local/path/to/build-folder:/data \
-w /data \
--entrypoint iscc.sh \
jotools/innosetup \
'/O"Z:/data" /Dsourcepath="Z:/data/My Windows Application" "Z:/data/my-installer.iss"'
The following example will
/datashiscc.sh '/O"Z:/data" /Dsourcepath="Z:/data/My Windows Application" "Z:/data/my-installer.iss"'docker run \
--rm \
-it \
--entrypoint sh \
-v /local/path/to/pfx.json:/etc/pfx-codesign/pfx.json \
-v /local/path/to/my-certificate.pfx:/etc/pfx-codesign/certificate.pfx \
-v /local/path/to/build-folder:/data \
jotools/innosetup
The provided Scripts aas-codesign.sh and pfx-codesign.sh allow retrieving sensitive information (such as a Client Secret or Certificate Password) from a plaintext .json configuration file, which is not secure.
That's just intended for demonstration and testing purposes only. If using similar logic in a production environment, implement a secure method for managing secrets to protect sensitive information.
Retrieve the secrets from a secure storage, and run the Docker Container from the script with the corresponding Environment Variables, omitting the secrets in the .json configuration files.
Storing secrets in plaintext files poses significant security risks, including:
Instead of storing secrets in a .json configuration file, consider these more secure approaches:
Use OS-Level Secret Storage
security CLI tool.Use a Secrets Manager
Use GitHub Actions Secrets (for CI/CD Pipelines)
${{ secrets.MY_SECRET }} instead of storing them in the repository.
Do you like this project? Does it help you? Has it saved you time and money?
You're welcome - it's free... If you want to say thanks I'd appreciate a message or a small donation via PayPal.
Content type
Image
Digest
sha256:2e0348705…
Size
763 MB
Last updated
2 months ago
docker pull jotools/innosetup