Contents


Chapter 14
Setting Up Security

Introduction

Lasso Security Model

Lasso Groups and Users

Site Administrator

AnyUser Group and Anonymous Users

Figure 1: Group Detail

Custom Groups and Users

Figure 2: Custom Groups

User Authentication

How Lasso Checks User Security

How Lasso checks security when a Lasso action is performed:

Security Error Reporting

Setting Up Groups

Figure 3: Groups List Page

Adding a Custom Group

Figure 4: Add Group Panel

To add a new group:

Updating Group Properties

To update details for a selected group:

Setting Group Permissions

Setting Up Users

Figure 5: Users List Page

User Listing

Adding Custom Users

Figure 6: Add User Panel

To add a new user:

Updating Custom Users

Group Administrators

Group Administration LassoApp

Figure 7: Group Administration LassoApp

To access the Group Administration LassoApp:

Figure 8: Hosts Page

Setting Group Host Permissions

How Lasso Checks Data Host Security Settings

Database Permissions

Figure 9: Databases Page

Setting Group Database Permissions

How Lasso Checks Database Security Settings

Table Permissions

Figure 10: Tables Page

Setting Group Table Permissions

How Lasso Checks Table Security Settings

Field Permissions

How Lasso checks field permissions:

Tag Permissions

Figure 11: Tags Page

Setting Tag Category Permissions

Setting Tag Permissions

Tag Dependencies

How Lasso Checks Tag Security Settings

File Permissions

Figure 12: Files Page

Viewing File Permissions

Updating File Permissions

File Uploading

How File Permissions are Checked

Web Server Security

Record-Level Security

To establish record-level security:

Security Tips

General

Databases

User Authentication

Testing Solutions



Chapter 14
Setting Up Security

[p]This chapter describes the methodology of securing Lasso-based Web sites using Lasso Security and Site Administration, and is divided into the following sections. [/p]

Introduction

[p]This chapter describes the tools that Lasso Professional Server provides to allow developers to build secure Web sites. This chapter documents the concepts behind Lasso’s security, and strategies for setting up security on servers with various purposes. This chapter also documents the Setup > Security section of Site Administration, which is the primary interface for configuring Lasso security. [/p]

Lasso Security Model

[p]One of the most important features in Lasso Professional Server is the inclusion of a very robust security model that can be used to secure all elements of a Lasso solution. Lasso Security interacts with Web server applications, database applications, Web clients, operating systems, and other CGI products. Lasso provides tools to secure access to each of the different applications that Lasso uses, and also tools to control usage within Lasso. [/p]

[p]Lasso Security is comprehensive, and can be used to secure and protect many Web server operations from undesired users. These operations include but are not limited to the following: [/p]

Lasso Groups and Users

[p]At the core of Lasso Security are Lasso groups and users. Groups represent sets of permissions for various operations, and Users represent usernames and passwords (or lack thereof) which can be used to access those permissions. [/p]

[p]The power of Lasso Security lies not only in what permissions can be set for a group, but also in how those permissions can be assigned to users. Group permissions can be shared by one or more users, and users may be assigned to one or more groups (how Lasso determines what permissions to use for a user assigned to multiple groups is described later). This multi-dimensional security model allows the most advanced authentication systems to be created for those that desire them. [/p]

[p]In Lasso Security, there are three classes of groups and users, which are described below. Understanding these classes and what they can do is the first step in using Lasso Security with maximum power and ease. [/p]

Site Administrator

[p]The Lasso Site Administrator has full control over all Lasso-configurable operations by default. Only the Lasso site administrator or server administrator may access Site Administration. The site administrator permissions account is a pre-configured group in Lasso Security that consists of only one username and password set. Site administrator permissions cannot be shared by other users. [/p]

[p]Whenever the site administrator is logged in via a Web browser, he or she will instantly have permission to execute all Lasso code and will pass all security checks without being prompted for authentication again. [/p]

[p]When using Lasso for the first time, it is important to understand that the end-users who will be accessing Lasso solutions will not have the same permissions as the site administrator by default, therefore some security settings such as database permissions will have to be set before other users may use them. [/p]

AnyUser Group and Anonymous Users

[p]Only one configurable group is predefined in Lasso Professional Server, which is the [code]AnyUser[/code] group. If an end user of a Lasso Solution is not logged in with a username and password that is defined in Lasso Security, then he or she will inherit the permissions of this group by default. These users are referred to as [code]Anonymous[/code] users. [/p]

Figure 1: Group Detail

[p]When Lasso Professional Server is installed, it is secure by default. This means that the [code]AnyUser [/code]group has no database or file permissions assigned to it in Site Administration by default. When creating a Lasso solution that does not require authentication, explicit permissions must be set for the [code]AnyUser[/code] group beforehand. How to set permissions for the [code]AnyUser [/code]group is described in this chapter. [/p]

Custom Groups and Users

[p]Custom groups may be created by the site administrator if password protection is desired for certain sets of permissions. [/p]

[p]A custom group may be created with a defined permissions, and then defined users in Lasso Security (with usernames and passwords) may be added to the custom group. Defined users in Lasso Security may also be added to more than one custom group. [/p]

Figure 2: Custom Groups

[p]Much of the security power in Lasso Professional Server comes from creating custom groups and users, and there are many different ways to use groups in Lasso Security to assign permissions to users. Several custom groups with different permissions can be combined to meet the unique needs of any Web site. For example, separate groups could be created for each database used by Lasso, but a single group could define access to file tags across all users of a Web site. [/p]

