Showing posts with label Pattern and Practices. Show all posts
Showing posts with label Pattern and Practices. Show all posts

Monday, January 11, 2010

Principles of Software Security


ShareThis

Principles of Software Security

Security is a major concern for the Softwares we design.

There are a number of established security principles that apply to the process of software design. These accepted principles help us design secure applications.

Have a look on these Security Principals:

  • Adopt the principle of least privilege. Processes that run script or execute code should run under a least privileged account to limit the potential damage that can be done if the process is compromised. If a malicious user manages to inject code into a server process, the privileges granted to that process determine to a large degree the types of operations the user is able to perform. Code that requires additional trust (and raised privileges) should be isolated within separate processes.


  • Use defense in depth. Place check points within each of the layers and subsystems within your application. The check points are the gate-keepers that ensure that only authenticated and authorized users are able to access the next downstream layer.

  • Don't trust user input. Applications should thoroughly validate all user input before performing operations with that input. The validation may include filtering out special characters. This preventive measure protects the application against accidental misuse or deliberate attacks by people who are attempting to inject malicious commands into the system. Common examples include SQL injection attacks, cross-site scripting attacks, and buffer overflow.

  • Use secure defaults. A common practice among developers is to use reduced security settings, simply to make an application work. If your application demands features that force you to reduce or change default security settings, test the effects and understand the implications before making the change.

  • Don't rely on security by obscurity. Trying to hide secrets by using misleading variable names or storing them in odd file locations does not provide security. In a game of hide-and-seek, it's better to use platform features or proven techniques for securing your data.

    For example, all of your files that contain data like xml files, can be put in App_Data folder in an ASP.net application to make them secure and inaccessible from attackers.
  • Check at the gate. You don't always need to flow a user's security context to the back end for authorization checks. Often, in a distributed system, this is not the best choice. Checking the client at the gate refers to authorizing the user at the first point of authentication (for example, within the Web application on the Web server), and determining which resources and operations (potentially provided by downstream services) the user should be allowed to access.


    If you design solid authentication and authorization strategies at the gate, you can circumvent the need to delegate the original caller's security context all the way through to your application's data tier.

  • Assume external systems are insecure. If you don't own it, don't assume security is taken care of for you.

  • Reduce surface area. Avoid exposing information that is not required. By doing so, you are potentially opening doors that can lead to additional vulnerabilities. Also, handle errors gracefully; don't expose any more information than is required when returning an error message to the end user.

  • Fail to a secure mode. If your application fails, make sure it does not leave sensitive data unprotected. Also, do not provide too much detail in error messages; meaning don't include details that could help an attacker exploit a vulnerability in your application. Write detailed error information to the Windows event log.

  • Remember you are only as secure as your weakest link. Security is a concern across all of your application tiers.

  • If you don't use it, disable it. You can remove potential points of attack by disabling modules and components that your application does not require. For example, if your application doesn't use output caching, then you should disable the ASP.NET output cache module. If a future security vulnerability is found in the module, your application is not threatened.

Key Terminology

  • Authentication. Positively identifying the clients of your application; clients might include end-users, services, processes or computers.

  • Authorization. Defining what authenticated clients are allowed to see and do within the application.

  • Secure Communications. Ensuring that messages remain private and unaltered as they cross networks.

  • Impersonation. This is the technique used by a server application to access resources on behalf of a client. The client's security context is used for access checks performed by the server.

  • Delegation. An extended form of impersonation that allows a server process that is performing work on behalf of a client, to access resources on a remote computer. This capability is natively provided by Kerberos on Microsoft® Windows® 2000 and later operating systems. Conventional impersonation (for example, that provided by NTLM) allows only a single network hop. When NTLM impersonation is used, the one hop is used between the client and server computers, restricting the server to local resource access while impersonating.

  • Security Context. Security context is a generic term used to refer to the collection of security settings that affect the security-related behavior of a process or thread. The attributes from a process' logon session and access token combine to form the security context of the process.

  • Identity. Identity refers to a characteristic of a user or service that can uniquely identify it. For example, this is often a display name, which often takes the form authority/user name.
References:

http://msdn.microsoft.com/en-us/library/aa302381.aspx#secnetch01_whataregoals

Friday, January 8, 2010

Microsoft patterns and practices


ShareThis

Microsoft patterns and practices provides .NET developers with guidance,
tools, libraries, and frameworks to help them build better applications.
Development teams adopting patterns and practices achieved greater
developer productivity and improved ongoing application management and
application performance.

