{"action":"created","issue":{"url":"https://api.github.com/repos/StackStorm/st2/issues/1615","labels_url":"https://api.github.com/repos/StackStorm/st2/issues/1615/labels{/name}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/1615/comments","events_url":"https://api.github.com/repos/StackStorm/st2/issues/1615/events","html_url":"https://github.com/StackStorm/st2/pull/1615","id":87292009,"number":1615,"title":"[WIP] Add support for \"secret\" action parameters, mask them from the logs","user":{"login":"Kami","id":125088,"avatar_url":"https://avatars.githubusercontent.com/u/125088?v=3","gravatar_id":"","url":"https://api.github.com/users/Kami","html_url":"https://github.com/Kami","followers_url":"https://api.github.com/users/Kami/followers","following_url":"https://api.github.com/users/Kami/following{/other_user}","gists_url":"https://api.github.com/users/Kami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kami/subscriptions","organizations_url":"https://api.github.com/users/Kami/orgs","repos_url":"https://api.github.com/users/Kami/repos","events_url":"https://api.github.com/users/Kami/events{/privacy}","received_events_url":"https://api.github.com/users/Kami/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-11T10:15:20Z","updated_at":"2015-06-16T04:42:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/1615","html_url":"https://github.com/StackStorm/st2/pull/1615","diff_url":"https://github.com/StackStorm/st2/pull/1615.diff","patch_url":"https://github.com/StackStorm/st2/pull/1615.patch"},"body":"This pull request adds support for a `secret` attribute to the action parameter metadata. This attribute indicates that the parameter in question contains sensitive data and should be treated as such.\r\n\r\nRight now, that means we mask the values of the secret parameters in the logs but we also have a framework in place now so we can extend and improve on that later.\r\n\r\nAlso, keep in mind that this pull request != secret management. That's a different feature and something which will be done later / when needed.\r\n\r\n## Open questions\r\n\r\n* What else should we do with the \"secret\" parameters?\r\n\r\nI imagine eventually we will also want to mask them when interacting with the API, but this makes no sense right now without RBAC / roles."},"comment":{"url":"https://api.github.com/repos/StackStorm/st2/issues/comments/112286475","html_url":"https://github.com/StackStorm/st2/pull/1615#issuecomment-112286475","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/1615","id":112286475,"user":{"login":"Kami","id":125088,"avatar_url":"https://avatars.githubusercontent.com/u/125088?v=3","gravatar_id":"","url":"https://api.github.com/users/Kami","html_url":"https://github.com/Kami","followers_url":"https://api.github.com/users/Kami/followers","following_url":"https://api.github.com/users/Kami/following{/other_user}","gists_url":"https://api.github.com/users/Kami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kami/subscriptions","organizations_url":"https://api.github.com/users/Kami/orgs","repos_url":"https://api.github.com/users/Kami/repos","events_url":"https://api.github.com/users/Kami/events{/privacy}","received_events_url":"https://api.github.com/users/Kami/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T04:42:07Z","updated_at":"2015-06-16T04:42:07Z","body":"@lakshmi-kannan \r\n\r\n> In general, I am fine with the secrets field approach. I think we need high level logging APIs so there is a single code point for this and we won't have to think twice when using it. We can debate this and see if we can do anything better.\r\n\r\nThat was the whole idea with the logger approach approach - user should include log context inside the `extra` attribute. This attribute is then processed in the formatter and we can mask the secret values.\r\n\r\nSadly as noted above, we can't fully contain this logic in the log formatter so it spills in other places as well."}}