-
Notifications
You must be signed in to change notification settings - Fork 39
203 lines (185 loc) · 10.2 KB
/
ca_handler_tests_pkcs7_soap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: CA handler tests - PKCS#7-SOAP handler
on:
push:
pull_request:
branches: [ devel ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 2 * * 6'
jobs:
pkcs7_soap_handler_signint_tests:
name: "pkcs7_soap_handler_tests internal signer"
runs-on: ubuntu-latest
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "Prepare SOAP server"
run: |
sudo mkdir -p examples/Docker/data
docker network create acme
sudo mkdir -p examples/Docker/data/xca
sudo chmod -R 777 examples/Docker/data/xca
sudo cp test/ca/acme2certifier-clean.xdb examples/Docker/data/xca/$XCA_DB_NAME
sudo touch examples/Docker/data/soap_srv.cfg
sudo chmod 777 examples/Docker/data/soap_srv.cfg
sudo echo "[CAhandler]" >> examples/Docker/data/soap_srv.cfg
sudo echo "xdb_file: /etc/soap-srv/xca/$XCA_DB_NAME" >> examples/Docker/data/soap_srv.cfg
sudo echo "issuing_ca_name: $XCA_ISSUING_CA" >> examples/Docker/data/soap_srv.cfg
sudo echo "issuing_ca_key: $XCA_ISSUING_CA" >> examples/Docker/data/soap_srv.cfg
sudo echo "passphrase: $XCA_PASSPHRASE" >> examples/Docker/data/soap_srv.cfg
sudo echo "ca_cert_chain_list: [\"root-ca\"]" >> examples/Docker/data/soap_srv.cfg
sudo echo "template_name: $XCA_TEMPLATE" >> examples/Docker/data/soap_srv.cfg
env:
XCA_PASSPHRASE: ${{ secrets.XCA_PASSPHRASE }}
XCA_ISSUING_CA: ${{ secrets.XCA_ISSUING_CA }}
XCA_TEMPLATE: ${{ secrets.XCA_TEMPLATE }}
XCA_DB_NAME: ${{ secrets.XCA_DB_NAME }}
- name: "Build and start SOAP server"
working-directory: examples/Docker/
run: |
sudo apt-get install -y docker-compose
sudo mv ../../.dockerignore ../../.dockerignore.acme
docker-compose -f soap_srv.yml up -d
docker-compose -f soap_srv.yml logs
- name: "Build docker-compose (apache2_wsgi)"
working-directory: examples/Docker/
run: |
sudo mv ../../.dockerignore.acme ../../.dockerignore
docker-compose up -d
- name: "Setup a2c with pkcs7_ca_handler"
run: |
sudo mkdir -p examples/Docker/data/acme_ca/certs
sudo cp test/ca/sub-ca-key.pem test/ca/sub-ca-crl.pem test/ca/sub-ca-cert.pem test/ca/root-ca-cert.pem examples/Docker/data/acme_ca/
sudo cp .github/acme2certifier.pem examples/Docker/data/acme2certifier.pem
sudo cp .github/acme2certifier_cert.pem examples/Docker/data/acme2certifier_cert.pem
sudo cp .github/acme2certifier_key.pem examples/Docker/data/acme2certifier_key.pem
sudo touch examples/Docker/data/acme_srv.cfg
sudo chmod 777 examples/Docker/data/acme_srv.cfg
sudo cp test/ca/sub-ca-key.pem examples/Docker/data/key.pem
sudo cp test/ca/sub-ca-cert.pem examples/Docker/data/cert.pem
sudo cp test/ca/certs.pem examples/Docker/data/ca_bundle.pem
sudo head -n -8 .github/openssl_ca_handler.py_acme_srv_default_handler.cfg > examples/Docker/data/acme_srv.cfg
sudo echo "handler_file: /var/www/acme2certifier/examples/ca_handler/pkcs7_soap_ca_handler.py" >> examples/Docker/data/acme_srv.cfg
sudo echo "soap_srv: http://soap-srv.acme:8888" >> examples/Docker/data/acme_srv.cfg
sudo echo "signing_cert: /var/www/acme2certifier/volume/cert.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "signing_key: /var/www/acme2certifier/volume/key.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "password: Test1234" >> examples/Docker/data/acme_srv.cfg
sudo echo "ca_bundle: /var/www/acme2certifier/volume/ca_bundle.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "profilename: foo" >> examples/Docker/data/acme_srv.cfg
sudo echo "email: [email protected]" >> examples/Docker/data/acme_srv.cfg
cat examples/Docker/data/acme_srv.cfg
cd examples/Docker/
docker-compose restart
- name: "Test enrollment"
uses: ./.github/actions/acme_clients
with:
REVOCATION: "false"
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
sudo cp -rp examples/Docker/data/ ${{ github.workspace }}/artifact/data/
sudo cp -rp acme-sh/ ${{ github.workspace }}/artifact/acme-sh/
sudo cp -rp certbot/ ${{ github.workspace }}/artifact/certbot/
sudo cp -rp lego/ ${{ github.workspace }}/artifact/lego/
cd examples/Docker
docker-compose -f soap_srv.yml logs > ${{ github.workspace }}/artifact/soap-srv.log
docker-compose logs > ${{ github.workspace }}/artifact/a2c.log
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz a2c.log data soap-srv.log acme-sh certbot lego
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: pkcs7soap-int.tar.gz
path: ${{ github.workspace }}/artifact/upload/
pkcs7_soap_handler_signext_tests:
name: "pkcs7_soap_handler_tests external signer"
runs-on: ubuntu-latest
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "Prepare SOAP server"
run: |
sudo mkdir -p examples/Docker/data
docker network create acme
sudo mkdir -p examples/Docker/data/xca
sudo chmod -R 777 examples/Docker/data/xca
sudo cp test/ca/acme2certifier-clean.xdb examples/Docker/data/xca/$XCA_DB_NAME
sudo touch examples/Docker/data/soap_srv.cfg
sudo chmod 777 examples/Docker/data/soap_srv.cfg
sudo echo "[CAhandler]" >> examples/Docker/data/soap_srv.cfg
sudo echo "xdb_file: /etc/soap-srv/xca/$XCA_DB_NAME" >> examples/Docker/data/soap_srv.cfg
sudo echo "issuing_ca_name: $XCA_ISSUING_CA" >> examples/Docker/data/soap_srv.cfg
sudo echo "issuing_ca_key: $XCA_ISSUING_CA" >> examples/Docker/data/soap_srv.cfg
sudo echo "passphrase: $XCA_PASSPHRASE" >> examples/Docker/data/soap_srv.cfg
sudo echo "ca_cert_chain_list: [\"root-ca\"]" >> examples/Docker/data/soap_srv.cfg
sudo echo "template_name: $XCA_TEMPLATE" >> examples/Docker/data/soap_srv.cfg
env:
XCA_PASSPHRASE: ${{ secrets.XCA_PASSPHRASE }}
XCA_ISSUING_CA: ${{ secrets.XCA_ISSUING_CA }}
XCA_TEMPLATE: ${{ secrets.XCA_TEMPLATE }}
XCA_DB_NAME: ${{ secrets.XCA_DB_NAME }}
- name: "Build and start SOAP server"
working-directory: examples/Docker/
run: |
sudo apt-get install -y docker-compose
sudo mv ../../.dockerignore ../../.dockerignore.acme
docker-compose -f soap_srv.yml up -d
docker-compose -f soap_srv.yml logs
- name: "Build docker-compose (apache2_wsgi)"
working-directory: examples/Docker/
run: |
sudo mv ../../.dockerignore.acme ../../.dockerignore
docker-compose up -d
docker-compose logs
- name: "Test http://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl -f http://acme-srv/directory
- name: "Setup a2c with pkcs7_ca_handler"
run: |
sudo mkdir -p examples/Docker/data/acme_ca/certs
sudo cp test/ca/sub-ca-key.pem test/ca/sub-ca-crl.pem test/ca/sub-ca-cert.pem test/ca/root-ca-cert.pem examples/Docker/data/acme_ca/
sudo cp .github/acme2certifier.pem examples/Docker/data/acme2certifier.pem
sudo cp .github/acme2certifier_cert.pem examples/Docker/data/acme2certifier_cert.pem
sudo cp .github/acme2certifier_key.pem examples/Docker/data/acme2certifier_key.pem
sudo touch examples/Docker/data/acme_srv.cfg
sudo chmod 777 examples/Docker/data/acme_srv.cfg
sudo cp examples/soap/mock_signer.py examples/Docker/data/
sudo chmod 755 examples/Docker/data/mock_signer.py
sudo cp test/ca/sub-ca-key.pem examples/Docker/data/key.pem
sudo cp test/ca/sub-ca-cert.pem examples/Docker/data/cert.pem
sudo cp test/ca/certs.pem examples/Docker/data/ca_bundle.pem
sudo head -n -8 .github/openssl_ca_handler.py_acme_srv_default_handler.cfg > examples/Docker/data/acme_srv.cfg
sudo echo "handler_file: /var/www/acme2certifier/examples/ca_handler/pkcs7_soap_ca_handler.py" >> examples/Docker/data/acme_srv.cfg
sudo echo "soap_srv: http://soap-srv.acme:8888" >> examples/Docker/data/acme_srv.cfg
sudo echo "signing_script: /var/www/acme2certifier/volume/mock_signer.py" >> examples/Docker/data/acme_srv.cfg
sudo echo "signing_alias: /var/www/acme2certifier/volume/cert.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "signing_config_variant: /var/www/acme2certifier/volume/key.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "signing_csr_path: /var/www/acme2certifier/volume" >> examples/Docker/data/acme_srv.cfg
sudo echo "ca_bundle: /var/www/acme2certifier/volume/ca_bundle.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "profilename: foo" >> examples/Docker/data/acme_srv.cfg
sudo echo "email: [email protected]" >> examples/Docker/data/acme_srv.cfg
cat examples/Docker/data/acme_srv.cfg
cd examples/Docker/
docker-compose restart
- name: "Test enrollment"
uses: ./.github/actions/acme_clients
with:
REVOCATION: "false"
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
sudo cp -rp examples/Docker/data/ ${{ github.workspace }}/artifact/data/
sudo cp -rp acme-sh/ ${{ github.workspace }}/artifact/acme-sh/
sudo cp -rp certbot/ ${{ github.workspace }}/artifact/certbot/
sudo cp -rp lego/ ${{ github.workspace }}/artifact/lego/
cd examples/Docker
docker-compose -f soap_srv.yml logs > ${{ github.workspace }}/artifact/soap-srv.log
docker-compose logs > ${{ github.workspace }}/artifact/a2c.log
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz a2c.log data soap-srv.log acme-sh certbot lego
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: pkcs7soap-ext.tar.gz
path: ${{ github.workspace }}/artifact/upload/