-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtls-result.js
More file actions
316 lines (306 loc) · 10.8 KB
/
tls-result.js
File metadata and controls
316 lines (306 loc) · 10.8 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
import { GraphQLBoolean, GraphQLList, GraphQLObjectType, GraphQLString } from 'graphql'
import { guidanceTagType } from '../../guidance-tag'
export const tlsResultType = new GraphQLObjectType({
name: 'TLSResult',
fields: () => ({
ipAddress: {
type: GraphQLString,
description: `The IP address of the domain scanned.`,
resolve: async ({ ipAddress }) => ipAddress,
},
serverLocation: {
type: serverLocationType,
description: `Information regarding the server which was scanned.`,
resolve: async ({ serverLocation }) => serverLocation,
},
certificateChainInfo: {
type: certificateChainInfoType,
description: `Information for the TLS certificate retrieved from the scanned server.`,
resolve: async ({ certificateChainInfo }) => certificateChainInfo,
},
supportsEcdhKeyExchange: {
type: GraphQLBoolean,
description: `Whether or not the scanned server supports ECDH key exchange.`,
resolve: async ({ supportsEcdhKeyExchange }) => supportsEcdhKeyExchange,
},
heartbleedVulnerable: {
type: GraphQLBoolean,
description: `Whether or not the scanned server is vulnerable to heartbleed.`,
resolve: async ({ heartbleedVulnerable }) => heartbleedVulnerable,
},
robotVulnerable: {
type: GraphQLString,
description: `Whether or not the scanned server is vulnerable to heartbleed.`,
resolve: async ({ robotVulnerable }) => robotVulnerable,
},
ccsInjectionVulnerable: {
type: GraphQLBoolean,
description: `Whether or not the scanned server is vulnerable to CCS injection.`,
resolve: async ({ ccsInjectionVulnerable }) => ccsInjectionVulnerable,
},
acceptedCipherSuites: {
type: acceptedCipherSuitesType,
description: `An object containing the various TLS protocols and which suites are enabled for each protocol.`,
resolve: async ({ acceptedCipherSuites }) => acceptedCipherSuites,
},
acceptedEllipticCurves: {
type: new GraphQLList(ellipticCurveType),
description: `List of the scanned servers accepted elliptic curves and their strength.`,
resolve: async ({ acceptedEllipticCurves }) => acceptedEllipticCurves,
},
positiveTags: {
type: new GraphQLList(guidanceTagType),
description: `List of positive tags for the scanned server from this scan.`,
resolve: async ({ positiveTags }, _, { dataSources: { guidanceTag } }) => {
return await guidanceTag.byTagId({ tags: positiveTags })
},
},
neutralTags: {
type: new GraphQLList(guidanceTagType),
description: `List of neutral tags for the scanned server from this scan.`,
resolve: async ({ neutralTags }, _, { dataSources: { guidanceTag } }) => {
return await guidanceTag.byTagId({ tags: neutralTags })
},
},
negativeTags: {
type: new GraphQLList(guidanceTagType),
description: `List of negative tags for the scanned server from this scan.`,
resolve: async ({ negativeTags }, _, { dataSources: { guidanceTag } }) => {
return await guidanceTag.byTagId({ tags: negativeTags })
},
},
certificateStatus: {
type: GraphQLString,
description: `The compliance status of the certificate bundle for the scanned server from this scan.`,
resolve: async ({ certificateStatus }) => certificateStatus,
},
sslStatus: {
type: GraphQLString,
description: `The compliance status for TLS for the scanned server from this scan.`,
resolve: async ({ sslStatus }) => sslStatus,
},
protocolStatus: {
type: GraphQLString,
description: `The compliance status for TLS protocol for the scanned server from this scan.`,
resolve: async ({ protocolStatus }) => protocolStatus,
},
cipherStatus: {
type: GraphQLString,
description: `The compliance status for cipher suites for the scanned server from this scan.`,
resolve: async ({ cipherStatus }) => cipherStatus,
},
curveStatus: {
type: GraphQLString,
description: `The compliance status for ECDH curves for the scanned server from this scan.`,
resolve: async ({ curveStatus }) => curveStatus,
},
}),
description: `Results of TLS scans on the given domain.`,
})
export const serverLocationType = new GraphQLObjectType({
name: 'ServerLocation',
fields: () => ({
hostname: {
type: GraphQLString,
description: `Hostname which was scanned.`,
},
ipAddress: {
type: GraphQLString,
description: `IP address used for scan.`,
},
}),
})
export const trustStoreType = new GraphQLObjectType({
name: `TrustStore`,
description: `Trust store used to validate TLS certificate.`,
fields: () => ({
name: {
type: GraphQLString,
description: `Name of trust store used to validate certificate.`,
},
version: {
type: GraphQLString,
description: `Version of trust store used to validate certificate.`,
},
}),
})
export const pathValidationResultsType = new GraphQLObjectType({
name: `PathValidationResults`,
description: `Validation results from each trust store.`,
fields: () => ({
opensslErrorString: {
type: GraphQLString,
description: `Error string which occurred when attempting to validate certificate if error exists, else null.`,
},
wasValidationSuccessful: {
type: GraphQLBoolean,
description: `Whether or not the certificate was successfully validated.`,
},
trustStore: {
type: trustStoreType,
description: `Trust store used to validate TLS certificate.`,
},
}),
})
export const certificateType = new GraphQLObjectType({
name: `Certificate`,
description: `Certificate from the scanned server.`,
fields: () => ({
notValidBefore: {
type: GraphQLString,
description: `The date which the certificate becomes initially becomes valid.`,
},
notValidAfter: {
type: GraphQLString,
description: `The date which the certificate becomes invalid.`,
},
issuer: {
type: GraphQLString,
description: `The entity which signed the certificate.`,
},
subject: {
type: GraphQLString,
description: `The entity for which the certificate was created for.`,
},
expiredCert: {
type: GraphQLBoolean,
description: `Whether or not the certificate is expired.`,
},
selfSignedCert: {
type: GraphQLBoolean,
description: `Whether or not the certificate is self-signed.`,
},
certRevoked: {
type: GraphQLBoolean,
description: `Whether or not the certificate has been revoked.`,
},
certRevokedStatus: {
type: GraphQLString,
description: `The status of the certificate revocation check.`,
},
commonNames: {
type: new GraphQLList(GraphQLString),
description: `The list of common names for the given certificate.`,
},
serialNumber: {
type: GraphQLString,
description: `The serial number for the given certificate.`,
},
signatureHashAlgorithm: {
type: GraphQLString,
description: `The hashing algorithm used to validate this certificate.`,
},
sanList: {
type: new GraphQLList(GraphQLString),
description: `The list of all alternative (domain)names which can use this certificate.`,
},
}),
})
export const certificateChainInfoType = new GraphQLObjectType({
name: `CertificateChainInfo`,
description: ``,
fields: () => ({
pathValidationResults: {
type: new GraphQLList(pathValidationResultsType),
description: `Validation results from each trust store.`,
},
badHostname: {
type: GraphQLBoolean,
description: `True if domain is not listed on the given TLS certificate.`,
},
mustHaveStaple: {
type: GraphQLBoolean,
description: `Whether or not the TLS certificate includes the OCSP Must-Staple extension.`,
},
leafCertificateIsEv: {
type: GraphQLBoolean,
description: `Whether or not the leaf (server) certificate is an Extended Validation (EV) certificate.`,
},
receivedChainContainsAnchorCertificate: {
type: GraphQLBoolean,
description: `Whether or not the certificate bundle includes the anchor (root) certificate.`,
},
receivedChainHasValidOrder: {
type: GraphQLBoolean,
description: `Whether or not the certificates in the certificate bundles are in the correct order.`,
},
verifiedChainHasSha1Signature: {
type: GraphQLBoolean,
description: `Whether or not any certificates in the certificate bundle were signed using the SHA1 algorithm.`,
},
verifiedChainHasLegacySymantecAnchor: {
type: GraphQLBoolean,
description: `Whether or not the certificate chain includes a distrusted Symantec certificate.`,
},
certificateChain: {
type: new GraphQLList(certificateType),
description: `The certificate chain which was used to create the TLS connection.`,
},
passedValidation: {
type: GraphQLBoolean,
description: `Whether or not the certificate chain passed validation.`,
},
hasEntrustCertificate: {
type: GraphQLBoolean,
description: `Whether or not the certificate chain contains an Entrust certificate.`,
},
}),
})
export const acceptedCipherSuitesType = new GraphQLObjectType({
name: `AcceptedCipherSuites`,
description: `List of accepted cipher suites separated by TLS version.`,
fields: () => ({
ssl2_0CipherSuites: {
type: new GraphQLList(cipherSuiteType),
description: `Accepted cipher suites for SSL2.`,
},
ssl3_0CipherSuites: {
type: new GraphQLList(cipherSuiteType),
description: `Accepted cipher suites for SSL3.`,
},
tls1_0CipherSuites: {
type: new GraphQLList(cipherSuiteType),
description: `Accepted cipher suites for TLS1.0.`,
},
tls1_1CipherSuites: {
type: new GraphQLList(cipherSuiteType),
description: `Accepted cipher suites for TLS1.1.`,
},
tls1_2CipherSuites: {
type: new GraphQLList(cipherSuiteType),
description: `Accepted cipher suites for TLS1.2.`,
},
tls1_3CipherSuites: {
type: new GraphQLList(cipherSuiteType),
description: `Accepted cipher suites for TLS1.3.`,
},
}),
})
export const cipherSuiteType = new GraphQLObjectType({
name: `CipherSuite`,
description: `Cipher suite information.`,
fields: () => ({
name: {
type: GraphQLString,
description: `The name of the cipher suite`,
},
strength: {
type: GraphQLString,
description: `The strength of the cipher suite.`,
},
}),
})
export const ellipticCurveType = new GraphQLObjectType({
name: `EllipticCurve`,
description: `Elliptic curve information.`,
fields: () => ({
name: {
type: GraphQLString,
description: `The name of the elliptic curve.`,
},
strength: {
type: GraphQLString,
description: `The strength of the elliptic curve.`,
},
}),
})