Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Any ActiveX® control to be deployed and used with Microsoft® Internet Explorer should be conceived and designed with object safety in mind from the start.
Safe design is important because many ActiveX controls are initialized with persistent data (either local or remote), and most ActiveX controls are scriptable (they support a set of methods, events, and properties). Both initialization with persistent data and scripting require safeguards to ensure that security is not violated. Developers should mark their ActiveX controls safe for initialization and scripting.
Developers should also digitally sign their ActiveX controls. Digital signing tells users where the control came from and verifies that the control hasn't been tampered with since its publication.
This article contains information about the following topics:
Safety of the control is ultimately a subjective judgment, but as a general rule "safe" means that none of the following undesirable effects will result from any conceivable use of the control:
To help fulfill these abstract requirements, here are some questions to consider carefully before marking a control as safe. The same questions apply to both untrusted data and scripting.
Using Internet Explorer 4.0 Security Zones, it is possible to configure the browser to only download or run ActiveX Controls located within the enterprise—in other words, the intranet. When a control is downloaded and installed on the local system, however, the location of the original download is no longer available, and the control is available for use on any page that might reference its CLSID. Thus, be aware of the possibility that an Internet page might reference a control intended only for the intranet. There are several approaches to handling this issue.
If the ActiveX Controls are safe for untrusted data and for scripting, supporting IObjectSafety and requiring only safe controls is the simplest solution. Controls that are truly safe should not be usable to break security, even by an untrusted Internet page.
To prevent an ActiveX control from being used on pages other than the one on which it is intended to be used, the control can check the context in which it is instantiated. That is, a control can get access to the DHTML Object Model as described previously to get the URL of the page instantiating it. The location properties of the document object return the URL of the page in which the control is embedded. For instance, an ActiveX control could be designed to run only in the "http://admin" intranet area. When the URL of the containing document begins with a different protocol and host name, it could run with reduced functionality or otherwise completely disable itself.
Be aware that some important controls might be inherently unsafe for scripting. They include tools to aid system configuration or installation. To safely use these ActiveX Controls in the intranet environment, it is important to guarantee:
The first restriction can be enforced because, by default, ActiveX Controls are not safe for scripting. A system administrator can configure a custom security policy to override object safety for a specific intranet zone. Controls that are not marked as safe will run only in pages from this zone. In fact, it is possible to restrict a control to run only in a designated secure zone by explicitly not marking the control as safe. Of course the Internet zone should never be set to override object safety.
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.