Is it possible to filter SolR results using Active Directory? - solr

We use Solr to index an search through docs in our file system.
Currently, all users can access to all the docs. We'd like to change that, so that users can only access to some documents, according to their membership of a group in the Active Directory.
I've found that we can setup Apache to perform NTLM authentication, but I can't find anything about filtering results according to this authentication.
So, my question is : if we set up AD with groups like "SOLR_ACCESS_ALL", "SOLR_ACCESS_GROUP_1", "SOLR_ACCESS_GROUP_2","SOLR_ACCESS_GROUP_3", etc... can we set up SolR to filter results according to those memberships? We would also need to be able to give multiple access to some users (for example SOLR_ACCESS_GROUP_1 and SOLR_ACCESS_GROUP_3).
Thanks in advance for your help.

Solr does not integrate with Active Directory out of the box. However, a different Apache project ManifoldCF integrates with Solr and - I believe - Active Directory among many other enterprise connections.
See, for example, an article describing how to put these together.

Related

Find Azure AD groups that have a sensitivity label applied

We have a requirement to check any group that has used a particular sensitivity label.
I've looked at the Advanced query capabilities on Azure AD directory objects to try to build a filter clause, but I haven't had any luck.
Is this possible? There are +10,000 groups in this tenant, so it's not ideal to call the list groups endpoint without a filter.
Here are the Microsoft Graph service-specific throttling limits:
Please refer this document for reference:https://learn.microsoft.com/en-us/graph/throttling-limits#pattern
Hope this helps.

Microsoft Graph API - Azure AD Connect - extensionAttribute

When I try querying extensionAttribute with Graph API (Hybrid Exchange), I cannot get any value.
E.g., if I try: https://graph.microsoft.com/v1.0/users/<userid or upn>?$select=extensionAttribute2, I cannot see the value even I know it’s there.
Do you know how to get it properly (or a workaround)?
Thank you
Are these values synced to Azure Active Directory? All properties for the AAD User can be found in the Microsoft Graph API docs here : https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0
It sounds like these are being synced from an AAD Connect environment, so it's most likely you are trying to get the onPremisesExtensionAttributes.
Per the description:
Contains extensionAttributes 1-15 for the user. Note that the individual extension attributes are neither selectable nor filterable. For an onPremisesSyncEnabled user, this set of properties is mastered on-premises and is read-only. For a cloud-only user (where onPremisesSyncEnabled is false), these properties may be set during creation or update.
I suggest taking a look more thoroughly through the documentation in regards to this. In addition to that, as you mentioned Exchange, note that the custom attributes from exchange are the same as the extension attributes. For more info on this see : https://github.com/microsoftgraph/microsoft-graph-docs/issues/5950
This is a separate sort of "Extension Attribute" but I figured I would include this in the answer as well. There is a different extensibility section for the Microsoft Graph, and the docs on this can be found here : https://learn.microsoft.com/en-us/graph/extensibility-overview
If you see information on these extensions, know that this is separate from the on-prem extensions.

Microsoft Graph AD Users or people API to search all users?

I'm trying to build functionality into my app for 'admins' to assign users from their AD group to certain groups that are further assigned to app-specific roles. Basically a simple management component.
Adding the user with the oid to a group is easy, the problem I'm facing is finding the actual user.
Currently, the only option I'm seeing is making multiple api requests to v1.0/users (999 items max) and grouping them all in memory and then provide a simple search function to narrow it down.
I have also used the v1.0/me/people endpoint to search for users but this does not reveal all users from the AD group, just relevant users they deal with, so not too useful.
Is there any other api endpoint I could tap into to do a search ONLY on members of the same active directory?
Using the startsWith filter on multiple properties is probably the closest we can get to user search in MS Graph at the moment:
https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'sarah') or startswith(givenName,'sarah') or startswith(surname,'sarah') or startswith(mail,'sarah') or startswith(userPrincipalName,'sarah')
Ended up switching to the old AD Graph API and implementing a query on the endpoint as follows:
https://graph.windows.net/{ tenant ID }/users?api-version=1.6&$select=mail,displayName,objectId,givenName,surname&$filter=startswith(givenName,'SEARCH TERM') or startswith(surname,'SEARCH TERM')
If a function receives 1 single param, it will search for that parameter in both givenName and surname but you could configure this to search accross any other supported fields.
You could also completely ditch the $select= completely to get the whole data. I didn't want the clutter though and those keys are enough for me.
Instead of going with startswith You may get better experience using search keyword:
https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#example-6-use-search-to-get-users-with-display-names-that-contain-the-letters-wa-including-a-count-of-returned-objects

