File tree 9 files changed +143
-3
lines changed
9 files changed +143
-3
lines changed Original file line number Diff line number Diff line change 45
45
push : true
46
46
tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
47
47
labels : ${{ steps.meta.outputs.labels }}
48
+
49
+
Original file line number Diff line number Diff line change
1
+ ---
2
+ name : EE Backend Publish docker image
3
+
4
+ " on " :
5
+ release :
6
+ types :
7
+ - ' released'
8
+
9
+ env :
10
+ REGISTRY : ghcr.io
11
+ IMAGE_NAME : ${{ github.repository }}_backend_ee_fips
12
+
13
+ jobs :
14
+ build-and-push-image :
15
+ if : (startswith(github.event.release.tag_name, 'v'))
16
+
17
+ runs-on : ubuntu-latest
18
+
19
+ permissions :
20
+ contents : read
21
+ packages : write
22
+
23
+ steps :
24
+ - name : Checkout repository
25
+ uses : actions/checkout@v4
26
+
27
+ - name : Log in to the Container registry
28
+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
29
+ with :
30
+ registry : ${{ env.REGISTRY }}
31
+ username : ${{ github.actor }}
32
+ password : ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - name : Extract metadata (tags, labels) for Docker
35
+ id : meta
36
+ uses : docker/metadata-action@v5.5.1
37
+ with :
38
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39
+
40
+ - name : Build and push Docker image
41
+ uses : docker/build-push-action@v5.3.0
42
+ with :
43
+ context : .
44
+ file : " Dockerfile_backend_ee"
45
+ push : true
46
+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
47
+ labels : ${{ steps.meta.outputs.labels }}
48
+ build-args : |
49
+ GODEBUG_VALUE=fips140=only
50
+ GOFIPS140_VALUE=v1.0.0
51
+
Original file line number Diff line number Diff line change
1
+ ---
2
+ name : release ee cli
3
+
4
+ " on " :
5
+ release :
6
+ branches :
7
+ - ' go'
8
+ types :
9
+ - ' released'
10
+
11
+ jobs :
12
+ binary :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Download Go
17
+ uses : actions/setup-go@v5
18
+ with :
19
+ go-version : 1.24.0
20
+ id : go
21
+
22
+ - name : Check out repository
23
+ uses : actions/checkout@v4
24
+
25
+ - name : Publish linux-x64 exec to github
26
+ id : build-and-release-binary
27
+ uses : wangyoucao577/go-release-action@8fa1e8368c8465264d64e0198208e10f71474c87 # v1.50
28
+ with :
29
+ github_token : ${{ secrets.GITHUB_TOKEN }}
30
+ goos : linux
31
+ goarch : amd64
32
+ goversion : 1.24.0
33
+ project_path : ./ee/cli/cmd/digger
34
+ binary_name : digger
35
+ pre_command : export CGO_ENABLED=0
36
+ sha256sum : true
37
+ md5sum : false
38
+ asset_name : " digger-ee-cli-Linux-X64-fips"
39
+ compress_assets : " OFF"
40
+ env :
41
+ GODEBUG : fips140=only
42
+ GOFIPS140 : v1.0.0
43
+
Original file line number Diff line number Diff line change @@ -20,8 +20,16 @@ RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o backend_exe ./ee/back
20
20
21
21
# Multi-stage build will just copy the binary to an alpine image.
22
22
FROM ubuntu:24.04 as runner
23
- ENV ATLAS_VERSION v0.31.0
23
+
24
24
ARG COMMIT_SHA
25
+ ARG GODEBUG_VALUE=off
26
+ ARG GOFIPS140_VALUE=off
27
+
28
+ # Set environment variables using the build arguments
29
+ ENV GODEBUG=$GODEBUG_VALUE
30
+ ENV GOFIPS140=$GOFIPS140_VALUE
31
+ ENV ATLAS_VERSION v0.31.0
32
+
25
33
WORKDIR /app
26
34
27
35
RUN apt-get update && apt-get install -y ca-certificates curl && apt-get install -y git && apt-get clean all
Original file line number Diff line number Diff line change 8
8
description : use ee cli?
9
9
required : false
10
10
default : ' false'
11
+ fips :
12
+ description : build with fips140 standard?
13
+ required : false
14
+ default : ' false'
11
15
setup-aws :
12
16
description : Setup AWS
13
17
required : false
@@ -427,6 +431,10 @@ runs:
427
431
else
428
432
cd $GITHUB_ACTION_PATH/cli
429
433
fi
434
+ if [[ ${{ inputs.fips }} == "true" ]]; then
435
+ export GODEBUG=fips140=only
436
+ export GOFIPS140=v1.0.0
437
+ fi
430
438
go build -o digger ./cmd/digger
431
439
chmod +x digger
432
440
PATH=$PATH:$(pwd)
@@ -467,7 +475,11 @@ runs:
467
475
shell : bash
468
476
run : |
469
477
if [[ ${{ inputs.ee }} == "true" ]]; then
470
- curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }} -o digger
478
+ if [[ ${{ inputs.fips }} == "true" ]]; then
479
+ curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}-fips -o digger
480
+ else
481
+ curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }} -o digger
482
+ fi
471
483
else
472
484
curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-cli-${{ runner.os }}-${{ runner.arch }} -o digger
473
485
fi
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
19
19
)
20
20
21
21
func initLogger () {
22
+
22
23
logLevel := os .Getenv ("DIGGER_LOG_LEVEL" )
23
24
var level slog.Leveler
24
25
if logLevel == "DEBUG" {
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : " FIPS 140 build"
3
+ ---
4
+
5
+ You can use digger binary with FIPS140 standard. FIPS 140 (Federal Information Processing Standard Publication 140) is a U.S. government standard that specifies security requirements for cryptographic modules protecting sensitive information.
6
+
7
+ as of version v0.6.101 digger backend and cli are both compiled seperately with FIPS140 enabled. In order to enable it for github follow these steps:
8
+
9
+ - For the backend you need to ensure you use the right docker image: ` _backend_ee_fips ` during the pull
10
+ - For the cli you need to add the following argument in addition to ` ee: true ` :
11
+
12
+ ```
13
+ - diggerhq/digger@vLatest
14
+ with:
15
+ ee: 'true'
16
+ fips: 'true'
17
+ ```
18
+
19
+ If you are using gitlab or other VCS then just ensure that you are downloading the fips enabled binary which is suffixed with '_ fips'
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "crypto/fips140"
4
5
"embed"
5
6
"fmt"
6
7
"github.com/diggerhq/digger/backend/bootstrap"
@@ -31,6 +32,8 @@ func main() {
31
32
log .Printf ("error checking license %v" , err )
32
33
os .Exit (1 )
33
34
}
35
+
36
+ log .Printf ("fips140 enabled: %v" , fips140 .Enabled ())
34
37
githubProvider := github.DiggerGithubEEClientProvider {}
35
38
diggerController := ce_controllers.DiggerController {
36
39
CiBackendProvider : ci_backends2.EEBackendProvider {},
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "crypto/fips140"
4
5
"encoding/json"
5
6
"fmt"
6
7
"github.com/diggerhq/digger/cli/pkg/digger"
@@ -24,8 +25,8 @@ import (
24
25
var defaultCmd = & cobra.Command {
25
26
Use : "default" ,
26
27
Run : func (cmd * cobra.Command , args []string ) {
27
-
28
28
specStr := os .Getenv ("DIGGER_RUN_SPEC" )
29
+ log .Printf ("Fips140 enabled in build: %v" , fips140 .Enabled ())
29
30
if specStr != "" {
30
31
var spec lib_spec.Spec
31
32
err := json .Unmarshal ([]byte (specStr ), & spec )
You can’t perform that action at this time.
0 commit comments