File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,14 @@ export abstract class BundleParentHandler implements ICommandHandler {
44
44
// log the arguments on entry to the Handler
45
45
const logger = Logger . getAppLogger ( ) ;
46
46
if ( params . arguments . silent === undefined ) {
47
- logger . debug ( "Arguments received by cics-deploy: " + JSON . stringify ( params . arguments ) ) ;
47
+
48
+ // Strip passwords from the data before logging it
49
+ let inputParms = JSON . stringify ( params . arguments ) ;
50
+ inputParms = this . replacePassword ( inputParms , params . arguments . zpw ) ;
51
+ inputParms = this . replacePassword ( inputParms , params . arguments . spw ) ;
52
+ inputParms = this . replacePassword ( inputParms , params . arguments . cpw ) ;
53
+
54
+ logger . debug ( "Arguments received by cics-deploy: " + inputParms ) ;
48
55
}
49
56
50
57
try {
@@ -87,4 +94,11 @@ export abstract class BundleParentHandler implements ICommandHandler {
87
94
* @memberof BundleParentHandler
88
95
*/
89
96
public abstract async performAction ( params : IHandlerParameters ) : Promise < string > ;
97
+
98
+ private replacePassword ( source : string , pwd : string ) : string {
99
+ if ( pwd !== undefined ) {
100
+ return source . split ( pwd ) . join ( "*REDACTED*" ) ;
101
+ }
102
+ return source ;
103
+ }
90
104
}
You can’t perform that action at this time.
0 commit comments