%META:TOPICPARENT{name="ValWhatWhyHow"}%
---+ Virtuoso Authentication Layer - ACL System Quickstart Guide
*See also*: [[ValWhatWhyHow][Virtuoso Authentication Layer - What, Why and How]]
These pages provide an overview of VAL for system administrators, with a focus on how to configure the VAL ACL system.
Developers wanting more in-depth coverage of how VAL integrates into Virtuoso, or how to integrate VAL into their own Virtuoso applications, should refer to the [[http://docs.openlinksw.com/val/index.html][VAL API documentation]].
---
%TOC%
---
---++ VAL In a Nutshell
Virtuoso provides numerous options for access control, some specific to particular realms. For instance:
* [[http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtTipsAndTricksGuideSPARQLEndpoints][Protected SPARQL endpoints]] are associated with specific authentication methods, e.g., /sparql-auth
, /sparql-oauth
, /sparql-webid
.
* [[http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtTipsAndTricksGuideSPARQLAssignRoleToUser][SPARQL roles]] restrict the types of SPARQL commands a database user may perform.
* [[http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtRDFGraphsSecurity][Graph level security]] allows the setting of permission bit masks to set the read/write (and sponge) permissions on specific RDF graphs to control public or specific user access.
However, our recommended and preferred generic access control mechanism for Virtuoso is VAL, the Virtuoso Authentication Layer. VAL provides a *generic ACL layer* which can be used to protect many Virtuoso resources, including SPARQL endpoints or graphs,
GRANT
rights.
A resource is any entity identified by a URI. This could be a DAV folder, a SPARQL endpoint, or a Sponger extractor cartridge, among other things. VAL manages and reports the permissions on the resource, but the application logic supporting the resource access is responsible for enforcing those permissions.
Rules and groups are stored in private named graphs within the triple store, as are resource ownership details. The rules may grant READ
, WRITE
, or SPONGE
permission on a resource, or the ability to GRANT
these permissions. Custom permissions can also be defined.
---+++Service IDs
VAL enforces data access policies on the basis of https://plus.google.com/+JohnSmith
oplacl:hasRealm
property. Each application realm defines a distinct set of rules and groups. The default realm is oplacl:DefaultRealm
oplacl:DefaultRealm
oplacl:Sql
acl:agent
property.
Below is a basic example of an ACL rule granting READ
access to a user authenticating through their Facebook account, <http://www.facebook.com/jsmith>
, to resource <http://www.fusepool.eu/p3/assets>
:
<http://HOST/acl/graph/rules/http%3A%2F%2Fwww.openlinksw.com%2Fontology%2Facl%23DefaultRealm>
oplacl:hasAccessMode oplacl:Read, oplacl:Write, oplacl:Sponge
.
---+++Groups
In addition to simple ACLs granting access to an individual, rules can be written to grant access to a simple group, a conditional group, or everyone (i.e., make a resource public).
Groups are usually stored in graph <http://HOST/acl/graph/groups/http%3A%2F%2Fwww.openlinksw.com%2Fontology%2Facl%23DefaultRealm>
.
Simple groups are lists of members. Conditional groups remove the need to enumerate every member, and instead define a set of conditions. These conditions typically test attributes of the X.509 client certificate provided by the authenticated user's ASK
query. Every authenticated person matching these conditions is seen as part of the group. VAL's Conditional Groups feature provides the basis for [[http://csrc.nist.gov/projects/abac/][Attribute Based Access Control (ABAC)]].
Example: Private graph access limited to a conditional group
acl:agentClass foaf:Agent
.
---+++Scopes
Each ACL rule has a scope property, for instance: oplacl:hasScope oplacl:PrivateGraphs
<http://www.openlinksw.com/ontology/acl#Query>
<http://www.openlinksw.com/ontology/acl#PrivateGraphs>
<urn:virtuoso:val:scopes:sponger:describe>
* contains all ACL rules controlling access to the /describe entity description service supporting follow-your-nose exploration and inferencing.
* /about service scope: <urn:virtuoso:val:scopes:sponger:about>
* contains all ACL rules controlling access to the /about endpoint providing a basic entity description service.
* Sponger cartridges scope: <http://www.openlinksw.com/ontology/acl#SpongerCartridges>
acl:accessTo
property. Graphs, both public and private, are identified by their URL, as are individual Sponger cartridges. e.g. The Virtuoso CSV extractor cartridge is identified by URL <http://sponger-hostname/ext/csv>
<urn:virtuoso:access:sponger:describe>
and <urn:virtuoso:access:sponger:about>
. The /sparql endpoint resource URI is <urn:virtuoso:access:sparql>
, and is used in conjunction with scope oplacl:Query.
The diagrams below illustrate how VAL is capable of supporting layered fine-grained access control. In this illustration, different access policies could be enforced depending on the route taken to access the Sponger. Also shown is how disabling certain scopes bypasses ACL rule checking by these scopes. The second figure shows the effect of disabling scopes <urn:virtuoso:val:scopes:sponger:about>
, oplacl:Query
and oplacl:SpongerCartridges
.
<urn:virtuoso:access:sql>
to allow users to perform SQL commands in addition to SPARQL, and to enforce request rate and result size limits on SQL clients. <urn:virtuoso:access:sql>
is used in conjunction with scope oplacl:Query
within the application realm oplacl:SqlRealm
.
---+++Permission Reporting, Not Enforcement
VAL provides a framework for creating and managing access control lists. Its core function is to report a user's permissions when they attempt to access a resource. It does not enforce the reported permissions. The act of enforcing them falls to the application using VAL. The application must be written to enforce the reported permissions as necessary. The user interfaces for Virtuoso's /sparql, /describe and /about service endpoints provide examples of how to use the VAL API to determine and act on a user's permissions.
---+++VAL vs RDF Graph Security
In cases where the resource being protected by a VAL rule is an RDF graph, the permissions granted by the VAL rule must be consistent with the base permissions granted by the RDF graph security. Virtuoso's [[http://docs.openlinksw.com/virtuoso/rdfgraphsecurity.html][RDF Graphs Security]] system is the base layer upon which VAL-based graph access is layered. Consistency in this context means that if a VAL rule grants a user acl:Read permission on a graph, read access will be denied if the user does not have Read permission in the underlying RDF graph security system. Similar precedence rules apply to the acl:Sponge and acl:Write permissions. The graph security system will always take precedence. VAL can only restrict the base permissions, not broaden them. Consequently, the base graph permissions for a particular SQL user must be set to be at least as permissive as the permissions VAL rules seek to grant that same SQL user. SQL user in this context is the SQL account used by the service accessing the resource, which is distinct from the accessing user's acl:accessTo <urn:virtuoso:access:sponger:describe>
and does not specify access to a specific graph. However if unauthenticated users are to be able to view public graphs the SQL user 'nobody', corresponding to unauthenticated VAL users, must have Read permission on public graphs in the RDF graph security system. The appropriate base RDF graph permissions can be set using /sparql
endpoints as well as any other application which tries to access those named graphs directly or through SPARQL queries.
For more information, see:
* [[VAL_SparqlACLs][ACL rules applicable to named graphs and SPARQL in general]]
---+++ Protecting a Web Service with the VAL Authentication UI
VAL provides an easy means by which to add authentication and ACL support to new or existing VSP-based applications. It provides authentication and log-out pages to support simple log-in and log-out links. The authentication page can be embedded in a custom log-in page, and supports customization of certain authentication dialog attributes such as the displayed error message and requested service label. It can be configured as a default redirect target for HTTP 401 (Unauthorized) errors to enforce authentication when different authentication is required to access a requested resource, or has not yet been provided.
For more information, see:
* [[VAL_AuthenticateVspTutorial][VAL VSP Authentication Tutorial]]
---++ Customizing VAL
Limited customization of VAL is possible. Aspects of VAL which can be customized include:
* the logos displayed on the VAL authentication dialog
* whether the authentication dialog is displayed automatically when access is denied
* the named graphs used to store rules, groups, and restrictions
VAL also supports the setting of a custom page footer for any VSP page.
For more information, see:
* [[VAL_ValCustomization][VAL Customization]]
---++ Additional VAL Tutorials
You can find more VAL tutorials here:
* [[VAL_HttpRestrictions][ACL Restrictions for the Virtuoso HTTP engine]]
* [[VAL_SqlACLs][SQL ACLs - Control SPARQL Access in SQL Connections (ODBC)]]
* [[VAL_CuriACLs][ACLs for Access to the Compressed URI Support]]
* [[VAL_OAuthACLs][VAL OAuth Application ACLs]]