[p]Lasso Professional Server also features the ability to designate group administrators among custom groups. A group administrator is a user in Lasso Security defined by the site administrator who has permissions to make changes to user accounts that belong to a specific group. [/p]

User Authentication

[p]All Lasso tags and actions are executed with the permissions of a specific user. Since permissions are only granted to groups, the permissions for a specific user are defined by the group(s) to which they belong. When a tag is executed, the permissions of all the groups to which the user belongs are checked in alphabetical order by group name. [/p]

[p]There is no one-to-one correspondence between users and visitors. It is possible for many visitors to authenticate as the same user. For example, all the members of a workgroup may share a common username and password. In the extreme, all unauthenticated visitors are treated as a single [code]Anonymous [/code]user and have the permissions of the [code]AnyUser [/code]group. [/p]

[p]A single visitor may execute code using the permissions of many users. They will be prompted for a username and password if they do not have permission to access a resource based on the current user information they have supplied. If they enter the authentication information for a different user, then they become that user for subsequent pages. [/p]

[p]Lasso primarily relies on the Web authentication routines built into every Web browser in order to authenticate site administrators and other Lasso users. However, Lasso permissions may also be programmatically specified using the [code][Inline] … [/Inline][/code] tag in Lasso. [/p]

[p]Usernames and passwords can be specified within [code][Inline] … [/Inline][/code] tags so that the contents of the container tags are executed with the permissions of a specified user. Most of a Lasso page will be executed with the permissions of the user defined by the current visitor, but portions of the Lasso page can be executed with the permissions of specific users. [/p]

[p]There are several ways to specify what user’s permissions should be used to execute a Lasso page or section of Lasso code depending on whether or not the current visitor is authenticated, or if a specific username and password are coded into the Lasso page. [/p]

How Lasso Checks User Security

[p]All of Lasso Security is tied to the action of executing Lasso tags. Lasso performs a series of checks each time a tag is executed in order to confirm that the current user has permission to execute the tag, and the current user has permission to access the resources that the tag requires in order to perform its task. [/p]

[p]The process that Lasso uses to check security settings each time a tag is executed is shown below. Some of the steps are actually performed when a Lasso page is first accessed, or when an [code][Inline] … [/Inline][/code] is entered and information is cached for fast access, but conceptually the steps are performed in this order. [/p]

[p]When a user belongs to more than one group in Lasso Security, groups are always checked in alphabetical order with the exception of the [code]AnyUser [/code]group, which is always checked last. Groups with names that start with letters earlier in the alphabet have higher priority than groups with names that start with letters later in the alphabet. If a specific ordering of groups is needed, then a prefix can be used to ensure that the group permissions are checked in the desired order. [/p]

How Lasso checks security when a Lasso action is performed:

  1. The list of available Lasso tags is checked. Any tags which are not enabled (e.g. tags marked [code]Disabled[/code]) are not recognized as part of Lasso, and will generate a syntax error (rather than a security violation).
  1. The current username and password are identified. If the current site visitor has authenticated through their Web client, then the username and password they specified are used. If [code]-Username[/code] and [code]-Password[/code] are specified within the Lasso code, then the values of those tags are used. Otherwise, the user is [code]Anonymous[/code].
  1. The current user is looked up in Lasso Security. If no matching username and password can be found, then the user is treated as [code]Anonymous[/code]. Note that Lasso will execute code for a visitor who has specified any unknown username and password as [code]Anonymous[/code].
  1. The set of groups which the current user belongs to is identified. The permissions for each group will be checked in alphabetical order, followed by the [code]AnyUser [/code]group.
  1. The permissions for each group are checked in alphabetical order. If an [code]Allow [/code]permission is found for the tag, then its use is allowed and no further checking is performed. If a [code]Deny [/code]permission is found for the tag, then its use is denied, a security violation is generated, and no further checking is performed. If an[code] Ignore[/code] permission is found, then the use of the tag is not allowed for that group, but Lasso will continue to check that tag’s permissions for the current user in other groups. By default, all substitution tags in [code]AnyUser [/code]have [code]Allow [/code]permission, while all action tags (e.g. [code]-Search[/code], [code]-Add[/code], [code]-Update[/code], [code]-Delete[/code], -[code]SQL[/code]) have [code]Ignore[/code] permission.
  1. If the tag references a database, table, or fields, then the permissions specific to those entities are checked. See the sections on Database Permissions, Table Permissions, and Field Permissions for more details.
  1. If the tag is a [code][File_…][/code] tag, then the permissions specific to the [code][File_…] [/code]tags are checked. Site users and the site administrator can only use the file tags within the paths defined in Server Administration. See the File Permissions section for more information.
  1. If a security violation is generated, then the site visitor will be presented with a browser-specific authentication dialog. After the visitor has entered a new username and password, the entire series of steps are performed again checking against a new user.

Security Error Reporting

[p]Unless custom error handling is coded into your [code].lasso[/code] or [code].lassoapp[/code] files, the Lasso Professional default error page will be shown in the event of a security error while processing a file. The level of detail shown in the default page can be configured using the Setup > Site > Syntax section of Site Administration. [/p]

[note][b]Important: [/b]A configured error reporting of [code]Full [/code]in the Setup > Site > Syntax section of Site Administration will reveal Lasso source code and other critical information when an error occurs. While this is useful for debugging, it is strongly recommended that Lasso Professional servers running in a production environment be set with a error reporting level of [code]Minimal[/code] or [code]None[/code] for maximum security. [/note]

