Skip to content

Commit 7b67f14

Browse files
committed
Implement Tls Tester
1 parent 97f8206 commit 7b67f14

33 files changed

+622
-486
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = {
1818
'import/no-unresolved': ['error', { commonjs: true }],
1919
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
2020
'object-curly-newline': ['error', { multiline: true }],
21-
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 0, maxEOF: 1 }]
21+
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 0, maxEOF: 1 }],
22+
'newline-per-chained-call': 'off'
2223
},
2324
env: { node: true },
2425
parserOptions: { ecmaVersion: 2021 },

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<br/>
77
<br/>
88
<h2>purpleteam application scanner</h2><br/>
9-
Application scanning component of <a href="https://purpleteam-labs.com/" title="purpleteam">purpleteam</a> - Currently in alpha
9+
Application scanning component of <a href="https://purpleteam-labs.com/" title="purpleteam"><em>PurpleTeam</em></a> - Currently in alpha
1010
<br/><br/>
1111

1212
<a href="https://www.gnu.org/licenses/agpl-3.0" title="license">
@@ -26,7 +26,9 @@
2626

2727
If you are setting up the app-scanner, you will be targeting the `local` environment.
2828

29-
Clone this repository.
29+
Clone or fork this repository.
30+
31+
If you are developing this project:
3032

