10
10
urls :
11
11
- https://int.api.service.nhs.uk/comms # the actual url used for the scan is defined in the openapi job below
12
12
authentication :
13
- method : ' script'
13
+ method : script
14
14
parameters :
15
15
url : https://int.api.service.nhs.uk/oauth2/token
16
- script : ' scripts/authentication/get_bearer_token.js'
17
- scriptEngine : ' Graal.js'
16
+ script : scripts/authentication/get_bearer_token.js
17
+ scriptEngine : Graal.js
18
18
verification :
19
- method : ' response'
20
- loggedOutRegex : ' 401 Unauthorized'
19
+ method : response
20
+ loggedOutRegex : 401 Unauthorized
21
21
users :
22
22
- name : Integration
23
23
credentials :
24
24
kid : local
25
- api_key : " ${INTEGRATION_API_KEY}"
26
- private_key : " ${INTEGRATION_PRIVATE_KEY_CONTENTS}"
27
- - name : ProdUnauthenticated
28
- urls :
29
- - https://api.service.nhs.uk/comms # the actual url used for the scan is defined in the openapi job below
30
- - name : ProdAuthenticated
31
- urls :
32
- - https://api.service.nhs.uk/comms # the actual url used for the scan is defined in the openapi job below
33
- authentication :
34
- method : ' script'
35
- parameters :
36
- url : https://api.service.nhs.uk/oauth2/token
37
- script : ' scripts/authentication/get_bearer_token.js'
38
- scriptEngine : ' Graal.js'
39
- verification :
40
- method : ' response'
41
- loggedOutRegex : ' 401 Unauthorized'
42
- users :
43
- - name : Prod
44
- credentials :
45
- kid : prod-1
46
- api_key : " ${PRODUCTION_API_KEY}"
47
- private_key : " ${PRODUCTION_PRIVATE_KEY_CONTENTS}"
25
+ api_key : ${INTEGRATION_API_KEY}
26
+ private_key : ${INTEGRATION_PRIVATE_KEY_CONTENTS}
48
27
parameters :
49
28
failOnError : true
50
29
failOnWarning : true
@@ -54,46 +33,83 @@ jobs:
54
33
# load our authentication and httpsender script
55
34
- type : script
56
35
parameters :
57
- action : ' add'
58
- type : ' httpsender'
59
- engine : ' Graal.js'
60
- name : ' add_bearer_token'
61
- file : ' scripts/httpsender/add_bearer_token.js'
36
+ action : add
37
+ type : httpsender
38
+ engine : Graal.js
39
+ name : add_bearer_token
40
+ file : scripts/httpsender/add_bearer_token.js
62
41
- type : script
63
42
parameters :
64
- action : ' add'
65
- type : ' authentication'
66
- engine : ' Graal.js'
67
- name : ' get_bearer_token'
68
- file : ' scripts/authentication/get_bearer_token.js'
43
+ action : add
44
+ type : authentication
45
+ engine : Graal.js
46
+ name : get_bearer_token
47
+ file : scripts/authentication/get_bearer_token.js
48
+
49
+ # configure the passive scan
50
+ - type : passiveScan-config
51
+ parameters :
52
+ maxAlertsPerRule : 10
53
+ scanOnlyInScope : true
54
+ rules :
55
+ - id : 10049
56
+ name : Non-Storable Content
57
+ threshold : Off
58
+ # We do not want responses cached.
59
+ # See https://github.com/NHSDigital/communications-manager-api/pull/548 for more information.
60
+
61
+ - id : 90005
62
+ name : Sec-Fetch-Site Header is Missing
63
+ threshold : Off
64
+ # Sec-Fetch-* headers are only for requests.
65
+ # See https://github.com/NHSDigital/communications-manager-api/pull/548 for more information.
66
+
67
+ - id : 10094
68
+ name : Base64 Disclosure
69
+ threshold : Off
70
+ # The KSUIDs are sometimes detected as base64 strings.
71
+ # See https://github.com/NHSDigital/communications-manager-api/pull/548 for more information.
72
+
73
+ - id : 110009
74
+ name : Full Path Disclosure
75
+ threshold : Off
76
+ # Error responses include a link to the NHS developer catalogue.
77
+ # ZAP is picking up 'developer' in the link.
78
+ # See https://github.com/NHSDigital/communications-manager-api/pull/548 for more information.
79
+
80
+ - id : 90004
81
+ name : Insufficient Site Isolation Against Spectre Vulnerability
82
+ threshold : Off
83
+ # CORS headers (including Cross-Origin-Resource-Policy) are only added to the response when the request has an origin specified.
84
+ # See https://github.com/NHSDigital/communications-manager-api/pull/548 for more information.
85
+
86
+ - id : 10062
87
+ name : PII Disclosure
88
+ threshold : Off
89
+ # Error responses include the apigee message id in the body.
90
+ # Sometimes it can be detected as a Maestro credit card number.
91
+ # This rule only checks for credit card details, no other PII.
92
+ # See https://github.com/NHSDigital/communications-manager-api/pull/548 for more information.
69
93
70
94
# load the zap specific openapi specification
71
95
- type : openapi
72
96
parameters :
73
- apiFile : ' /zap/wrk/build/communications-manager-zap.json'
97
+ apiFile : /zap/wrk/build/communications-manager-zap.json
74
98
targetUrl : https://sandbox.api.service.nhs.uk/comms
75
99
context : Sandbox
76
100
- type : openapi
77
101
parameters :
78
- apiFile : ' /zap/wrk/build/communications-manager-zap.json'
102
+ apiFile : /zap/wrk/build/communications-manager-zap.json
79
103
targetUrl : https://int.api.service.nhs.uk/comms
80
104
context : IntegrationUnauthenticated
81
105
- type : openapi
82
106
parameters :
83
- apiFile : ' /zap/wrk/build/communications-manager-zap.json'
107
+ apiFile : /zap/wrk/build/communications-manager-zap.json
84
108
targetUrl : https://int.api.service.nhs.uk/comms
85
109
context : IntegrationAuthenticated
86
- - type : openapi
87
- parameters :
88
- apiFile : ' /zap/wrk/build/communications-manager-zap.json'
89
- targetUrl : https://api.service.nhs.uk/comms
90
- context : ProdUnauthenticated
91
- - type : openapi
92
- parameters :
93
- apiFile : ' /zap/wrk/build/communications-manager-zap.json'
94
- targetUrl : https://api.service.nhs.uk/comms
95
- context : ProdAuthenticated
96
110
111
+ # let the passive scan do it's stuff
112
+ - type : passiveScan-wait
97
113
98
114
# run an active scan on sandbox
99
115
- type : activeScan
@@ -123,31 +139,12 @@ jobs:
123
139
delayInMs : 500
124
140
threadPerHost : 1
125
141
126
- # run an active scan on prod, using unauthenticated calls
127
- - type : activeScan
128
- parameters :
129
- policy : API
130
- context : ProdUnauthenticated
131
- scanHeadersAllRequests : true
132
- delayInMs : 500
133
- threadPerHost : 1
134
-
135
- # run an active scan on prod, using authenticated calls
136
- - type : activeScan
137
- parameters :
138
- policy : API
139
- context : ProdAuthenticated
140
- user : Prod
141
- scanHeadersAllRequests : true
142
- delayInMs : 500
143
- threadPerHost : 1
144
-
145
142
# generate our custom JSON report
146
143
- type : report
147
144
parameters :
148
- template : ' comms-manager-json'
149
- reportDir : ' /zap/tmp'
150
- reportFile : ' zap-report.json'
145
+ template : comms-manager-json
146
+ reportDir : /zap/tmp
147
+ reportFile : zap-report.json
151
148
risks :
152
149
- high
153
150
- medium
@@ -157,4 +154,4 @@ jobs:
157
154
- high
158
155
- medium
159
156
- low
160
- - falsepositive
157
+ - falsepositive
0 commit comments