[p]To learn more about error reporting in Lasso Professional and how to code custom error handling using Lasso, see the Error Control chapter in the Lasso 8.5 Language Guide. [/p]

Setting Up Groups

[p]Groups in Lasso Professional Server allow security settings to be set for groups of users. Users can log in to a Lasso-driven Web site with assigned group security values, or in the absence of a recognized username and password are automatically assigned to the [code]AnyUser[/code] group by default. [/p]

[p]The Setup > Security > Groups page in Site Administration allows the administrator to add, view, enable, disable, and configure groups in Site Administration. [/p]

Figure 3: Groups List Page

[p]The [code]Group Listing[/code] panel shows a list of all the groups defined in Lasso. [code]Prev[/code] and [code]Next [/code]buttons are shown if more than 10 groups exist. Selecting [code]Enable All [/code]will enable all groups shown, while selecting[code] Disable All[/code] will disable all groups shown. Selecting [code]Refresh[/code] will refresh the[code] Groups[/code] page with the most recently updated information. [/p]

[p]The default group is [code]AnyUser[/code] with one member [code]Anonymous[/code]. By default, any permissions granted to this group will be granted to all visitors to the Web site. [/p]

Adding a Custom Group

[p]Selecting the [code]Add Group[/code] button shows the [code]Add Group[/code] panel to the right. The [code]Add Group[/code] panel allows the administrator to add a new group to Site Administration. [/p]

Figure 4: Add Group Panel

To add a new group:

  1. Enter the name of the group to be added in the [code]Name[/code] field.
  1. Select [code]Enabled [/code]or [code]Disabled[/code] from the [code]Status [/code]pull-down menu to enable or disable the group in Lasso Professional Server.
  1. Select [code]Add Group[/code].
[p]After selecting the [code]Add Group[/code] button, one is taken to the [code]Groups[/code] page with the newly added group selected for additional modifications. [/p]

Updating Group Properties

[p]Selecting a group name in the [code]Groups Listing [/code]panel will show its details in the [code]Group Detail [/code]panel, which appears to the right. Here, the administrator can update the selected group name and status by selecting the [code]Update [/code]button, or delete the group by selecting the [code]Delete [/code]button. The [code]AnyUser [/code]group is separated from all created groups, and appears at the top of the [code]Groups Listing[/code] panel. [/p]

To update details for a selected group:

  1. Edit the name of the selected group in the [code]Name [/code]field.
  1. Select [code]Enabled[/code] or [code]Disabled [/code]from the [code]Status[/code] pull-down menu to enable or disable the group.
  1. Select [code]Update[/code].
[p]The [code]List Users [/code]link takes one to the [code]Users [/code]page with the current group selected. The date and time of the last update is always shown in the lower right corner of the [code]Group Detail[/code] panel. [/p]

[note][b]AnyUser [/b][b]Note[/b]: The [code]AnyUser[/code] group cannot be deleted as it is required by Lasso Professional Server. For this reason, the [code]Update[/code] and [code]Delete[/code] buttons will not be shown in the [code]Group Detail[/code] panel for the [code]AnyUser[/code] group. [/note]

Setting Group Permissions

[p]Group permissions can be set by selecting the [code]Hosts[/code], [code]Databases[/code], [code]Tables[/code], [code]Tags[/code], or [code]Files[/code] buttons in the [code]Group Detail [/code]panel. Doing so will take one to the [code]Hosts[/code], [code]Databases[/code], [code]Tables[/code], [code]Tags[/code], or [code]Files [/code]pages where the corresponding permissions can be set, as discussed later in this chapter. [/p]

[p]For most Lasso Solutions, setting database and table permissions for the [code]AnyUser[/code] group is typically the first task. See the Data Host Permissions, Database Permissions, and Table Permissions sections for more information on these permissions. [/p]

Setting Up Users

[p]Individual user accounts allow different users to access Lasso Professional Server Web solutions with different levels of security. While access and tag-level security settings are set in the [code]Groups [/code]section, the [code]Users[/code] section allows the administrator to set usernames and passwords, set groups to which a user belongs, and to designate specific users as administrators for specific groups. [/p]

[p]The Setup > Security > Users page in Site Administration allows the administrator to add, view, and configure users. [/p]

[note][b]Important: [/b]No user configuration is required for [code]Anonymous[/code] users, which are configured by default through the [code]AnyUser[/code] group. The [code]Users[/code] page is used only for creating custom username and password accounts, and designating custom group administrators. [/note]

Figure 5: Users List Page

User Listing

[p]The [code]User Listing[/code] panel lists all currently defined users. Users from a particular group as well as users who do not belong to any groups can be shown. The current group may be changed by selecting a group from the pull-down menu. In addition to the groups defined in the Setup > Security > Groups section of Site Administration, the administrator may choose one of the following user display options from the pull-down menu. [/p]

[p]Selecting the username shows details of the user in the [code]User Detail[/code] panel, which appears to the right. All users shown can be enabled or disabled by selecting [code]Enable All[/code] or [code]Disable All[/code]. Selecting [code]Add User… [/code]takes one to the [code]Add User[/code] page. [/p]

Adding Custom Users

[p]Selecting the [code]Add User[/code] button in the [code]User Listing[/code] panel shows the [code]User Detail[/code] panel to the right. The [code]Add User[/code] page allows the administrator to create new users in a specified group or groups. [/p]