Microsoft patterns and practices helps software architects, developers, and their
teams leverage the Microsoft platform to build better applications. Patterns and
practices guidance, tools, libraries, and frameworks help to simplify the platform,
provide guidance to common problems, and help development teams build looselycoupled
applications. Key components of patterns and practices include:
􀂃 The Enterprise Library is a collection of reusable software components that help
developers with common development needs such as logging, validation, data
access, and exception handling. They can be used “as is” or extended or
modified by developers as needed.
􀂃 SharePoint Guidance helps architects and developers design and build
SharePoint intranet applications.
􀂃 Composite Application Guidance for WPF (formerly code-named Prism) helps
developers build and evolve modular Windows Presentation Foundation and
Silverlight client applications. These applications typically include multiple
screens and role-determined behavior and are designed to change over time
based on business requirements.
􀂃 Web Service Software Factory are patterns, models, and written guidance
integrated with Visual Studio 2008 that are designed to help developers build
Web services.
􀂃 Microsoft ESB Guidance for BizTalk Server 2006 R2 is designed to help
developers leverage the Microsoft BizTalk Server platform to build an
enterprise service bus (ESB).

Read more here

Thursday, September 17, 2009

Microformats- the buzz word


ShareThis
Microformats are simple, open design patterns based on existing standards that you use to describe and add meaning to common web content, such as that about people, places, events and links. These structured data patterns allow machines like computers, user agents and applications to extract that content for a wide range of uses.

Sites already using microformats, includs Google, Yahoo!, Facebook, Twitter, Flickr, and LinkedIn. But these are just some of the more well-known names..

...How pervasive microformats are. For example, according to Yahoo! SearchMonkey, there are 1,450,000,000 web pages that publish hCard and 36,200,000 pages marked up with hCalendar.

Few good links to get set go:

Privacy guideliance from Microsoft


ShareThis

Privacy guideliance from Microsoft


This document provides basic criteria to consider when building privacy into software releases.

Ten Things You Must Do to Protect Privacy

  • Collect user data only if you have a compelling business and user value proposition. Collect data only if you can clearly explain the net benefit to the user. If you are hesitant to tell users what you plan to do, then don’t collect their data.

  • Collect the smallest amount of data for the shortest period of time. Collect personal data only if you absolutely must, and delete it as soon as possible. If there exists a need to retain personal data, ensure that there is business justification for the added cost and risk. Do not collect data for undefined future use.

  • Collect the least sensitive form of data. If you must collect data, collect it anonymously if possible. Collect personal data only if you are absolutely certain you need it. If you must include an ID, use one that has a short life span (for example, lasting a single session). Use less sensitive forms of data (for example, telephone area code rather than full phone number). Whenever possible, aggregate personal data from many individuals.

  • Provide a prominent notice and obtain explicit consent before transferring personal data from the user's computer. Before you transfer any personal data, you must tell the user what data will be transferred, how it will be used, and who will have access to it. Important aspects of the transfer must be visible to the user in the user interface.

  • Prevent unauthorized access to personal data. If you store or transfer personal data you must help protect it from unauthorized access, including blocking access to other users on the same system, using technologies that help protect data sent over the Internet, and limiting access to stored data.

  • Get parental consent before collecting and transferring a child's personal data. Special rules for interacting with children apply any time you know the user is a child (because you know the child’s age) or when the content is targeted at or attractive to a child.

  • Provide administrators with a way to prevent transfers. In an organization, the administrator must have the authority to say whether any data is transferred outside the organization's firewall. You must identify or provide a mechanism that allows the administrator to suppress such transfers. This control must supersede any user preferences.

  • Honor the terms that were in place when the data was originally collected. If your team decides to use data, its use must be subject to the disclosure terms that were presented to the user when it was collected.

  • Provide users access to their stored personal data. Users have a right to inspect the personal data you collect from them and correct it if it is inaccurate—especially contact information and preferences. You also need to ensure that the user is authenticated before he or she is allowed to inspect or change the information.

  • Respond promptly to user questions about privacy. Inevitably, some users will have questions about your practices. It is essential that you respond quickly to such concerns. Unanswered questions cause a loss of trust. Be sure a member of your staff is ready to respond whenever a user asks about a privacy issue.

Sunday, June 15, 2008

Java Pattern and Practices


ShareThis
Java is a vast language that has initiated many new coding patterns and practices.
I have been fond of Java programing though my productivity centralizes on Dot Net Platform.

Here I found many of the patterns and practices documented / listed at a single place.
It can be a good repository for learners :
http://mindprod.com/
http://mindprod.com/jgloss/designpatterns.html