SonarQube LDAP Plugin Active Directory nested groups

we use Sonarqube 6.2 with the LDAP Plugin 2.1.0.507. We have a connection to our Active Diretory. Normal user authentication and group mapping is working. But we have problems with nested groups.
I try to use the specificy LDAP memberOf Filter (memberof:1.2.840.113556.1.4.1941:) but unfortunally it is not working.
Questions
Is the LDAP Plugin able to handle nested group ?
If yes, what kind of changes are necessary in the filter settings ?
Attached you find my LDAP filter sonar.properties
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
ldap.group.request=(&(objectClass=group)(member=memberof:1.2.840.113556.1.4.1941:={dn}))
I hope this are enough informations.
Best Regards
Adam
I found the answer.
You need only use the LDAP Reverse Code between the search pattern member={dn}
# Nested Group Search
ldap.group.request=(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={dn}))

Data security in result sets from Elastic Search, Solr or

I need to add full-text search capabilities to my existing database. Of course first turn is to something like Solr or Elastic Search. And the blocking point I’ve got to is – how to securely display results returned from underlying search engine (let’s think about Solr or Elastic Search for now, however any other solution or engine that hit the point are also appreciated).
The tricky context is that I have, for example, in my system Personal Profile records that are to be indexed. One of the fields in personal profile is – manager’s feedback. Normally in the system that field is visible only to employee’s direct manager and higher hierarchy, i.e. ‘manager’ from another branch will not be able to see that field. However, I want that field to be searchable via full text search but only for people who actually can see it.
Now I query Solr for ‘stupid’ (that is query string) and it returns me N documents. When returning that to end-user I’ll remove the ‘Manager’s feedback’ field because end-user is not the manager of given people – but just presence of the document in resultset is already the evidence of ‘stupid’ guys …
The question is – what is workable approach to handle that use-case? Is it possible to plug into Solr/ES with home-grown security filter for outputs?
Caveats:
filtering out only fields do not work because of above mentioned scenario
filtering out complete documents will not work because of
search engine does not tell which fields matched – therefore no way to manually filter resultset by field http://elasticsearch-users.115913.n3.nabble.com/Best-way-to-return-which-field-matched-td2713071.html
even this does work, removing documents from result set will spoil down facets (e.g. number of matches by department) returned by the engine – I’ll have to either recalculate facets manually or they will not match to manually filtered records and will reveal what I actually do not want to show to end users
In Solr you can create multiValued fields. In your case you can use it to store de-normalized values of organization structure.
In described scenario you will create multi valued field ouId (Organization Unit Id) and store employee's ouId and all parent ouIds. In other words you will save allowed ouIds into this field.
In search scenario you will use FilterQuery - fq parameter filtering by ouId of manager.
Example:
..&fq=ouId:12
where 12 is organization unit id of selected manager.
Maybe this is helpful for you https://github.com/salyh/elasticsearch-security-plugin It adds Document level security to elasticsearch.
"Currently for user based authentication and authorization Kerberos/SPNEGO and NTLM are supported through 3rd party library waffle (only on windows servers). For UNIX servers Kerberos/SPNEGO is supported through tomcat build in SPNEGO Valve (Works with any Kerberos implementation. For authorization either Active Directory and generic LDAP is supported). PKI/SSL client certificate authentication is also supported (CLIENT-CERT method). SSL/TLS is also supported without client authentication.
You can use this plugin also without Kerberos/NTLM/PKI but then only host based authentication is available.
As of now two security modules are implemented:
Actionpathfilter: Restrict actions against Elasticsearch on a coarse-grained level like who is allowed to to READ, WRITE or even ADMIN rest api calls
Document level security (dls): Restrict actions on document level like who is allowed to query for which fields within a document"

Resources