Bug 214639 - [ews-app] Pass api key in more secure manner
Summary: [ews-app] Pass api key in more secure manner
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-22 06:08 PDT by Aakash Jain
Modified: 2020-07-22 11:40 PDT (History)
3 users (show)

See Also:


Attachments
Patch (5.14 KB, patch)
2020-07-22 08:44 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (5.13 KB, patch)
2020-07-22 10:07 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2020-07-22 06:08:43 PDT
Pass api key in more secure manner in EWS django app. Instead of appending the api key in the url, it should be passed as a requests.get parameter. One benefit of that is, if the url is logged, api key wouldn't appear in the logs.

Similar to https://trac.webkit.org/changeset/258008/webkit
Comment 1 Aakash Jain 2020-07-22 08:44:57 PDT
Created attachment 404925 [details]
Patch
Comment 2 Jonathan Bedard 2020-07-22 09:24:18 PDT
Comment on attachment 404925 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404925&action=review

> Tools/BuildSlaveSupport/ews-app/ews/common/bugzilla.py:98
> +            # Catching all exceptions here to safeguard api key.

You say you're catching all exceptions to safeguard the API key, but then you log the exception anyways? Is that deliberate? I suppose you're guaranteeing that the exception won't end up in the response, but the API could still end up in the log, no?
Comment 3 Aakash Jain 2020-07-22 09:47:46 PDT
Comment on attachment 404925 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404925&action=review

>> Tools/BuildSlaveSupport/ews-app/ews/common/bugzilla.py:98
>> +            # Catching all exceptions here to safeguard api key.
> 
> You say you're catching all exceptions to safeguard the API key, but then you log the exception anyways? Is that deliberate? I suppose you're guaranteeing that the exception won't end up in the response, but the API could still end up in the log, no?

Oops, I printed the exception here for debugging. Thanks for catching that.
Comment 4 Aakash Jain 2020-07-22 10:07:57 PDT
Created attachment 404935 [details]
Patch
Comment 5 EWS 2020-07-22 11:16:44 PDT
Committed r264711: <https://trac.webkit.org/changeset/264711>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404935 [details].
Comment 6 Radar WebKit Bug Importer 2020-07-22 11:17:15 PDT
<rdar://problem/65945882>
Comment 7 Aakash Jain 2020-07-22 11:40:02 PDT
Deployed the change on the server.