<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">You probably have to wait about 100 years for that test ;-). However, you are right that this is system dependent. I came across this bug in mac os x when googling for the birthday problem table. After a fork, uuid_generate_random() generates the same UUID in every child!<br><div><br></div><div><a href="http://stackoverflow.com/questions/2759644/python-multiprocessing-doesnt-play-nicely-with-uuid-uuid4">http://stackoverflow.com/questions/2759644/python-multiprocessing-doesnt-play-nicely-with-uuid-uuid4</a></div><div><a href="http://bugs.python.org/issue8621">http://bugs.python.org/issue8621</a></div><div><a href="http://openradar.appspot.com/radar?id=334401">http://openradar.appspot.com/radar?id=334401</a></div><div><div><br></div><div><br></div><div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div><div style="font-size: 12px; ">-------------------------------------------------</div><div style="font-size: 12px; ">Brian Schott, CTO</div><div style="font-size: 12px; ">Nimbis Services, Inc.</div><div style="font-size: 12px; "><a href="mailto:brian.schott@nimbisservices.com">brian.schott@nimbisservices.com</a></div><div style="font-size: 12px; ">ph: 443-274-6064 fx: 443-274-6060</div></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Dec 9, 2013, at 4:23 PM, Cody Bunch <<a href="mailto:cody.bunch@rackspace.com">cody.bunch@rackspace.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div fpstyle="1" ocsi="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word;"><div style="direction: ltr; font-family: Tahoma; font-size: 10pt;">Thanks! I'd replied, but seems I left the list off. The Nova sources (nova/openstack/common/uuidutils.py) use Pythons uuid.uuid4() to generate the uuids. <span style="font-size: 10pt;">The Python source for UUID4 seems to pull from a number of methods, going to (u)random or pythons random module, so heavily dependent on system(s) it's being run from:</span><div><div><a href="http://hg.python.org/cpython/file/ec8d2f54dcb2/Lib/uuid.py" target="_blank">http://hg.python.org/cpython/file/ec8d2f54dcb2/Lib/uuid.py</a></div><div><br></div><div>I did throw up a quick test to see if I can find a match... so far I've generated 20 million uuid's and not had a collision (didn't expect one, but it's good to see):</div><div><a href="https://gist.github.com/bunchc/7880710" target="_blank">https://gist.github.com/bunchc/7880710</a></div><div><br></div><div>It also seems that other services may use their own UUID generation or so, I've not looked into that however.</div><div><br></div><div>-C</div><div style="font-family: 'Times New Roman'; font-size: 16px;"><hr tabindex="-1"><div id="divRpF596853" style="direction: ltr;"><font face="Tahoma" size="2"><b>From:</b><span class="Apple-converted-space"> </span>Brian Schott [<a href="mailto:brian.schott@nimbisservices.com">brian.schott@nimbisservices.com</a>]<br><b>Sent:</b><span class="Apple-converted-space"> </span>Monday, December 09, 2013 3:16 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Clark, Robert Graham<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:openstack-security@lists.openstack.org">openstack-security@lists.openstack.org</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [Openstack-security] Deriving Instance UUID<br></font><br></div><div></div><div><div>Rob,</div><div><br></div><div>That is a hard question. The short answer is that it depends on the type of UUID. Type 1 () is mac address of the server + timestamp, so probability of guessing another UUID in the system is very high. Type 4 (random) has 122 bits, so probability of collision is extremely small and is also dependent on having a good random number generator. A poor implementation might be predictable. Type 5 (namespace) has fewer bits depending on the size of the namespace. </div><div><br></div><div><div><a href="http://en.wikipedia.org/wiki/Birthday_problem#Probability_table" target="_blank">http://en.wikipedia.org/wiki/Birthday_problem#Probability_table</a></div><div><br></div><div>I think in general web url usage, a bare UUID as authentication mechanism isn't considered good practice, but it really depends on how many elements you have in the system, how it is protected from brute-force attacks, etc.</div><div><br></div><div>Brian</div><div><br><div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div><div style="font-size: 12px;">-------------------------------------------------</div><div style="font-size: 12px;">Brian Schott, CTO</div><div style="font-size: 12px;">Nimbis Services, Inc.</div><div style="font-size: 12px;"><a href="mailto:brian.schott@nimbisservices.com" target="_blank">brian.schott@nimbisservices.com</a></div><div style="font-size: 12px;">ph: 443-274-6064 fx: 443-274-6060</div></div><div><br></div></span><br class="Apple-interchange-newline"></div><br><div><div>On Dec 9, 2013, at 3:06 PM, Clark, Robert Graham <<a href="mailto:robert.clark@hp.com" target="_blank">robert.clark@hp.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-GB" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><div class="WordSection1"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Guys,</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"> </div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Is there any way you know of to infer or guess at the UUID of a compute instance belonging to another tenant?</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"> </div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">-Rob</div></div>_______________________________________________<br>Openstack-security mailing list<br><a href="mailto:Openstack-security@lists.openstack.org" target="_blank" style="color: rgb(149, 79, 114); text-decoration: underline;">Openstack-security@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-security" target="_blank" style="color: rgb(149, 79, 114); text-decoration: underline;">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-security</a></div></blockquote></div></div></div></div></div></div></div></div></blockquote></div><br></div></div></body></html>