You can secure many Adobe ColdFusion resources using password authentication and configure sandbox security.
Security is especially important in web-based applications, such as those you develop in ColdFusion. ColdFusion developers and administrators must fully understand the security risks that could affect their development and runtime environments so they can enable and restrict access appropriately.
Whether you have an e-commerce site where customers enter credit card information or a global collaboration site where users share confidential data, you should understand the security risks that could threaten your web applications.
Sandbox security Using the ColdFusion Administrator, define the actions and resources that the ColdFusion pages in and below a specified directory can use.
Note: In ColdFusion 11, you can configure multiple security sandboxes irrespective of the edition that you are using. |
The Security area in the Administrator lets you do the following tasks:
Password protection restricts access to the ColdFusion Administrator and to a ColdFusion server when you attempt access through RDS security.
Secure access to the ColdFusion Administrator is enabled by default. The password that you enter during installation is saved as the default. You are prompted to enter this password whenever you open the Administrator.
Password protection for accessing the Administrator helps guard against unauthorized modifications of ColdFusion, and Adobe recommends using passwords. You can disable or change the Administrator password on the Security > CF Admin Password pag
You can specify a new seed value to encrypt data source passwords.
To modify the default seed value assigned by ColdFusion or to change the value you specified,
Click Submit Changes.
Note: When you modify the seed value, all data source connections are reset. Therefore, Adobe recommends that you perform this task when the server is idle or at the initial phase (after installation). |
If you configured password protection for RDS access when you installed ColdFusion, you are prompted for the password when you attempt to access ColdFusion from Dreamweaver MX 2004, HomeSite+, or the ColdFusion Report Builder.
You can disable RDS or change the RDS password on the Security > RDS Password page.
Note: Disabling RDS also disables the applet that the ColdFusion Administrator uses in file-related dialog boxes. |
If you use RDS security, you rely on web server and operating system security settings to set permissions for ColdFusion application and document directories.
To enhance security for the ColdFusion server on Windows, restrict access to the following files to selected ColdFusion users:
ColdFusion exposes many services as web services. You can access these services using SOAP and AMF/Flash remoting.
The following are the exposed services:
To configure IP addresses to access exposed services:
You can restrict access to ColdFusion Administrator.
Note: By default, localhost and all IP addresses can access ColdFusion server. |
To add IP addresses that must be allowed access:
ColdFusion allows you to secure ColdFusion server furthermore by enabling or disabling selected settings on the ColdFusion Administrator. When installing ColdFusion, you can enable Secure Profile by selecting the option when prompted on the Secure Profile screen. Further, you could provide a comma separate list of IP addresses that may be allowed to access the ColdFusion Administrator.
Administrator Settings | Path | Default Admin Profile | Secure Profile | Changes to the setting post migration to ColdFusion 10 |
---|---|---|---|---|
Use UUID for cftoken | Server Settings > Settings | Enabled | Enabled | Overwritten |
Disable access to internal ColdFusion Java components | Server Settings > Settings | Disabled | Enabled | Overwritten |
Enable Global Script Protection | Server Settings > Settings | Enabled | Enabled | Overwritten |
Maximum size of post data | Server Settings > Settings | 20MB | 20MB | Overwritten |
Missing Template Handler | Server Settings > Settings | No Value | Custom missing error template | Retained if specified |
Site-wide Error Handler | Server Settings > Settings | No Value | Custom site-wide error template | Retained if specified |
Request Queue Timeout Page | Server Settings > Request Tuning | No value | Custom error template | Retained if specified |
Cookie Timeout | Server Settings > Memory Variables | 15767000 minutes | 1440 minutes | N/A |
Disabling updating of ColdFusion internal cookies using ColdFusion tags/functions | Server Settings > Memory Variables | Disabled | Enabled | N/A |
Enable WebSocket Server | Server Settings > WebSocket | Enabled | Disabled | N/A |
Start Flash Policy Server | Server Settings > WebSocket | Enabled | Disabled | N/A |
Allowed SQL (all settings) | Data & Services > Data Sources > database > Advanced Settings | Enabled | Create, Drop, Alter, Grant, Revoke, Stored Procedures are disabled | Retained if specified |
Enable Robust Exception Information | Debugging & Logging > Debug Output Settings | Disabled | Disabled | Overwritten |
Enable CFSTAT | Debugging & Logging > Debug Output Settings | Enabled | Disabled | Overwritten |
Select the type of Administrator authentication | Security > Administrator | Use a single password only | Separate user name and password authentication (allows multiple users) | N/A |
Enable RDS Service | Security > RDS | Configurable at install time | Disabled | N/A |
Select the type of RDS authentication | Security > RDS | Use a single password only | Separate user name and password authentication (allows multiple users) | N/A |
Allowed IP addresses for ColdFusion Administrator access | Security > Allowed IP Addresses | Not available at install time | Available at install time | N/A |
Allow concurrent login sessions for Administrator Console | Security > Secure Profile | Enabled | Disabled |
Secure Profile disables Directory Browsing for a stand alone ColdFusion installation with built-in web server.
The page above explains that if the "secure profile" option is taken during installation, ColdFusion will set the 3 error handlers to a value that is shown above merely as "Custom missing error template".
More specifically, and particularly if anyone may remove them from the CF Admin and need to add them back, the three templates can be found in this directory in your installation: C:\ColdFusion10\cfusion\wwwroot\CFIDE\administrator\templates, and are named (in the order listed above):
So for instance, to put the "default" "secure" sitewide error handler back in place, provide this value for the CF Admin>Settings>Site-wide Error Handler:
When installing ColdFusion Server, you can enable Secure Profile by selecting the option when prompted on the Secure Profile screen. Further, you could provide a comma separate list of IP addresses that may be allowed to access the ColdFusion Administrator. This feature has been available from ColdFusion 10. In ColdFusion 11, Secure Profile has been enhanced to handle access to other internal components too. For instance, you can set restrictions for following URLs:
To allow IP addresses to access the internal ColdFusion components, perform the following tasks:
If you have configured an external web server, you can also restrict access to the ColdFusion Administrator and ColdFusion Internal Directories at the connector-level by modifying the iprestriction.properties file available under the connector folder. For instance, <cf_root>/config/wsconfig//iprestriction.properties.
Note : You will need to restart the external web server after modifying the iprestriction.properties file. |
Sandbox security (called Resource security in the Standard Edition) 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. Sandbox security lets you specify which tags, functions, and resources (for example, files, directories, and data sources) can be used by ColdFusion pages located in and under the designated directory.
To use sandbox security in the J2EE editions, the application server must be running a security manager (java.lang.SecurityManager) and you define the following JVM arguments (for Tomcat, this is the java.args line in the cf_root/cfusion/bin/jvm.config file):
-Djava.security.manager "-Djava.security.policy=cf_root/WEB-INF/cfusion/lib/coldfusion.policy" "-Djava.security.auth.policy=cf_root/WEB-INF/cfusion/lib/neo_jaas.policy" |
Note: Sandbox security is not enabled by default. You enable it on the Security > Sandbox Security page before ColdFusion enforces the settings. |
By default, a subdirectory of a sandbox inherits the settings of the directory one level above it. However, if you define a sandbox for a subdirectory, the subdirectory no longer inherits settings from the parent, completely overriding the parent directory's sandbox settings. For example, consider the following directories:
C:\Inetpub\wwwroot |
If you define a sandbox for the wwwroot directory, the settings also apply to the sales and rnd directories. If you also define a sandbox for the rnd directory, the rnd sandbox settings also apply to the dev and qa directories. The wwwroot and sales directories maintain their original settings, and the rnd settings override the wwwroot directory settings for the rnd directory and subdirectories.
This hierarchical arrangement of security permits the 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.
You can restrict the following resources:
Files/DirsEnable tags and functions in the sandbox to access files and directories outside the sandbox.
Note: To use the Administrator API when sandbox security is enabled, allow access to the cf_web_root/CFIDE/adminapi directory. |
Server/PortsSpecify the servers, ports, and port ranges that the ColdFusion tags that call third-party resources can use.For more information, see the Administrator online Help.
Note: When you run ColdFusion in the J2EE configuration on IBM WebSphere, the Files/Dirs and Server/Ports tabs are not enabled. |
When you enable access to files outside the sandbox, you specify the filename. When you enable access to directories outside the sandbox, you specify directoryname_indicator_, where indicator is a dash or asterisk, as follows:
Permission |
Effect on files |
Effect on directories |
---|---|---|
Read |
View the file |
List all files in the directory |
Write |
Write to the file |
Not applicable |
Execute |
Execute the file |
Not applicable |
Delete |
Delete the file |
Delete the directory |
ColdFusion lets you define multiple security sandboxes.
Before you begin security sandbox configuration, analyze your application and its usage to determine the tags, functions, and resources that it requires. You can then configure the sandbox to enable access to the required resources and disable use of the appropriate tags and functions. For example, if the applications in the sandbox do not use the cfregistry tag, you can safely disable it.
Note: In the Standard Edition, the Root Security Context is the only sandbox without any initial list of defined directory permissions. |
To disable a data source, in the left column of the Datasources tab, highlight the data source, and click the right arrow.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 is enabled. If you move <<ALL DATASOURCES>> to the Disabled Datasources column, any new data source is disabled. |
In the Secured Files and Directories list, verify that the file path is correct. The character after the backslash is important. For information, see About directories and permissions.
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, use file-based permissions. |
To turn off default behavior (global access to all servers and ports), enter the IP addresses and port numbers that pages in this sandbox can connect to by using tags that access external resources (for example, cfmail, cfpop, cfldap, cfhttp, and so on). You can specify an IP address, a server name (such as www.someservername.com), or a domain name (such as someservername.com). You can optionally specify a port restriction.
Note: This behavior differs from other tabs, such as CFTags, where you select items to disable. If you set any values in this tab, external-resource tags executed in this sandbox can access only the specified servers and ports. |
For example, to allow this sandbox access to 207.88.220.3 on ports 80 and lower, perform the following steps:
In the Port field, enter 80, and click This Port and Lower.
Note: 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. |
Grant permissions in sandbox for the following filepaths:
For disk-based caching to work inside a sandbox, the sandbox must provide read/write permission to the disk cache directory. This can be the default directory (java.io.tmpdir) or a user-configured directory as identified by the diskStore property. The diskStore property in cf_root\lib\ehcache.xml is used to specify the directory for disk cache (<diskStore path="java.io.tmpdir"/>).Use the following code to identify the temp directory:
writeoutput("Temp Dir : " & createobject("java","java.lang.System").getProperty("java.io.tmpdir") ); |
Also, read permission must be granted to cf_root\lib\ehcache.xml for certain functions that read from/write to ehCache.xml to work. For example, cacheGetProperties and cacheSetProperties.
Grant the following permissions:
Log ind på din konto