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
1717const 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' ) ;
2020const path = require ( 'path' ) ;
2121
22- convict . addFormat ( convictFormatWithMoment . duration ) ;
23- convict . addFormat ( convictFormatWithValidator . url ) ;
22+ convict . addFormat ( duration ) ;
23+ convict . addFormat ( url ) ;
2424
2525const 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
0 commit comments