Skip to content

Commit 1e4f396

Browse files
HweinstockkaranA-aws
authored andcommitted
refactor(ec2): avoid logging somewhat sensitive data (aws#6149)
## Problem We currently log `STREAM_URL` and `TOKEN` which are used to establish the SSM session. However, these could be used to establish a connection outside the toolkit. ## Solution - Omit these from the logs. - Also add a logging statement to make it easier to find these `connect_script` logs. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 0e1e4d5 commit 1e4f396

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/core/resources/ec2_connect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ _main() {
4747

4848
_require AWS_SSM_CLI "${AWS_SSM_CLI:-}"
4949
_require AWS_REGION "${AWS_REGION:-}"
50-
_require STREAM_URL "${STREAM_URL:-}"
51-
_require TOKEN "${TOKEN:-}"
50+
_require_nolog STREAM_URL "${STREAM_URL:-}"
51+
_require_nolog TOKEN "${TOKEN:-}"
5252
_require SESSION_ID "${SESSION_ID:-}"
5353
_require LOG_FILE_LOCATION "${LOG_FILE_LOCATION:-}"
5454

packages/core/src/awsService/ec2/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ export class Ec2Connecter implements vscode.Disposable {
242242
const ssmSession = await this.startSSMSession(selection.instanceId)
243243

244244
const vars = getEc2SsmEnv(selection, ssm, ssmSession)
245+
getLogger().info(`ec2: connect script logs at ${vars.LOG_FILE_LOCATION}`)
245246
const envProvider = async () => {
246247
return { [sshAgentSocketVariable]: await startSshAgent(), ...vars }
247248
}

0 commit comments

Comments
 (0)