App Security

App Security is a new way to handle security for Apps. Instead of using classic ACL-based security by Exalead CloudView, Apps administrators are able to define security rules based on user logins and security tokens and Exalead CloudView queries. Both security types can coexist: ACLs and App Security rules are applied in this case.

This page discusses:

Instead of relying on document ACLs, for determining if a given user has the right to see a given document, App Security lets administrators define security rules based on user logins and security tokens, and Exalead CloudView queries.

It can also restrict access to attributes (metas), facets, prefix handlers, and app features: this is the Level of Detail configuration.

This also enables deployments where ACLs are hard to fetch (for example, SmarTeam) or nonindexable (for example, some ENOVIA instances).

How It Works?

When App Security is enabled, OnePart works like this:

  • A user only sees documents that they are allowed to see according to the rules defined in the App Security configuration.
  • These rules are defined by a set of Exalead CloudView queries.
  • For every query that the user types, the App Security module appends the user query AND the query resulting form the applicative security rules.
  • If a user is part of multiple groups, all the restricting queries are joined with a OR.
    • example of the resulting index query: userQuery AND (queryFromRule1 OR queryFromRule2 etc.)
  • The Level of Detail modifies the search logic at query time to remove any attributes (metas), facets, or prefix handlers the user is not supposed to see.
  • If a user is part of multiple groups and has multiple levels of details, all the levels of detail are applied, hence all the attributes (metas) defined in each level of detail is removed.

App Security Configuration

App Security configuration is defined by the following:

  • a Boolean enabled: Set to true if OnePart is to use App Security and false to keep using classic Exalead CloudView security.
  • a Boolean keepCloudviewSecurity: by default, it is disabled. Therefore, the Exalead CloudView ACL-based security is ignored. If set to true, both the App Security and ACL-based security are applied.
  • a string defaultQuery: if App Security is enabled, and a user signs in and does not belong to any group.
  • example of the resulting index query: userQuery AND defaultQuery
  • a string defaultLevelOfDetail, ID of the level of detail in the configuration to apply to users that do not belong to any group.
  • a list of groups
  • a list of levels of detail

What Are Groups?

An App Security group is made of:

  • a name that is its id
  • a list of logins or a list of security tokens - these define the users in the group
  • a query that is the restricting query applied to all users of this group
  • a levelOfDetail that is the Id of the level of detail to apply to users of that group

A level of detail is made of directives that can only be DenyDirectives in the current version.

What Are Directives?

A directive has a document matching condition that must be a MEL expression. In this case, the directive is only applied on documents that match the given expression. See Example 5. A MEL expression must start with ${ and end with }. For more information on MEL syntax, refer to the Exalead CloudView documentation.

A directive has a list of:

  • Attributes (metas)
  • Facet
  • PrefixHandler

How to Use It?

App Security is based on a configuration defined in the DATADIR\config\AppSecurity.xml file.

  • You do not need to define any groups for the App Security to work (but in this case, only the default query is applied).
  • An empty level of detail (no directives) means users with this level of detail can have access to anything in a document.
  • You can also use custom MEL functions in your document matching conditions, provided they are properly deployed in your Mashup Builder App.

To Enable App Security

  1. Edit the DATADIR\config\AppSecurity.xml file.
  2. Change the enabled property to true.
  3. Edit the configuration. See examples below.
    1. You do not need to define groups for the App Security to work (but in this case, only the default query is applied).
  4. In the Administration Console at http://<HOSTNAME>:<BASEPORT+1>/admin, click CTRL + Apply to force and apply configuration.
  5. (IMPORTANT) Restart the searchserver.
  6. This step needs to be done each time the configuration is modified.

Limitations

Even when App Security is enabled and can hide some results from some users, this filtering is not applied to suggestions.

  • In practice, John can have V5371012.CATPart suggested to him even though he is prevented from seeing it in the search results by applicative security. However, if he selects this suggest query, he indeed gets no results. Should you need to work around this behavior, you must disable the Suggest feature: see the OnePart Installation Guide: Troubleshooting.
  • Queries are not optimized: the original queries are executed entirely before the restricting queries are applied.
  • Only simple declarative logic can work; you cannot declare "any user NOT in a group" except by the default query mechanism.
  • If you want a user "DOMAIN\login" to be found by the App Security, you must declare the login as such in the configuration. For example, <Login login="login"/> does not match "DOMAIN\login".
  • Deny directives on facets are not applied when a document condition is matched.
  • For Level of Detail:
    • Only the download feature can be removed for OnePart using the attribute onepart_feature_download
    • In the Table and Compare view, even if a user does not have access to a meta and it is mandatory, the column/line associated appears (but is empty).

Example 1

By default, only the admin can see all documents and users see nothing.