Figure 6: Add User Panel

To add a new user:

  1. Enter the username of the user to be added in the [code]Name[/code] field.
  1. Enter the password for the selected user in the [code]Password[/code] field.
  1. Select any number of groups from the [code]Groups[/code] field to which the user is to be assigned.
  1. Select any number of groups from the [code]Administrator[/code] field for which the selected user is to be granted administrator privileges. The purpose of a group administrator is to add and remove other users to and from the group the user has group administrator privileges for. There can be as many group administrators as needed. For more information on group administrators, see the following Group Administrators section.
  1. Select the [code]Add User[/code] button.
[p]The [code]Search[/code] page allows administrators to search for users by group, name, status, or administrator. [/p]

Updating Custom Users

[p]Selecting a user in the [code]User Listing[/code] panel will show its details in the [code]User Detail[/code] panel, which appears to the right. Here, the administrator can update or delete the selected user’s details by selecting the [code]Update[/code] button, or delete the user by selecting the [code]Delete[/code] button. [/p]

[p]To update details for a selected user: [/p]

  1. Edit the username of the selected user in the [code]Name[/code] field.
  1. Edit the password for the selected user in the [code]Password[/code] field. The password will be hidden, but can be changed by deleting the contents of the [code]Password [/code]field, and entering a new password.
  1. Select [code]Enabled[/code] or [code]Disabled[/code] from the [code]Status[/code] pull-down menu to enable or disable the user.
  2. [note][b]Note: [/b]Disabled users are treated as anonymous users, and are assigned permissions from the [code]AnyUser[/code] group when accessing Lasso pages or LassoApps. [/note]
  1. Select any number of groups from the[code] Groups [/code]field to which the user is to be assigned.
  1. Select any number of groups from the [code]Administrator[/code] field for which the selected user is to be granted administrator privileges. The purpose of a group administrator is to add and remove other users to and from the group the user has group administrator privileges for. There can be as many group administrators per group as needed. For more information on group administrators, see the following Group Administration LassoApp section.
  1. Select the [code]Update[/code] button.
[note][b]Note: [/b]The [code]Anonymous[/code] user cannot be modified or deleted as it is required by Lasso Professional Server. For this reason, the [code]Delete[/code] button will not be displayed in the [code]User Detail [/code]field for the [code]Anonymous[/code] user. [/note]

Group Administrators

[p]Users can be granted the privilege to be a group administrator for one or more groups. Any user which is defined as a group administrator can add users to a group using the [code]GroupAdmin.LassoApp[/code] file, or using the [code][Admin_…][/code] tags in Lasso. Only a group administrator or the site administrator can add users to a group, and a group can have as many group administrators as needed. [/p]

Group Administration LassoApp

[p]The group administrator is able to add and remove users from a group via the [code]GroupAdmin.LassoApp[/code] file, which is a LassoApp served on-demand from the Lasso Professional Server application folder. This LassoApp only contains the features of the Setup > Security > Users section of Site Administration. When accessed, the [code]GroupAdmin.LassoApp[/code] file prompts one for a group administrator username and password, as designated in the Setup > Users > Admin page in Site Administration. Within the Group Administration LassoApp, group administrators are only able to access the group to which they have been assigned. [/p]

Figure 7: Group Administration LassoApp

To access the Group Administration LassoApp:

[p]In a Web browser, visit [code]http://www.example.com/Lasso/GroupAdmin.LassoApp[/code]. Replace [code]www.example.com[/code] with your domain name, IP address, or [code]127.0.0.1[/code] if on a local machine. If an error is displayed, make sure Lasso Service is running. [/p]

[p]Data Host Permissions [/p]

[p]The Setup > Security > Hosts page in Site Administration allows the administrator to define all host-level permissions for any specific group. [/p]

Figure 8: Hosts Page

Setting Group Host Permissions

[p]Selecting a host in the [code]Host Listing[/code] panel shows its permissions settings in the [code]Host Detail[/code] panel to the right. The following describes the database security permissions that can be set for the selected group: [/p]

  1. [note][b]Warning: [/b]Due to the large array of things that permission to execute SQL statements opens up for a developer, SQL permission should only be given to trusted users. [/note]
[p]The administrator can update host security settings by selecting [code]Allow[/code] or [code]Deny[/code] from the [code]Execute SQL[/code] pull-down menu, and then selecting the [code]Update [/code]button. The[code] List Databases[/code] button takes the administrator to the [code]Databases [/code]page with the current host selected. [/p]

How Lasso Checks Data Host Security Settings

[p]When a user attempts to perform a SQL query via Lasso, the permissions for all the groups the user belongs to are checked in sequence. The following steps are performed. [/p]

  1. The set of groups which the current user belongs to is identified. If the user belongs to more than one group, the permissions for each group will be checked in alphabetical order by group name.
  1. The permissions for each group are checked for a permission which references the current host. If an [code]Allow [/code]permission is found for the host, then its use is allowed and no further checking is performed. If a [code]Deny [/code]permission is found for the host, then its use is denied, a security violation is generated, and no further checking is performed. If an[code] Ignore[/code] permission is found, then the database is not allowed for that group, but Lasso will continue to check database permissions for the current user in other groups.
  1. If no result is found after checking all of the groups which the user belongs to and the [code]AnyUser [/code]group, then the SQL query is denied and a security violation is generated.
  1. If the database referenced in the SQL query has any SQL stop words defined in Site Administration, they are compared to the SQL statement which was specified in the Lasso SQL query. If a match is found, then the SQL statement is not allowed and a security violation is generated.
