<div dir="ltr">Hi,<div><br></div><div>From my experience context is usually bigger then just a storage for user credentials and specifics of request. Context usually defines an area within the called method should act. Probably the class name RequestContext is a bit confusing. The actual goal of the context should be defined by a service design. If you have a lot of independent components you will probably will ned to pass a lot of parameters to specify specifics of work, so it is just more convenient to have dictionary like object which carry all necessary information about contextual information. This context can be used to pass information between different components of the service. </div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 27, 2014 at 4:27 PM, Angus Salkeld <span dir="ltr"><<a href="mailto:angus.salkeld@rackspace.com" target="_blank">angus.salkeld@rackspace.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 27/01/14 22:53 +0000, Adrian Otto wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Jan 27, 2014, at 2:39 PM, Paul Montgomery <<a href="mailto:paul.montgomery@RACKSPACE.COM" target="_blank">paul.montgomery@RACKSPACE.COM</a><u></u>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Solum community,<br>
<br>
I created several different approaches for community consideration<br>
regarding Solum context, logging and data confidentiality.  Two of these<br>
approaches are documented here:<br>
<br>
<a href="https://wiki.openstack.org/wiki/Solum/Logging" target="_blank">https://wiki.openstack.org/<u></u>wiki/Solum/Logging</a><br>
<br>
A) Plain Oslo Log/Config/Context is in the "Example of Oslo Log and Oslo<br>
Context" section.<br>
<br>
B) A hybrid Oslo Log/Config/Context but SecurityContext inherits the<br>
RequestContext class and adds some confidentiality functions is in the<br>
"Example of Oslo Log and Oslo Context Combined with SecurityContext"<br>
section.<br>
<br>
None of this code is production ready or tested by any means.  Please just<br>
examine the general architecture before I polish too much.<br>
<br>
I hope that this is enough information for us to agree on a path A or B.<br>
I honestly am not tied to either path very tightly but it is time that we<br>
reach a final decision on this topic IMO.<br>
<br>
Thoughts?<br>
</blockquote>
<br>
I have a strong preference for using the SecurityContext approach. The main reason for my preference is outlined in the Pro/Con sections of the Wiki page. With the "A" approach, leakage of confidential information mint happen with *any* future addition of a logging call, a discipline which may be forgotten, or overlooked during future code reviews. The "B" approach handles the classification of data not when logging, but when placing the data into the SecurityContext. This is much safer from a long term maintenance perspective.<br>

</blockquote>
<br></div>
I think we seperate this out into:<br>
<br>
1) we need to be security aware whenever we log information handed to<br>
   us by the user. (I totally agree with this general statement)<br>
<br>
2) should we log structured data, non structured data or use the notification mechanism (which is structured)<br>
   There have been some talks at summit about the potential merging of<br>
   the logging and notification api, I honestly don't know what<br>
   happened to that but have no problem with structured logging. We<br>
   should use the notification system so that ceilometer can take<br>
   advantage of the events.<br>
<br>
3) should we use a RequestContext in the spirit of the olso-incubator<br>
  (and inherited from it too). OR one different from all other<br>
  projects.<br>
<br>
  IMHO we should just use oslo-incubator RequestContext. Remember the<br>
  context is not a generic dumping ground for "I want to log stuff so<br>
  lets put it into the context". It is for user credentials and things<br>
  directly associated with the request (like the request_id). I don't<br>
  see why we need a generic dict style approach, this is more likely<br>
  to result in programming error     context.set_priv('userid', bla)<br>
  instead of:<br>
  context.set_priv('user_id', bla)<br>
<br>
  I think my point is: We should very quickly zero in on the<br>
  attributes we need in the context and they will seldom change.<br>
<br>
  As far as security goes Paul has shown a good example of how to<br>
  change the logging_context_format_string to achieve structured and<br>
  secure logging of the context. oslo log module does not log whatever<br>
  is in the context but only what is configured in the solum.conf (via<br>
  logging_context_format_string)<u></u>. So I don't believe that the<br>
  new/different RequestContext provides any improved security.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
-Angus</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Adrian<br>
______________________________<u></u>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<u></u>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<u></u>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font color="#999999"><span style="background-color:rgb(255,255,255)">Georgy Okrokvertskhov<br>
Architect,<br><span style="font-family:arial;font-size:small">OpenStack Platform Products,</span><br>
Mirantis</span><br>
<a href="http://www.mirantis.com/" target="_blank">http://www.mirantis.com</a><br>
Tel. +1 650 963 9828<br>
Mob. +1 650 996 3284</font><br></div>
</div>