<AppSecurityConfiguration enabled="true" defaultQuery="NOT #all" 
defaultLevelOfDetail="0" xmlns="exa:com.exalead.apps.appsec" 
keepCloudviewSecurity="false">
        <Group name="admin" query="#all" levelOfDetail="0">
                <Login login="app-admin"/>
        </Group>
		<LevelsOfDetail>
    	    <LevelOfDetail id="0" name="Allow all"/>
	    </LevelsOfDetail>
 </AppSecurityConfiguration>

Example 2

By default, users see all documents but cannot download them; only the admin user can.

<AppSecurityConfiguration enabled="true" defaultQuery="#all" 
defaultLevelOfDetail="1" xmlns="exa:com.exalead.apps.appsec" 
keepCloudviewSecurity="false">
		<Groups>
	        <Group name="admin" query="#all" levelOfDetail="0">
                <Login login="app-admin"/>
    	    </Group>
		</Groups>
		<LevelsOfDetail>
    	    <LevelOfDetail id="0" name="Allow all"/>
			<LevelOfDetail id="1" name="Download deny">
				<DenyDirective>
					<Attribute id="onepart_feature_download"/>
				</DenyDirective>
			</LevelOfDetail>
	    </LevelsOfDetail>
</AppSecurityConfiguration>

Example 3

This is an example about multiple users and groups.

By default, users see.txt files, user1 and user2 can see everything, and users in the group onepart can see all documents from project onepart without seeing the project attribute and facet:

<AppSecurityConfiguration enabled="true" 
defaultQuery="file_extension:txt" 
defaultLevelOfDetail="0" xmlns="exa:com.exalead.apps.appsec" 
keepCloudviewSecurity="false">
		<Groups>
	      <Group name="all" query="#all" levelOfDetail="0">
                <Login login="user1"/>
                <Login login="user2"/>
    	  </Group>
			<Group name="onepart" query="project:onepart" levelOfDetail="1">
				<SecurityToken token="group:onepart"/>
			</Group>
		</Groups>
		<LevelsOfDetail>
    	    <LevelOfDetail id="0" name="Allow all"/>
			<LevelOfDetail id="1" name="Project deny">
				<DenyDirective>
				   <Attribute id="onepart_project"/>
            	    	<Facet id="onepart_project"/>
				</DenyDirective>
			</LevelOfDetail>
	    </LevelsOfDetail>
</AppSecurityConfiguration>

Example 4

All users can see everything, except users from the group testers, which cannot see documents tagged as confidential and see the authors on documents or even search by author:

<AppSecurityConfiguration enabled="true" defaultQuery="#all" 
defaultLevelOfDetail="0" xmlns="exa:com.exalead.apps.appsec" 
keepCloudviewSecurity="false">
     <Group name="testers" query="NOT tag:confidential" levelOfDetail="1">
		<SecurityToken token="group:testers"/>
     </Group>
		<LevelsOfDetail>
			<LevelOfDetail id="0" name="Allow all"/>
			<LevelOfDetail id="1" name="deny author">
		<DenyDirective>
	            <Attribute id="onepart_author"/>
            	<Attribute id="onepart_best_author"/>
            	<Facet id="onepart_best_author"/>
        	    <PrefixHandler id="onepart_author"/>
    	        <PrefixHandler id="onepart_best_author"/>
	    </DenyDirective>
			</LevelOfDetail/>
	 </LevelsOfDetail>
</AppSecurityConfiguration>

Example 5

The user1 can download any document, except a SolidWorks document. For a document matching condition.user1 can see all documents, but cannot download documents whose family contains ‘solidworks’.

<AppSecurityConfiguration enabled="true" defaultQuery="#all" 
defaultLevelOfDetail="0" xmlns="exa:com.exalead.apps.appsec" 
keepCloudviewSecurity="false">
     <Group name="user1" query="#all" levelOfDetail="1">
		 <Login login="user1"/>
     </Group>
  <LevelsOfDetail>
 	<LevelOfDetail id="0" name="Allow all"/>
	 <LevelOfDetail id="1" name="no SW download">
          <DenyDirective documentMatchingCondition=
		"${str:contains(entry.metas['opfamily]','solidworks')}">
               <Attribute id="onepart_feature_download"/>
          </DenyDirective>
		 </LevelOfDetail/>
	 </LevelsOfDetail>
</AppSecurityConfiguration>

Example 6

This simple example uses prefix handlers in your queries with spaces between the terms. For example, when your restricting query uses a prefix handler that matches on a phrase with spaces in it. Here, user1 cannot see documents with project Very confidential.

<AppSecurityConfiguration enabled="true" defaultQuery="#all" 
defaultLevelOfDetail="0" xmlns="exa:com.exalead.apps.appsec" 
keepCloudviewSecurity="false">
    <Group name="interns" query="NOT project:&quot;Very confidential&quot;">
	  <Login login="user1"/>
    </Group>
        <LevelsOfDetail>
 		<LevelOfDetail id="0" name="Allow all"/>
	 </LevelsOfDetail>
</AppSecurityConfiguration>