[p]An [code]Allow[/code] permission is required in order to issue SQL statements for a data source host. The SQL permission for a host is [code]Ignore[/code] by default, and this permission must be explicitly set to [code]Allow[/code] before any SQL statements can be issued using Lasso. [/p]

Database Permissions

[p]Lasso Security allows administrators to either [code]Allow [/code]or [code]Deny [/code]different database actions for a group for each specific database available through Lasso. Permissions can also be defined for a single meta-entry[code] [/code][def]All Databases[/def]. This entry is checked if no permissions are found for a specific database. [/p]

[p]The Setup > Security > Databases page in Site Administration allows the administrator to define all database-level permissions for any specific group. [/p]

Figure 9: Databases Page

[p]The top panel shows the current group to the right of [code]Permissions For Group[/code]. The current group can be switched by selecting an existing group from the [code]Groups[/code] pull-down menu and selecting [code]Switch Group[/code]. [/p]

[p]The[code] Database Listing[/code] panel shows a listing of all the databases available for the current group, as well as links to [code]All Databases [/code]and [code]All Tables [/code]settings. The current connector and host are displayed by default. The administrator can switch connectors and hosts by selecting a new connector and host from the [code]Connectors[/code] and [code]Hosts [/code]pull-down menus. Selecting [code]Unassign All [/code]will reset all permissions for all databases to their default values. No user will be able to access a database via a Lasso solution unless the database has been assigned with at least one permission set to[code] Allow[/code] by the administrator. [/p]

[p]Selecting the [code]All Databases[/code] link in the [code]Database Listing[/code] panel allows permissions to be set for all databases regardless of data source connector or host in the[code] Database Detail[/code] panel, which appears to the right. Selecting the [code]All Tables[/code] link takes the administrator to the [code]Table Detail[/code] panel in the [code]Tables[/code] page, where permissions for all tables regardless of data source connector, host, or database can be set. For more information, see the [code]Tables[/code] page description. [/p]

Setting Group Database Permissions

[p]Selecting a database in the [code]Databases Listing[/code] panel will show its permissions settings in the [code]Database Detail[/code] panel for the selected group. Here, the administrator can update database security settings by selecting the [code]Update [/code]button. [/p]

[p]The following describes the database security permissions that can be set for the selected group: [/p]

[note][b]Note: [/b]All permissions default to [code]Ignore[/code], which simply is the absence of an [code]Allow[/code] or [code]Deny[/code] permission. [/note]

[note][b]The [/b]administrator can update database security settings by selecting [code]Allow[/code] or [code]Deny[/code] from each pull-down menu, and then selecting the [code]Update [/code]button. The[code] List Tables[/code] button takes the administrator to the [code]Tables [/code]page with the current table selected. [/note]

How Lasso Checks Database Security Settings

[p]When a user attempts to perform a database action, the permissions for all the groups the user belongs to are checked in sequence. The following steps are performed. [/p]

  1. The set of groups which the current user belongs to is identified. If the user belongs to more than one group, the permissions for each group will be checked in alphabetical order by group name.
  1. The permissions for each group are checked for a permission which references the current database and action. If an [code]Allow [/code]permission is found for the database, then its use is allowed and no further checking is performed. If a [code]Deny [/code]permission is found for the database, then its use is denied, a security violation is generated, and no further checking is performed. If an[code] Ignore[/code] permission is found, then the database is not allowed for that group, but Lasso will continue to check database permissions for the current user in other groups.
  1. If no result is found in a particular group, then the permission for the[code] All Databases [/code]entry for that group is checked. If an [code]Allow [/code]permission is found for the database action for [code]All Databases, [/code]then the action is allowed. If a [code]Deny [/code]permission is found, then the database action is denied and a security violation is generated. Note that after the first [code]Allow [/code]or [code]Deny [/code]is found, no further checking is performed.
  1. If no result is found after checking all of the groups which the user belongs to and the [code]AnyUser [/code]group, then the database action is denied and a security violation is generated.
  1. If the database has any SQL stop words defined, they are compared to the SQL statement which was specified in the [code]-SQL[/code] command tag or to the SQL statement generated automatically by Lasso. If a match is found, then the SQL statement is not allowed and a security violation is generated.
[p]This order of operation means that any database actions which are not explicitly allowed for a group (and its associated users) are effectively denied. The [code]All Databases [/code]entry can be used to allow database actions across all databases available to Lasso. [/p]

[p]Database permissions are required in order to access a table. A database must have [code]Allow [/code]permission for a specified action in order for the like permissions of the table to even be checked. All actions for a table have [code]Ignore[/code] permission by default, and permissions must be explicitly set to [code]Allow[/code] before any data can be retrieved from the table. [/p]

Table Permissions

[p]Lasso Security allows administrators to either [code]Allow [/code]or [code]Deny [/code]different database actions for a group for each specific table available through Lasso. [/p]

[p]The Setup > Security > Tables page in Site Administration allows the administrator to define all table-level permissions for any existing group. [/p]

Figure 10: Tables Page

[p]The top panel shows the current group to the right of [code]Permissions For Group[/code]. The current group can be switched by selecting an existing group from the [code]Groups [/code]pull-down menu and selecting[code] Switch Group[/code]. [/p]

