To get it programmatically, from managed code, use
Assembly.ImageRuntimeVersion. From unmanaged, use mscoree.dll’s
GetFileVersion(). (From the command line, starting in v1.2, ildasm.exe will show
it if you double-click on "MANIFEST" and look for "Metadata version".) Those
will give you the CLR version that the image claims it wants. However, that’s
not necessarily what it was actually built against (compilers can be configured
to put any string there).
Also, the CLR version that will be run by an exe is not necessarily the same
as what’s in its image runtime version. The chosen version can also depend on
its hosting application’s choice, a config file, environment variables, and
registry settings. If you need to override those, you can set the
supportedRuntime/requiredRuntime in the app.config for the process exe.
[Suzanne
Cook's .NET CLR Loader Notes]
Not strictly security related BUT the security
capabilities of the .NET CLR is tied to which version you are running. For
example, Code Access Security (CAS) is available for ASP.NET applications
starting in version 1.1 but is pretty much turned off (runs with FullTrust)
in version 1.0. So it would be nice to programmatically find out version of
the CLR your server is running :-)
7:33:31 PM
Comment
I came across these again on TechNet. They've been around for
some time, but we can all use a reminder now and then.
The Ten Immutable Laws of Security by Microsoft
Security Response Center
- If a bad guy can persuade you to run his program on your computer,
its not your computer anymore.
- If a bad guy can alter the operating system on your computer, its
not your computer anymore.
- If a bad guy has unrestricted physical access to your computer,
its not your computer anymore.
- If you allow a bad guy to upload programs to your web site, its
not your web site any more.
- Weak passwords trump strong security.
- A machine is only as secure as the administrator is
trustworthy.
- Encrypted data is only as secure as the decryption key.
- An out of date virus scanner is only marginally better than no
virus scanner at all.
- Absolute anonymity isn't practical, in real life or on the
web.
- Technology is not a panacea.
- Nobody believes anything bad can happen to them,
until it does.
- Security only works if the secure way also happens to
be the easy way.
- If you don't keep up with security fixes, your
network won't be yours for long.
- It doesn't do much good to install security fixes on
a computer that was never secured to begin with.
- Eternal vigilance is the price of security.
- There really is someone out there trying to guess
your passwords.
- The most secure network is a well-administered
one.
- The difficulty of defending a network is directly
proportional to its complexity.
- Security isn't about risk avoidance; it's about risk
management.
- Technology is not a
panacea.
5:48:09 PM
Comment