3133
`cd` to the repository root directory and run:
3234
```shell
@@ -42,5 +44,4 @@ Take the Zap API Key that you set-up in the [purpleteam-s2-containers](https://g
4244

4345
<br>
4446

45-
Once you have cloned, installed and configured the app-scanner, head back to the [local setup](https://doc.purpleteam-labs.com/local/local-setup.html) documentation to continue setting up the other purpleteam components.
46-
47+
Once you have worked through the above steps, head back to the [local setup](https://purpleteam-labs.com/doc/local/set-up/) documentation to continue setting up the other _PurpleTeam_ components.

config/config.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"cucumber": {
1818
"tagExpression": "@app_scan",
19-
"timeOut": 1800000
19+
"timeout": 1800000
2020
},
2121
"runType": "parallel",
2222
"results": {

config/config.js

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
// Copyright (C) 2017-2021 BinaryMist Limited. All rights reserved.
22

3-
// This file is part of purpleteam.
3+
// This file is part of PurpleTeam.
44

5-
// purpleteam is free software: you can redistribute it and/or modify
5+
// PurpleTeam is free software: you can redistribute it and/or modify
66
// it under the terms of the GNU Affero General Public License as published by
77
// the Free Software Foundation version 3.
88

9-
// purpleteam is distributed in the hope that it will be useful,
9+
// PurpleTeam is distributed in the hope that it will be useful,
1010
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
// GNU Affero General Public License for more details.
1313

1414
// You should have received a copy of the GNU Affero General Public License
15-
// along with purpleteam. If not, see <https://www.gnu.org/licenses/>.
15+
// along with this PurpleTeam project. If not, see <https://www.gnu.org/licenses/>.
1616

1717
const convict = require('convict');
18-
const convictFormatWithMoment = require('convict-format-with-moment');
19-
const convictFormatWithValidator = require('convict-format-with-validator');
18+
const { duration } = require('convict-format-with-moment');
19+
const { url } = require('convict-format-with-validator');
2020
const path = require('path');
2121

22-
convict.addFormat(convictFormatWithMoment.duration);
23-
convict.addFormat(convictFormatWithValidator.url);
22+
convict.addFormat(duration);
23+
convict.addFormat(url);
2424

2525
const internals = { aws_region: process.env.AWS_REGION || 'dummy-region' };
2626

@@ -38,6 +38,18 @@ const schema = {
3838
default: 'notice'
3939
}
4040
},
41+
processMonitoring: {
42+
on: {
43+
doc: 'Whether or not to capture and log process events.',
44+
format: 'Boolean',
45+
default: false
46+
},
47+
interval: {
48+
doc: 'The interval in milliseconds to capture and log the process events.',
49+
format: 'duration',
50+
default: 10000
51+
}
52+
},
4153
debug: {
4254
execArgvDebugString: {
4355
doc: 'The process.execArgv debug string if the process is running with it. Used to initiate child processes with in order to debug them.',
@@ -74,19 +86,45 @@ const schema = {
7486
}
7587
}
7688
},
89+
s2Containers: {
90+
serviceDiscoveryServiceInstances: {
91+
timeoutToBeAvailable: {
92+
doc: 'The duration in milliseconds before giving up on waiting for the s2 Service Discovery Service Instances to be available.',
93+
format: 'duration',
94+
default: 120000
95+
},
96+
retryIntervalToBeAvailable: {
97+
doc: 'The retry interval for the s2 Service Discovery Service Instances to be available.',
98+
format: 'duration',
99+
default: 5000
100+
}
101+
},
102+
responsive: {
103+
timeout: {
104+
doc: 'The duration in milliseconds before giving up on waiting for the s2 containers to be responsive.',
105+
format: 'duration',
106+
default: 30000
107+
},
108+
retryInterval: {
109+
doc: 'The retry interval for the s2 containers to be responsive.',
110+
format: 'duration',
111+
default: 2000
112+
}
113+
}
114+
},
77115
emissary: {
78116
protocol: {
79-
doc: 'The protocol that the emissary is listening as.',
117+
doc: 'The protocol that the Emissary is listening as.',
80118
format: ['https', 'http'],
81119
default: 'https'
82120
},
83121
hostname: {
84-
doc: 'The hostname (IP or name) address of the emissary host.',
122+
doc: 'The hostname (IP or name) address of the Emissary host.',
85123
format: String,
86124
default: '240.0.0.0'
87125
},
88126
port: {
89-
doc: 'The port that the emissary is listening on.',
127+
doc: 'The port that the Emissary is listening on.',
90128
format: 'port',
91129
default: 8080
92130
},
@@ -106,6 +144,11 @@ const schema = {
106144
doc: 'The location of the report.',
107145
format: String,
108146
default: '/var/log/purpleteam/outcomes/'
147+
},
148+
formats: {
149+
doc: 'The supported formats that reports will be written in.',
150+
format: Array,
151+
default: ['html', 'json', 'md']
109152
}
110153
},
111154
spider: {
@@ -126,7 +169,7 @@ const schema = {
126169
}
127170
},
128171
shutdownEmissariesAfterTest: {
129-
doc: 'Useful for inspecting emissary containers during debugging.',
172+
doc: 'Useful for inspecting Emissary containers during debugging.',
130173
format: 'Boolean',
131174
default: true
132175
}
@@ -143,24 +186,19 @@ const schema = {
143186
default: 'LOW'
144187
},
145188
alertThreshold: {
146-
doc: 'The number of alerts specified by the build user that the alerts found by Zap should not exceed.',
189+
doc: 'The number of alerts specified by the Build User that the alerts found by Zap should not exceed.',
147190
format: 'int',
148191
default: 0
149192
},
150193
method: {
151-
doc: 'The method used to attack the build user supplied route.',
194+
doc: 'The method used to attack the Build User supplied route.',
152195
format: ['GET', 'POST', 'PUT'],
153196
default: 'POST'
154197
},
155198
browser: {
156199
doc: 'The type of browser to run tests through.',
157200
format: ['chrome', 'firefox'],
158201
default: 'chrome'
159-
},
160-
reportFormat: {
161-
doc: 'The supported formats that reports may be written in.',
162-
format: ['html', 'json', 'md'],
163-
default: 'html'
164202
}
165203
},
166204
cucumber: {
@@ -185,7 +223,7 @@ const schema = {
185223
// default: `${process.cwd()}/node_modules/.bin/cucumber-js`
186224
default: `${process.cwd()}/bin/purpleteamParallelCucumber`
187225
},
188-
timeOut: {
226+
timeout: {
189227
doc: 'The value used to set the timeout (https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/timeouts.md)',
190228
format: 'duration',
191229
default: 5000

healthcheck.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// Copyright (C) 2017-2021 BinaryMist Limited. All rights reserved.
22

3-
// This file is part of purpleteam.
3+
// This file is part of PurpleTeam.
44

5-
// purpleteam is free software: you can redistribute it and/or modify
5+
// PurpleTeam is free software: you can redistribute it and/or modify
66
// it under the terms of the GNU Affero General Public License as published by
77
// the Free Software Foundation version 3.
88

9-
// purpleteam is distributed in the hope that it will be useful,
9+
// PurpleTeam is distributed in the hope that it will be useful,
1010
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
// GNU Affero General Public License for more details.
1313

1414
// You should have received a copy of the GNU Affero General Public License
15-
// along with purpleteam. If not, see <https://www.gnu.org/licenses/>.
15+
// along with this PurpleTeam project. If not, see <https://www.gnu.org/licenses/>.
1616

1717
const http = require('http');
1818
require('convict');

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// Copyright (C) 2017-2021 BinaryMist Limited. All rights reserved.
22

3-
// This file is part of purpleteam.
3+
// This file is part of PurpleTeam.
44

5-
// purpleteam is free software: you can redistribute it and/or modify
5+
// PurpleTeam is free software: you can redistribute it and/or modify
66
// it under the terms of the GNU Affero General Public License as published by
77
// the Free Software Foundation version 3.
88

9-
// purpleteam is distributed in the hope that it will be useful,
9+
// PurpleTeam is distributed in the hope that it will be useful,
1010
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
// GNU Affero General Public License for more details.
1313

1414
// You should have received a copy of the GNU Affero General Public License
15-
// along with purpleteam. If not, see <https://www.gnu.org/licenses/>.
15+
// along with this PurpleTeam project. If not, see <https://www.gnu.org/licenses/>.
1616

1717
require('app-module-path/register');
1818
const server = require('src/server');

package.json

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,58 +25,49 @@
2525
"keywords": [
2626
"agile",
2727
"application security",
28+
"appsec",
2829
"bdd",
2930
"behaviour driven development",
3031
"blue team",
3132
"ci",
3233
"cloud security",
3334
"continuous deployment",
3435
"continuous integration",
35-
"cli",
36-
"cucumber",
3736
"cybersecurity",
38-
"dev sec ops",
39-
"red team",
40-
"security",
41-
"selenium",
42-
"infosec",
43-
"information security",
44-
"tools",
4537
"devsecops",
4638
"devops",
47-
"dev ops",
48-
"purpleteam",
39+
"information security",
40+
"infosec",
4941
"owasp",
5042
"penetration testing",
43+
"purple team",
5144
"purpleteam",
45+
"red team",
5246
"security",
5347
"security regression testing",
5448
"software security",
49+
"tools",
5550
"web application security",
56-
"web security",
57-
"zap"
51+
"web security"
5852
],
5953
"author": "Kim Carter",
6054
"license": "AGPL-3.0-only",
6155
"bugs": {
6256
"url": "https://github.com/purpleteam-labs/purpleteam/issues"
6357
},
6458
"homepage": "https://purpleteam-labs.com",
65-
"// Old version of gherkin is required to satisfy src/scripts/cucumber-redacted.js": "Hopefully cucumber will reinstate the cucumber-redacted functionality at some stage.",
6659
"dependencies": {
6760
"@aws-sdk/client-lambda": "^3.18.0",
6861
"@aws-sdk/client-servicediscovery": "^3.18.0",
6962
"@cucumber/cucumber": "^7.2.1",
7063
"@cucumber/gherkin-streams": "2.0.2",
71-
"@hapi/bourne": "^2.0.0",
72-
"@hapi/good": "^9.0.1",
64+
"@hapi/bourne": "^2.0.0",
7365
"@hapi/hapi": "^20.1.3",
7466
"app-module-path": "^2.2.0",
7567
"axios": "^0.21.1",
7668
"convict": "^6.1.0",
7769
"convict-format-with-moment": "^6.0.1",
7870
"convict-format-with-validator": "^6.0.1",
79-
"hapi-good-winston": "^3.0.1",
8071
"http-proxy-agent": "^4.0.1",
8172
"joi": "^17.4.0",
8273
"purpleteam-logger": "^1.1.2",

0 commit comments

Comments
 (0)