[p]The [code]Table Listing[/code] panel shows a listing of all the tables available for the selected database. The current connector, host, and database are displayed by default. The administrator can switch databases by selecting a new database from the [code]Database[/code] pull-down menu. Selecting the name of a table shows its group security settings in the[code] Table Detail[/code] panel. Selecting [code]Unassign All[/code] will reset all permissions for all tables to their default values. [/p]

[p]Selecting the [code]All Databases[/code] link in the [code]Table Listing [/code]panel takes the administrator to the [code]Databases[/code] page, where permissions for all databases can be set in the [code]Database Listing [/code]panel. Selecting the [code]All Tables[/code] link allows permissions to be set for all databases regardless of data source connector, host, or database in the[code] Table Detail[/code] panel, which appears to the right. [/p]

[note][b]Note: [/b]Allowing permission for all tables does not override any database permission setting of [code]Deny[/code] or I[code]gnore[/code]. If a database permission is set to [code]Deny[/code] or [code]Ignore[/code], then a user will not be able to access any information in the database even if all table permissions are set to [code]Allow[/code]. [/note]

Setting Group Table Permissions

[p]The administrator can update table security settings for the selected group in the [code]Tables Detail[/code] panel. The following describes the table security permissions that can be set for the selected group. [/p]

[note][b]Note: [/b]In order for a user to be able to use a database via a Lasso solution, permissions must be set to [code]Allow[/code] on both the database and table level. For example, a user will not be able to search for records in a database unless the [code]Search Records[/code] permission is set to [code]Allow[/code] for both the database and the table that contains the records. [/note]

[p]The administrator can update database security settings by selecting [code]Allow[/code] or [code]Deny[/code] from each pull-down menu, and then selecting the [code]Update [/code]button. [/p]

How Lasso Checks Table Security Settings

[p]When a user attempts to perform a database action, the permissions for all the groups the user belongs to are checked in sequence. The following steps are performed. [/p]

  1. The set of groups which the current user belongs to is identified. If the user belongs to more than one group, the permissions for each group will be checked in alphabetical order by group name.
  1. First, permission is checked for the database which contains the table and for the [code]All Databases [/code]entry. If [code]Allow [/code]permission is granted, then the table security settings are checked.
  1. The permissions for each group are checked for a permission which references the current table and action. If an [code]Allow [/code]permission is found for the table, then its use is allowed and no further checking is performed. If a [code]Deny [/code]permission is found for the table, then its use is denied, a security violation is generated, and no further checking is performed. If an[code] Ignore[/code] permission is found, then the use of the table is not allowed for that group, but Lasso will continue to check table permissions for the current user in other groups.
  1. If no result is found in a particular group, then the permission for the[code] All Tables [/code]entry for that group is checked. If an [code]Allow [/code]permission is found for the database action for [code]All Tables, [/code]then the action is allowed. If a [code]Deny [/code]permission is found, then the database action is denied and a security violation is generated. Note that after the first [code]Allow [/code]or [code]Deny [/code]is found, no further checking is performed.
  1. If no result is found after checking all of the groups which the user belongs to and the [code]AnyUser [/code]group, then the database action is denied and a security violation is generated.
[p]Database permissions are required in order to access a table. A database must have [code]Allow [/code]permission for a specified action in order for the permissions of the table to even be checked. [/p]

[note][b]Note: [/b]In order for a user to be able to use a database via a Lasso solution, permissions must be set to [code]Allow[/code] on both the database and table level. For example, a user will not be able to search for records in a database unless the [code]Search Records[/code] permission is set to [code]Allow[/code] for both the database and the table that contains the records. [/note]

Field Permissions

[p]Field permissions are established as preferences in the Setup > Data Sources > Fields page of Site Administration. Field permissions are discussed in the Setting Up Data Sources chapter, and also in the Record-Level Security section that follows. [/p]

[p]If both the database and table referenced by a given Lasso action have been allowed, then the field preferences are checked. Since field preferences cannot be set on a per-group basis, they are the same for all users who have access to the database and table regardless of what groups they belong to. [/p]

How Lasso checks field permissions:

  1. The [code]Allow…[/code] preferences are checked to ensure the field can be used in searches, or can be modified. Otherwise, a security violation is generated.
  1. The [code]Require an Exact Match… [/code]preferences are checked and if any are set to [code]Yes[/code], the values of the fields involved are compared to those in the database before the action is allowed. If any field values do not match, then a security violation is generated.
  1. The field filters are processed. If any of them return errors, then the error is returned and the database action is not performed. Otherwise, the values of the field filters are used to process the database action.
  1. If the field is being referenced as a response field, then the appropriate preferences must be established for the field. Otherwise, a security violation is generated.

Tag Permissions

[p]Lasso Security allows administrators to either [code]Allow [/code]or [code]Deny [/code]access to any of the tags in Lasso. The Setup > Security > Tags page in Site Administration allows the administrator to define all tag-level permissions for any existing group. [/p]

Figure 11: Tags Page

[p]The top panel shows the current group to the right of [code]Permissions For Group[/code]. The current group can be switched by selecting an existing group from the [code]Groups[/code] pull-down menu, and then selecting [code]Switch Group[/code]. [/p]

Setting Tag Category Permissions

[p]The[code] Tag Categories Listing [/code]panel shows a listing of all relevant tag categories for which tags can be enabled or disabled at the group level. Category level permissions can be set by selecting[code] Allow[/code] or [code]Deny [/code]from the [code]Status[/code] pull-down menu, and selecting [code]Update[/code]. All categories can be allowed or denied by selecting [code]Allow All[/code] or [code]Deny All[/code]. A [code]Mixed[/code] status indicates that a selected tag category may contain both [code]Allow[/code] and [code]Deny[/code] permissions for individual tags. [/p]

