1
1
name : Publish
2
2
3
3
on :
4
- push :
4
+ push :
5
5
tags :
6
- - " v*.*.*"
7
-
6
+ - v*.*.*
7
+ env :
8
+ AZUREHOUND_VERSION : ${{ github.ref_name }}
8
9
jobs :
9
10
build :
10
11
runs-on : ubuntu-latest
11
- defaults :
12
- run :
13
- shell : bash
14
12
strategy :
15
13
matrix :
16
14
os :
21
19
- amd64
22
20
- arm64
23
21
steps :
24
- - uses : actions/checkout@v3
22
+ - uses : actions/checkout@v4
25
23
26
24
- name : Setup Go
27
25
uses : actions/setup-go@v3
@@ -31,11 +29,18 @@ jobs:
31
29
cache : true
32
30
33
31
- name : Build
34
- run : ' go build -ldflags="-s -w -X github.com/bloodhoundad/azurehound/v2/constants.Version=${{ github.ref_name }}"'
32
+ run : ' go build -ldflags="-s -w -X github.com/bloodhoundad/azurehound/v2/constants.Version=${{ env.AZUREHOUND_VERSION }}"'
35
33
env :
36
34
GOOS : ${{ matrix.os }}
37
35
GOARCH : ${{ matrix.arch }}
38
36
37
+ - name : Upload as Artifact
38
+ if : matrix.os == 'windows'
39
+ uses : actions/upload-artifact@v4
40
+ with :
41
+ name : azurehound-bin-${{ matrix.os }}-${{ matrix.arch }}
42
+ path : azurehound*
43
+
39
44
- name : Zip
40
45
run : 7z a -tzip -mx9 azurehound-${{ matrix.os }}-${{ matrix.arch }}.zip azurehound*
41
46
@@ -49,15 +54,69 @@ jobs:
49
54
azurehound-${{ matrix.os }}-${{ matrix.arch }}.zip
50
55
azurehound-${{ matrix.os }}-${{ matrix.arch }}.zip.sha256
51
56
57
+ sign :
58
+ runs-on : ubuntu-latest
59
+ needs : build
60
+ steps :
61
+ - uses : aws-actions/configure-aws-credentials@v4
62
+ with :
63
+ aws-access-key-id : ${{ secrets.BHE_AWS_ACCESS_KEY_ID }}
64
+ aws-secret-access-key : ${{ secrets.BHE_AWS_SECRET_ACCESS_KEY }}
65
+ aws-region : us-east-1
66
+
67
+ - uses : actions/download-artifact@v4
68
+ with :
69
+ pattern : azurehound-bin-*
70
+ path : unsigned/
71
+
72
+ - name : Install osslsigncode
73
+ run : |
74
+ sudo apt-get update
75
+ sudo apt-get install -y osslsigncode
76
+
77
+ - name : Sign Artifacts
78
+ env :
79
+ CODE_SIGN_CHAIN : ${{ secrets.CODE_SIGN_CHAIN }}
80
+ CODE_SIGN_KEY : ${{ secrets.CODE_SIGN_KEY }}
81
+ run : |
82
+ set -ex
83
+
84
+ # osslsigncode demands certs and key as file
85
+ CERT_FILE=$(mktemp)
86
+ KEY_FILE=$(mktemp)
87
+ printenv CODE_SIGN_CHAIN > $CERT_FILE
88
+ printenv CODE_SIGN_KEY > $KEY_FILE
89
+
90
+ trap 'rm $CERT_FILE $KEY_FILE' EXIT
91
+
92
+ mkdir signed
93
+ for artifact in unsigned/azurehound-bin-*/azurehound*; do
94
+ tgt=$(echo "$artifact" | sed -E 's%.*-([^-]*)/azurehound(.*)%azurehound-\1\2%')
95
+ osslsigncode sign \
96
+ -certs $CERT_FILE \
97
+ -key $KEY_FILE \
98
+ -n AzureHound \
99
+ -i https://www.specterops.io/ \
100
+ -in "$artifact" \
101
+ -out "signed/${tgt}"
102
+ done
103
+
104
+ - name : Verify Signed Artifacts
105
+ run : |
106
+ for artifact in signed/azurehound*; do
107
+ osslsigncode verify "$artifact"
108
+ done
109
+
110
+ - name : Upload Artifacts to S3
111
+ run : |
112
+ aws s3 cp --recursive signed/ s3://${{ secrets.BHE_AWS_BUCKET }}/azurehound-signed/${AZUREHOUND_VERSION}/
113
+
52
114
containerize :
53
115
runs-on : ubuntu-latest
54
116
permissions :
55
117
packages : write
56
- defaults :
57
- run :
58
- shell : bash
59
118
steps :
60
- - uses : actions/checkout@v3
119
+ - uses : actions/checkout@v4
61
120
62
121
- name : Log in to the Container registry
63
122
uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
0 commit comments