Prevent UAA priviledges escalation in UAADB
In the actual UAA implementation users privileges (as well as clients ones) are stored in UAADB tables.
Just to fix our mind with an example: we have the 'group_membership' table which is a key table to assign a role to a specific user.
Based on this, we have that UAA Security model is strongly dependent by UAADB server hardening. This means that any violation or unauthorised access to the UAADB could quickly permit a malicious user to escalate his/her own privileges. It is enough to add a new record into the 'group_membership' table.
This security exposure is even more critical in the modern application deployment models which often use a Cloud IaaS provider to host database services. In this case UAA owner could not have any kind of access to the UAADB server in order to enforce a more robust security posture at UAADB level.
In general this could lead to some security exposures and limit adoption of CF in regulated markets where security is critical.
I think it could be great if UAA will be able to detect privileges escalation which have been occurred outside of application control i.e. via a SQL statement executed in UAADB.
The most simple implementation I see (but consider this as a rough idea ) ... could be to add another column to the users/clients tables with contains a digest value obtained processing the privileges map and a Salt key provided to UAA via CF YML file. (i.e. this could be obtained using an HMAC-MD5 function or similar one).
UAA code will manipulate digest value on any data change and it will validate data integrity on each data retrieval from UAADB. In this way a malicious user who access the UAADB won't be able to alter privileges and modify the digest value (in a consistent way) because he cannot access the UAA salt value.
Does it make sense to you ?
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/129545731
The labels on this github issue will be updated when the story is started.
@aalbanes We will review and get back on this
What is the threat model we are trying to defend against, @aalbanes ? If the intruder has access to both the DB and the running UAA, then in your proposed scenario,
- The adversary can easily forge the HMAC value when inserting / updating;
- What's worse, the adversary can easily wipe such column to
NULLfor all records, immediately "invalidating" all privilege records. This is basically introducing a new vector of DoS.
@d Jesse, The scenario I was depicted was related to UAADB which was compromised. I agree with you that if both UAA and UAADB are compromised the HMAC approach is not enough.
About the capability to set null the column... we are not introducing any new DoS because if UAADB was compromised hacker could even drop all data as well.
The threat I want to defend from here.. is: data 'manipulation', at UAADB level, which could lead to security privileges escalations w/o having any CF component able to detect it.
@aalbanes We don't have plans to add this support. This needs to be secured out of band with Privileged Identity management products.