<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> > We are trying to integrate OpenStack (Horizon or Keystone) with <br>
> > GuardianKey. However, we have doubts related to the best way to do this <br>
> > and the best point in the code for this integration.<br>
> > <br>
> > <br>
> > GuardianKey is a solution to protect systems against authentication <br>
> > attacks. It uses Machine Learning and analyses the user's behavior, <br>
> > threat intelligence and psychometrics (or behavioral biometrics). The <br>
> > protected system (in the concrete case, OpenStack admin interface) must <br>
> > send an event via REST for the GuardianKey on each login attempt. More <br>
> > info at <a href="https://guardiankey.io" rel="noreferrer" target="_blank">https://guardiankey.io</a> <<a href="https://guardiankey.io" rel="noreferrer" target="_blank">https://guardiankey.io</a>>.<br>
> > <br>
> > The best way to integrate would be on having a hook in the procedure <br>
> > that process the user credentials submission in OpenStack (the script <br>
> > that receives the POST), something such as:<br>
> > <br>
> > <br>
> > if(<POST IN AUTH FORM>) {<br>
> >   boolean loginFailed =  checkLogin();<br>
> >   GuardianKeyEvent event = createEventForGuardianKey(username,loginFailed);<br>
> >   boolean GuardianKeyValidation = checkGuardianKeyViaREST(event);<br>
> >   if(GuardianKeyValidation){<br>
> >      // Allow access<br>
> >   } else {<br>
> >      // Deny access<br>
> >   }<br>
> > }<br>
> > <br>
> > Where is the best place to create this integration? Horizon or Keystone? <br>
> > Is there a way to create a hook for this purpose? Should we create an <br>
> > extension?<br>
<br>
Keystone would be the best place for this. Horizon is only one way a user can log in to OpenStack, so hooking into Horizon would not cover your attack vector. Keystone has a built-in auditing system specifically for this, using CADF notifications to emit events when a user logs in:<br>
<br>
<a href="https://docs.openstack.org/keystone/latest/admin/event_notifications.html" rel="noreferrer" target="_blank">https://docs.openstack.org/keystone/latest/admin/event_notifications.html</a><br>
<br>
All you need to do is create a consumer for those notifications.<br>
<br>
Colleen<br></blockquote><div><br></div><div>Thank you, Colleen, for your message.</div><div><br></div><div>These days, I spent some time on it to understand better about the OpenStack events. As I could see, the authentication event does not have the user login name and other useful user information, such as e-mail. Is there a way to retrieve this information using the OpenStack resources? Or the best way is to access directly the database?</div><div><br></div><div>Another question: We will need to deny the access if GuardianKey identifies a high attack risk. In this case, is there an easy way to drop a user session using the Keystone API or resources (and the information in the event)?</div><div><br></div><div>Finally, you mentioned about the consumer. Is this a consumer for a RabbitMQ queue or an OpenStack API consumer? In the last case, is there example code for this?</div><div><br></div><div>Thank you in advance.</div><div><br></div><div>Regards,</div><div><br></div><div>Paulo Angelo</div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div></div></div>