07.11.2014 Views

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Test</strong>ing for Security Best Practices 151<br />

Check<br />

Yes<br />

Yes<br />

Yes<br />

Description<br />

Restrict serialization to privileged code.<br />

Do not serialize sensitive data or else document it if you do. In the Logging Application<br />

Block, the LogEntry object contains the logging information. Users who log sensitive information<br />

should be aware that that the data is serialized, The following example shows<br />

that the LogEntry class has a Serializable attribute.<br />

[Serializable]<br />

[InstrumentationClass(InstrumentationType.Event)]<br />

public class LogEntry : ICloneable<br />

Validate field data from serialized data streams.<br />

Threading Checklist<br />

Table 39 lists the threading recommendations.<br />

Table 39: Threading Checklist<br />

Check<br />

Yes<br />

Yes<br />

Description<br />

Stress test the application blocks to guarantee that they are not susceptible to denial<br />

of service attacks. For example, the Caching Application Block’s background scheduler<br />

that is used for scavenging and expiration was tested to ensure that its threads do not<br />

deadlock or leak (this means that the threads are properly released), and that each<br />

request does not generate a new thread.<br />

Synchronize Dispose methods.<br />

Reflection Checklist<br />

Table 40 lists the reflection recommendations.<br />

Table 40: Reflection Checklist<br />

Check<br />

Yes<br />

Yes<br />

Description<br />

Callers cannot influence dynamically generated code (for example, by passing assembly<br />

and type names as input arguments). It is possible to alter the configuration files to<br />

dynamically generate code. Threat 2 in Building the Threat Models documents<br />

this issue.<br />

Use full assembly names when the .NET Framework’s Activator.CreateInstance method<br />

creates an instance of the specified type.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!