Setting Tag Permissions

[p]When a category is selected in the [code]Tag Categories Listing [/code]panel, it shows all relevant tags in that category and their security permissions for the selected group in the [code]Tags Listing[/code] panel. [code]Prev[/code] and [code]Next[/code] buttons appear for navigation if there are more than ten tags in a selected category. Each tag can be individually allowed or denied by selecting [code]Allow[/code] or [code]Deny [/code]from the [code]Status[/code] pull-down menu, and then selecting [code]Update[/code]. An [code]Ignore[/code] permission designates the absence of an [code]Allow[/code] or [code]Deny[/code] permission. All tags shown in the [code]Tags Listing[/code] panel can also be allowed or denied by selecting [code]Allow All[/code] or [code]Deny All[/code]. [/p]

Tag Dependencies

[p]Some Lasso tags have dependencies on other tags to function properly. If permissions for a tag has been denied that has dependencies with other tags, then those tags will not function correctly. For example, if [code][TCP_…] [/code]tags are denied, it will cause tags such as[code] [Email_Send] [/code]not to work, which relies on the use of the [code][TCP_…] [/code]tags. To see whether on not a tag has any dependencies, consult the Lasso 8 Reference and check to see if there are any tags listed in the [code]Required [/code]field in the [code]Detail[/code] view for any tag. [/p]

[p]When a user attempts to execute a tag, the permissions for all the groups they belong to are checked in sequence. The following steps are performed. [/p]

How Lasso Checks Tag Security Settings

  1. The set of groups which the current user belongs to is identified. If the user belongs to more than one group, the permissions for each group will be checked in alphabetical order by group name.
  1. The permissions for each group are checked for a permission which references the current tag. If an [code]Allow [/code]permission is found for the tag, then the tag execution is allowed. If a [code]Deny [/code]permission is found, then the tag execution is denied and a security violation is generated. Note that after the first [code]Allow [/code]or [code]Deny [/code]is found, no further checking is performed.
  1. If no result is found, then the tag execution is allowed.
[p]This order of operation means that any tag which is not explicitly denied is implicitly allowed. [/p]

File Permissions

[p]Lasso Security allows administrators to establish permissions for what files a group of users can manipulate, and what operations they can perform on those files. [/p]

[p]The Setup > Security > Files page in Site Administration allows the administrator to set file-level security for selected groups. This affects the use of the [code][File_…],[/code] [code][HTTP_…][/code], [code][FTP_…][/code], [code][Image][/code], and [code][PDF_…][/code] tags, which are described in the Lasso 8.5 Language Guide and Lasso 8 Reference. [/p]

Figure 12: Files Page

[p]The top panel shows the current group to the right of [code]Permissions For Group[/code]. The current group can be switched by selecting an existing group from the[code] Group[/code] pull-down menu, and then selecting[code] Switch Group[/code]. [/p]

Viewing File Permissions

[p]The [code]File Permissions[/code] panel shows what file permissions the current group has. Each entry has two parts. [/p]

[p]Selecting any path shows information about the path in the Path Permissions panel to the right. The permissions can then be changed according to the instructions in the following section. [/p]

[note][b]Note: [/b]The final path [code]/ (Read Only)[/code] is included to indicate that permission is always granted for users to read any files within the Web server root. [/note]

[p]The Unassign All button at the bottom of the panel unassigns all permissions for all paths for the current group. The [code]Refresh[/code] button simply refreshes the current panel. [/p]

Updating File Permissions

[p]The[code] File Permissions[/code] panel shows the file permissions for a single path. The path can be changed or the file permissions for that path modified. [/p]

[p]File permissions can be set by selecting[code] Allow[/code] or [code]Deny [/code]for each permission, and selecting [code]Update[/code]. All permissions can be allowed or denied by selecting [code]Allow All[/code] or [code]Deny All[/code]. [/p]

File Uploading

[p]In order for site developers to be able to use uploaded files, they must be granted permission to access the temporary folder in which uploaded files are placed. They usually must also be granted permission to access a folder where the uploaded files will be copied permanently. [/p]

[p]The location of the temporary items folder can be different depending on how the operating system is set up. The server administrator needs to add the file uploads path to the list of available paths in order to allow group permission to be assigned to it. [/p]

[p]Lasso automatically deletes any files which are not removed from the temporary items folder before the current Lasso page is finished being processed. This ensures that unwanted uploads are not allowed to occupy disk space for longer than the time it takes Lasso to process a single Lasso page. [/p]

[p]In addition, the temporary items folder is automatically cleaned by the operating system when the computer is restarted. This ensures that even if Lasso Service crashes, unwanted file uploads will be deleted the next time the computer is restarted. [/p]

[p]See the Files and Logging chapter in the Lasso 8.5 Language Guide for more information about using file uploads. [/p]

How File Permissions are Checked

  1. When a file tag is called, the groups for the current user are determined. In the following example, [code][File_Read][/code] attempts to read a file within the Web server root in a Windows machine.
[pre][code][File_Read: 'c://inetpub/wwwroot/default.lasso'][/code] [/pre]
  1. The permissions for the groups are checked in alphabetical order by group name for a [code]File Root [/code]that contains the file which is referenced within the[code] [File_Read][/code] tag. For example, a group that provides access to the [code]wwwroot [/code]directory would match the [code][File_Read][/code] tag above.
