Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't log websocket messages if there are errors. #998

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

jhaynes
Copy link
Contributor

@jhaynes jhaynes commented Sep 29, 2017

The messages that come over the websockets can potentially contain sensitive
information that shouldn't be put in logs. Separately, if reading the message
results in an error, the content of the message is irrelevant and unreliable.

Summary

When there is a websocket connection error, we shouldn't log the message because we have no way of knowing what it contains.

Implementation details

Removed the message portion of the log line.

Testing

  • Builds on Linux (make release)
  • Builds on Windows (go build -out amazon-ecs-agent.exe ./agent)
  • Unit tests on Linux (make test) pass
  • Unit tests on Windows (go test -timeout=25s ./agent/...) pass
  • Integration tests on Linux (make run-integ-tests) pass
  • Integration tests on Windows (.\scripts\run-integ-tests.ps1) pass
  • Functional tests on Linux (make run-functional-tests) pass
  • Functional tests on Windows (.\scripts\run-functional-tests.ps1) pass

New tests cover the changes: no

Description for the changelog

NA

Licensing

This contribution is under the terms of the Apache 2.0 License: yes

Copy link
Contributor

@petderek petderek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boat.jpg

@@ -214,7 +214,7 @@ func (acsSession *session) Start() error {
// Disconnected unexpectedly from ACS, compute backoff duration to
// reconnect
reconnectDelay := acsSession.computeReconnectDelay(isInactiveInstance)
seelog.Debugf("Reconnecting to ACS in: %v", reconnectDelay)
seelog.Infof("Reconnecting to ACS in: %v", reconnectDelay)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this include the units?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will now!

Copy link
Contributor

@aaithal aaithal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The messages that come over the websockets can potentially contain sensitive
information that shouldn't be put in logs. Separately, if reading the message
results in an error, the content of the message is irrelevant and unreliable.
@jhaynes jhaynes merged commit ae897cf into aws:dev Sep 29, 2017
@jhaynes jhaynes deleted the ws_logging_fix branch September 29, 2017 19:56
@samuelkarp
Copy link
Contributor

👍

@jhaynes jhaynes mentioned this pull request Sep 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants