From 323458eb5dd1843b62c1da3f7d864abb9167a00f Mon Sep 17 00:00:00 2001 From: Monster Date: Fri, 14 Oct 2022 18:24:52 +0300 Subject: [PATCH 1/7] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e24e4e7..bef59fe 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,6 @@ ``` openssl pkcs12 -in p12.pfx -out p12.pem ``` + +### Собранный образ +https://hub.docker.com/repository/docker/monster1025/gost_cert From aa49d2a406172363681cc41be876d353a28fb2ca Mon Sep 17 00:00:00 2001 From: Monster Date: Fri, 14 Oct 2022 18:27:52 +0300 Subject: [PATCH 2/7] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bef59fe..c5199d8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Этот pfx подсовывается в докер и из него экспортируется приватный ключ. ``` +docker run -it -v `pwd`:/cert gost-openssl_cert + openssl pkcs12 -in p12.pfx -out p12.pem ``` From 32e090004b2ae469bf3a48e813b21f28822cd60a Mon Sep 17 00:00:00 2001 From: Monster Date: Fri, 14 Oct 2022 18:28:28 +0300 Subject: [PATCH 3/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5199d8..e054e4a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Этот pfx подсовывается в докер и из него экспортируется приватный ключ. ``` -docker run -it -v `pwd`:/cert gost-openssl_cert +docker run -it -v `pwd`/cert:/cert gost-openssl_cert openssl pkcs12 -in p12.pfx -out p12.pem ``` From 811c904fefb7283f555ff5d8418275e8ac275a91 Mon Sep 17 00:00:00 2001 From: Monster Date: Tue, 25 Oct 2022 14:41:01 +0300 Subject: [PATCH 4/7] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index e054e4a..15ebdc2 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,12 @@ openssl pkcs12 -in p12.pfx -out p12.pem ### Собранный образ https://hub.docker.com/repository/docker/monster1025/gost_cert + +### Команды для конвертации сертификата в нужные ключи: +https://habr.com/ru/post/550664/ + +``` +openssl pkcs12 -in auth.p12 -out key.pem -engine gost -nodes -clcerts +openssl pkcs12 -in auth.p12 -clcerts -nokeys -out pub.crt +openssl smime -sign -signer pub.crt -inkey key.pem -engine gost -binary -noattr -outform DER -in document.pdf -out document.pdf.sig +``` From 114e2c2c9d171413c3e436d53be53dc74c0f4434 Mon Sep 17 00:00:00 2001 From: Monster Date: Mon, 22 Jan 2024 22:01:36 +0300 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 15ebdc2..e088d3d 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,5 @@ https://habr.com/ru/post/550664/ ``` openssl pkcs12 -in auth.p12 -out key.pem -engine gost -nodes -clcerts openssl pkcs12 -in auth.p12 -clcerts -nokeys -out pub.crt -openssl smime -sign -signer pub.crt -inkey key.pem -engine gost -binary -noattr -outform DER -in document.pdf -out document.pdf.sig +openssl smime -sign -signer pub.crt -inkey key.pem -engine gost -binary -outform DER -in document.pdf -out document.pdf.sig ``` From ed3aa2cccb64f050d5c586dd97f7d6729d154ca5 Mon Sep 17 00:00:00 2001 From: Monster Date: Mon, 22 Jan 2024 22:30:17 +0300 Subject: [PATCH 6/7] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e088d3d..20c9036 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,7 @@ openssl pkcs12 -in auth.p12 -out key.pem -engine gost -nodes -clcerts openssl pkcs12 -in auth.p12 -clcerts -nokeys -out pub.crt openssl smime -sign -signer pub.crt -inkey key.pem -engine gost -binary -outform DER -in document.pdf -out document.pdf.sig ``` +or +``` +openssl cms -sign -engine gost -inkey key.pem -signer pub.crt -in document.xml -binary -outform DER -out document.xml.sgn +``` From b2daec01d2fab3236de1aa1ccda465c6d117d514 Mon Sep 17 00:00:00 2001 From: Monster Date: Tue, 23 Jan 2024 09:40:55 +0300 Subject: [PATCH 7/7] Create docker-publish.yml --- .github/workflows/docker-publish.yml | 98 ++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..4a30a45 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,98 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '23 17 * * *' + push: + branches: [ "master" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "master" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1 + with: + cosign-release: 'v2.1.1' + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}