File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22# Check if certificate expires within 30 days
3- set -eu -o pipefail
3+ set -eux -o pipefail
44
55currentexpirydate=" ${1} "
66
Original file line number Diff line number Diff line change 11{{- range $username := splitList " ," .certificates }}
22---
3- # yamllint disable rule:line-length
43name: " Check VPN certificate expiration for {{ $username }}"
54
65scms:
@@ -19,9 +18,7 @@ sources:
1918 name: " Extract expiration date from {{ $username }}'s certificate"
2019 kind: shell
2120 spec:
22- command: bash . /updatecli/scripts/cert-expiry-extract.sh cert/pki/issued/{{ $username }}.crt
23- environments:
24- - name: PATH
21+ command: bash . /updatecli/scripts/cert-expiry-extract.sh cert/pki/issued/{{ $username }}.crt x509
2522
2623conditions:
2724 checkIfExpiringSoon:
@@ -30,15 +27,14 @@ conditions:
3027 sourceid: certExpiryDate
3128 spec:
3229 command: bash . /updatecli/scripts/cert-expiry-check.sh
33- environments:
34- - name: PATH
3530
3631targets:
3732 markCertExpiring:
3833 name: " Mark {{ $username }}'s certificate as expiring"
3934 kind: file
35+ disablesourceinput: true
4036 spec:
41- file: cert/pki/issued/{{ $username }}.crt.expiring
37+ file: cert/pki/issued/{{ $username }}.crt
4238 content: |
4339 Certificate for {{ $username }} expires on {{ source " certExpiryDate" }}.
4440 Please renew your VPN certificate as soon as possible.
@@ -63,7 +59,6 @@ actions:
6359 **Note:** This is an automated notification PR.
6460 It is not meant to be merged and can be closed once acknowledged.
6561 labels:
66- - vpn
6762 - certificate-expiration
6863 - action-required
6964{{- end }}
You can’t perform that action at this time.
0 commit comments