github-for-jira icon indicating copy to clipboard operation
github-for-jira copied to clipboard

ARC-1372 unsafe stream

Open joshkay10 opened this issue 2 years ago • 3 comments

What's in this PR? Created a new stream class RawLogStream so that we can log out unsafe data to a secure environment for Splunking.

Why First attempt was to create an unsafe logger and use that instance, which would write out the logs to the secure environment. This worked but a major drawback was that it relied on devs to know about that option and then manually insert the logs they wanted. With this method its more usable since we just need to toggle the feature flag and it will stream the logs to safe and unsafe environment.

The catch Since we use a feature flag(with JiraHost) to determine whether we send the unsafe logs or not, this means we must have the jiraHost value as a log attribute, this value is pulled out of the logs data during the write process.

Runbooks How to Splunk unsafe data

Added feature flags LOG_UNSAFE_DATA

Affected issues
ARC-1372

How has this been tested?
Unit tests have been created for all new functionality. Testing in stage to check that sensitive data is serialized or sent to unsafe environment.

Whats Next? Thats all for now. Monitor and make sure this suits our needs.

joshkay10 avatar Jul 13 '22 02:07 joshkay10

@gxueatlassian, yeah ideally! We have this always updating list const SENSITIVE_DATA_FIELDS = ["jiraHost", "orgName", "repoName", "userGroup", "userGroup", "aaid", "username"]; from in logger-utils that will hash stuff before it makes it to logs as well

joshkay10 avatar Jul 14 '22 01:07 joshkay10

Sorry, but my logger changes have conflicted with this PR. We should get together to work through it.

mboudreau avatar Aug 01 '22 07:08 mboudreau

Sorry, but my logger changes have conflicted with this PR. We should get together to work through it.

Conflicts were pretty minor so not a lot of trouble fortunately.

Will still set up a pair to see this one through tho!

joshkay10 avatar Aug 11 '22 00:08 joshkay10

Closing as changed the approach slightly, using logging level instead of feature flag. Was simpler to replay in a fresh branch than to unwind then make changes with the many conflicts.

joshkay10 avatar Aug 26 '22 03:08 joshkay10