Sandbox security uses the location of your ColdFusion pages to control access to ColdFusion resources. A sandbox is a designated directory of your site to which you apply security restrictions. By default, a subdirectory (or child directory) inherits the sandbox settings of the directory one level above it (the parent directory). If you define sandbox settings for a subdirectory, you override the sandbox settings inherited from the parent directory. For example, consider the following directories:
D:\Leaders
D:\Leaders\Roman D:\Leaders\Roman\Pompey
By default, the sandbox settings of the Leaders directory are inherited by the Roman and Pompey directories. If you define sandbox settings for the Roman directory, these settings are inherited by the Pompey directory; the Leaders directory maintains its original settings.
This hierarchical arrangement of security permits the rapid configuration of personalized sandboxes for users with different security levels. For example, if you are a web hosting administrator who hosts several clients on a ColdFusion shared server, you can configure a sandbox for each customer. This prevents one customer from accessing the data sources or files of another customer.
These are the resources that you can restrict:
ColdFusion file permissions are based on the Java security model. A dash (-) indicates all files in the present directory and any child directories, including files in any child directories; an asterisk (*) indicates all files in the present directory and a list of child directories, but not files.
Consider the following file structure:
C:\foo\bar.txt
C:\pat\riots\c.txt C:\pat\riots2\d.txt C:\pat\a.txt
The following table shows the relationship between file path and the affected files or directories:
File path |
Affected files or directories |
---|---|
C:\foo\bar.txt |
C:\foo\bar.txt |
C:\pat\- |
C:\pat\riots\c.txt C:\pat\riots2\d.txt C:\pat\a.txt |
C:\pat\* |
C:\pat\riots\ C:\pat\riots2\ C:\pat\a.txt |
C:\pat\ |
C:\pat\ |
The following table shows the relationship between permissions of a file and of a directory:
You combine the file path and permissions settings to secure permissions on files and directories; for example, setting the read permission on C:\pat\* lets you do the following tasks:
The Root Security Content is the default sandbox for your ColdFusion MX server. If your security requirements are minimal and you do not need additional sandboxes, configure the default sandbox so that the child directories will inherit its security settings.
The Root Security Context appears in the list of Defined Directory Permissions, as the following figure shows:
The new sandbox appears in the list of Defined Directory Permissions, as in the following figure:
You use the ColdFusion Administrator to configure a sandbox.
As in the following figure, several tabs appear, which subsequent steps discuss:
By default, ColdFusion pages in this sandbox can access all data sources.
Note: If <<ALL DATASOURCES>> is in the Enabled Datasources column, any data source that you add when creating this sandbox is enabled. If you move <<ALL DATASOURCES>> to the Disabled Datasources column, any new data source is disabled.
By default, ColdFusion pages in this sandbox can access all listed tags.
By default, ColdFusion pages in this sandbox can access all listed functions.
The character after the backslash is important. A dash (-) indicates all files in the present directory and any child directories, including files in any child directories; an asterisk (*) indicates all files in the present directory and a list of child directories, but not files.
Note: The Files/Dirs tab works together with the file-based permissions of the operating system. To restrict a user from browsing another user's directory, you must use file-based permissions.
For example, select the Read check box for ColdFusion pages within the mytestapps sandbox to read files in the C:\pix directory.
Note: This behavior differs from other tabs, such as CFTags, where you select items to disable.
The file path and its permissions appear in the Secured Files and Directories list.
These settings let you prevent ColdFusion pages in this sandbox from accessing IPs and ports with the tags that call third-party resources, such as cfmail, cfpop, cfldap
, cfhttp
, and so on.
Note: These settings have no effect on an end user's ability to browse sites; they affect access to a ColdFusion page with certain tags. If a ColdFusion page does not use, for example, cfhttp
, any sandbox restriction on cfhttp
has no effect.
Note: By default, these ColdFusion tags in this sandbox can access all IPs at all ports.
For example, to deny this sandbox access to 207.88.220.3 on ports 80 and higher, perform the following steps:
You disabled access by these ColdFusion tags for this and all other IPs and ports.
Tip: To deny access by these ColdFusion tags to an entire site, enable access for a local resource, such as your local mail server, ftp server, and so on.