[pre]Allow Path = 'c:/inetpub/wwwroot/' [/pre]
  1. Once a matching [code]File Root [/code]is found, the individual permissions are checked. For a [code][File_Read][/code] tag, the user must be granted [code]Read Files [/code]permission.
  1. If [code]Read Files [/code]is not permitted, then the permissions for the groups continue being checked for another permission that matches the[code] File Root [/code]of the parameter to [code][File_Read][/code]. If no valid permission can be found then a security violation is generated.

Web Server Security

[p]Most Web server applications provide built-in security which protects files with certain names or in certain directories. Lasso generally works in concert with Web server security, but can also be used in some instances to bypass Web server security. [/p]

[pre]http://www.example.com/Private/default.lasso [/pre] [pre]http://www.example.com/Action.Lasso?-Response=/Private/default.unknown [/pre]
  1. [note][b]Important: [/b]The [code][Include…] [/code]tags can be used to bypass Web server realms and serve any files from within the Web server root. Only trusted developers should be allowed to upload Lasso pages. [/note]

Record-Level Security

[p]Record-level security can be enabled in Lasso by setting fields to require an exact match when various Lasso actions are performed. A specific action will be allowed only if a value is specified for each field that requires an exact match, and if that value is exactly the same as the value currently stored in the database. [/p]

[p]Note that record-level security will only be checked if the current user has permission to perform the action in the database or table directly. Record-level security can only be used to deny actions to users who would otherwise be able to perform an action. [/p]

[p]Three types of actions can be secured using record-level security. [/p]

To establish record-level security:

  1. Create two fields within the database or table to be secured. In the following example, [code]Username [/code]and [code]Password[/code] fields will be created in the [code]People [/code]table of the [code]Contacts [/code]database. Visitors will be able to specify their username and password when they create a new record. Only the visitor that created the record will then be able to update, or delete that record, but anyone will be able to view the record.
  1. Within Site Administration Setup > Data Sources > Fields check the box for [code]Require an Exact Match on this Field when[/code] [code]Updating Records[/code] for both the [code]Username [/code]and [code]Password [/code]fields.
  1. Ensure that the [code]AnyUser [/code]group has permission to search the database, add records to the database, and to update records within the database. The exact match option will only be checked when the user attempts to update a record within the database.
  1. The add records page needs to require values for both the [code]Username [/code]and [code]Password [/code]fields. The following example shows an HTML form with [code]-Required [/code]command tags embedded before the text inputs for [code]Username [/code]and [code]Password[/code].
[pre]<form action="response.lasso" method="post"> [/pre]

[pre] <input type="hidden" name="-Required" value="">
<p>Username: <input type="text" name="Username" value=""> [/pre]

[pre] <input type="hidden" name="-Required" value="">
<p>Password: <input type="text" name="Password" value=""> [/pre]

[pre] <p>First Name: <input type="text" name="First_Name" value="">
<p>Last Name: <input type="text" name="Last_Name" value="">
<p>Phone: <input type="text" name="Phone_Number" value=""> [/pre]

[pre] <p><input type="submit" value="Add Record">
</form> [/pre]

[pre][Inline: -Add,
-Database='Contacts',
-Table='People',
-KeyField='ID',
'Username'=(Action_Param: 'Username'),
'Password'=(Action_Param: 'Password'),
'First_Name'=(Action_Param: 'First_Name'),
'Last_Name'=(Action_Param: 'Last_Name'),
'Phone_Number'=(Action_Param: 'Phone_Number')]
[/Inline] [/pre]
  1. Any user will be able to view the [code]First_Name[/code], [code]Last_Name[/code], and [code]Phone_Number [/code]established for the user using simple search and response Lasso pages. Of course, the [code]Username [/code]and [code]Password [/code]fields should never be revealed on any search response.
  1. Users will be able to modify their record in the database using the following update form. This form is similar to the add form which was defined above, but has the added feature of the exact match setting. Lasso Security will not allow the [code][Inline] … [/Inline] [/code]which this form triggers to be processed unless both the [code]Username [/code]and [code]Password [/code]fields are defined with the right values.
[pre]<form action="response.lasso" method="post"> [/pre]

[pre] <input type="hidden" name="-Required" value="">
<p>Username: <input type="text" name="Username" value=""> [/pre]

[pre] <input type="hidden" name="-Required" value="">
<p>Password: <input type="text" name="Password" value=""> [/pre]

[pre] <p>First Name: <input type="text" name="First_Name"
value="[Field: 'First_Name']">
<p>Last Name: <input type="text" name="Last_Name"
value="[Field: 'Last_Name']">
<p>Phone: <input type="text" name="Phone_Number"
value="[Field: 'Phone_Number']"> [/pre]

[pre] <p><input type="submit" name="-Nothing" value="Update Record">
</form> [/pre]

[pre][Inline: -Update,
-Database='Contacts',
-Table='People',
-KeyField='ID',
-KeyValue=(KeyField_Value)
'Username'=(Action_Param: 'Username'),
'Password'=(Action_Param: 'Password'),
'First_Name'=(Action_Param: 'First_Name'),
'Last_Name'=(Action_Param: 'Last_Name'),
'Phone_Number'=(Action_Param: 'Phone_Number')]
[/Inline] [/pre]

Security Tips

[p]This section provides some important tips and concepts about using security on a Lasso Professional Server server. [/p]

General

Databases

User Authentication

Testing Solutions