node-vault icon indicating copy to clipboard operation
node-vault copied to clipboard

node-vault shows token in the stack trace in the logs

Open vshalchian opened this issue 7 years ago • 0 comments

We use node-vault version 0.9.0

Our application logs stack traces when connecting to vault and in the stack_trace I can see the clear text vaule of vault token which is a huge risk, can the token be masked or hidden somehow ? Here is the example :

Unexpected error connecting to vault: { RequestError: Error: connect ETIMEDOUT <vault_ip_address>:<vault_port> at new RequestError (/pmt-node-modules/node_modules/request-promise-core/lib/errors.js:14:15) at Request.plumbing.callback (/pmt-node-modules/node_modules/request-promise-core/lib/plumbing.js:87:29) at Request.RP$callback [as _callback] (/pmt-node-modules/node_modules/request-promise-core/lib/plumbing.js:46:31) at self.callback (/pmt-node-modules/node_modules/request/request.js:185:22) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Request.onRequestError (/pmt-node-modules/node_modules/request/request.js:877:8) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at TLSSocket.socketErrorListener (_http_client.js:401:9) at emitOne (events.js:116:13) at TLSSocket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:66:8) at _combinedTickCallback (internal/process/next_tick.js:139:11) at process._tickCallback (internal/process/next_tick.js:181:9) name: 'RequestError', message: 'Error: connect ETIMEDOUT <vault_ip_address>:<vault_port>', cause: { Error: connect ETIMEDOUT <vault_ip_address>:<vault_port> at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect', address: '<vault_ip_address>', port: <vault_port>}, error: { Error: connect ETIMEDOUT <vault_ip_address>:<vault_port> at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect', address: '<vault_ip_address>', port: <vault_port>}, options: { json: true, resolveWithFullResponse: true, simple: false, strictSSL: true, path: '/secret/<path_to_secret>', method: 'GET', headers: { 'X-Vault-Token': '<vault_token_in_clear_text>' }, uri: 'https://<vault_address>:<vault_port>/v1/secret/<path_to_secret>', callback: [Function: RP$callback], transform: undefined, transform2xxOnly: false }, response: undefined }

vshalchian avatar Apr 30 '19 15:04 vshalchian