Home > Articles > Programming > Windows Programming

Implementing Security in B2B Applications

  • Print
  • + Share This
Lyn Robison details security development in B2B applications, especially how to implement security and content access.
This sample chapter is excerpted from Implementing B2B Commerce with .NET: A Guide for Programmers and Technical Managers, by Lyn Robison.
This chapter is from the book

This chapter gives details of security development in B2B applications, especially how to implement security and content access. Chapter 8 focuses on why security threats exist and where the threats come from. Chapter 8 also gives an introduction to encryption, public and private keys, digital certificates, and SSL. You may want to refer to that chapter for context on the implementation advice presented in this chapter. The key points for this chapter are the following:

  • A B2B Web site aggregates multiple extranets into a single site.

  • A B2B Web site provides the security context in which commerce between companies can be conducted online.

  • Application software used by businesses today is typically not built to run in a B2B environment, so developers must somehow bolt security and content access control onto these applications.

  • Role-based security is not sufficient for typical B2B Web sites.

  • Developers can build a powerful, permission list-based access control system using a SQL database, and they can expose the security settings that are stored in the database to content managers with Web browsers.

2.1 Security, a Primary Role of B2B Web Sites

Every company has information and applications that it uses internally, as well as customers and partner businesses that it works with externally. When a company exposes its internal information to its external customers, it needs to do so in the right context. And when customers obtain information from a company, they need to obtain that information in the right context. A B2B Web site provides that context.

A primary function of a B2B Web site is to secure the flow of information between businesses. A B2B Web site provides the security context in which online commerce can be conducted.

2.1.1 A Real-World Example of a Fundamental B2B Design Pattern

Recently I met some people from a Fortune 500 company who were very interested in implementing B2B Internet commerce. This company is a manufacturer in a particular industry, but their example is broadly applicable, so I'll refer to them with the generic name "Manufacturer A." In fact, their example is so broadly applicable, that it constitutes a fundamental design pattern that builders of B2B applications will encounter again and again.

Manufacturer A maintains numerous lucrative business relationships with several Fortune 500 companies. In some of these relationships, Manufacturer A is the buyer, and in others it is the seller. In all of these relationships, a large quantity of contextual information supplements each transaction. (Here I am not referring to computer science-type ACID transactions, but rather I am using the term transaction merely to mean a purchase or sale of goods or services.) Information in diverse forms is exchanged between Manufacturer A and its business partners. Information is exchanged both in advance of each transaction and after each transaction is completed. Sometimes information is exchanged for the express purpose of keeping the relationship between the companies alive and healthy.

Information is exchanged on products, prices, designs, shipments, estimates, recommendations, proposals, contracts, clarifications, problems, replacements, questions, answers—you name it. And this information is exchanged through several different, and often inefficient, mediums, including fax, e-mail, telephone, voice mail, snail mail, and face-to-face.

It is important to note that information is exchanged in the context of the particular relationship between Manufacturer A and its individual business partners. For example, the information that Manufacturer A provides to Company B is tailored to Company B. Another company, such as Company C, should never see any of Company B's confidential information. Thus every relationship between businesses has its own security context, which defines what information is to be exchanged between the parties. (At this level of discussion, the security context is an abstract idea, and I am not yet referring to any concrete implementation of a security context in software.) A manager I know at Manufacturer A realized that he could use the Internet to enhance greatly his company's relationships with its various business partners. This manager felt that if he could build an extranet site that is secure and tailored to Company B, he could use it efficiently to exchange information and perform transactions with Company B. He realized that a secure extranet site would be a more efficient medium in which to conduct business than the current mishmash of faxes, e-mails, phone calls, voice mails, letters, and meetings.

He decided that, ideally, Manufacturer A's extranet site should look and act like it is part of Company B's intranet. In other words, the site should be unique and tailored for Company B. Such a Web site would make it easier for the people at Company B to conduct business with his company.

He also realized that if he were to set up an extranet site for each of his company's business partners, they could all conduct business more readily with his company. This idea is illustrated in Figure 2-1.

Figure 2-1FIGURE 2-1 Extranets Provide the Security Contexts for B2B Applications

As you can see in Figure 2-1, each extranet site provides a security context in which information is exchanged and transactions are conducted with each individual business partner. It is important to note again that information is exchanged in the context of the particular relationship between Manufacturer A and each individual business partner.

This is a prevalent design pattern in B2B commerce. The relationship between two businesses defines the security context in which information is exchanged.

Unlike the illustration in Figure 2-1, a company will probably not want to implement a separate extranet site for each of its customers and partners. Rather, the company will want a single Web site that can function like a chameleon and change its appearance based on its context. This is what a B2B Web site does, as illustrated in Figure 2-2.

Figure 2-2FIGURE 2-2 A Single B2B Web Site Aggregates Multiple Extranet Sites

A B2B Web site contains and aggregates multiple extranets. The idea is one URL— multiple Web sites. This means that a customer can visit the B2B Web site, and based on who they are, what they do, and what company they work for, the Web site dynamically changes its skin and its content to match that customer's context.

Therefore, when I say, "B2B Web site," think "extranet site that changes its skin and content to match the user who is viewing it."

When it comes to concrete implementations in the B2B world, a company can't deploy applications that don't work within the security context of each partner's relationship. For example, you can't buy an online product catalog system off the shelf and expect it to work in a B2B environment unless that product catalog system knows how to work within the proper security context. You don't want that product catalog application to take the specialized products and prices that you intended for Company B and expose them to Company C also. You want the products and prices for Company B to be accessible only to users from Company B.

If the product catalog is a complex application that was designed without any B2B-type security context in mind and if you don't have access to the source code for that catalog app, it might be difficult for you to bolt on that security context. For many applications, this security context must exist at the schema level, with the app designed and built using the security schema as its foundation. For a catalog application to expose certain products and prices only to certain companies, it needs a schema that enables a particular company or set of companies to be associated with each item in the catalog, or perhaps with each attribute of each item in the catalog.

Traditionally, software applications have been built for use only inside the protected walls of a business, with no thought given to the prospect of these applications being opened up for access by users outside the company. External access, and the requisite security that it demands, is typically not considered when designing the security features of software applications, and information systems in general are not constructed with external security in mind.

For a company to implement Internet commerce between businesses, it has to find a way to bolt access controls onto applications that were designed to work only inside the walls of the company. The company needs to provide secure, Web-based access to its backend applications for each of its relevant customers. Furnishing this security is a primary function of a B2B Web site.

When I talk to developers who are new to B2B development, a question I often hear is "Is all of this security really necessary?" The best answer I can give is to explain that in every one of the dozens of B2B development projects I have been involved with, the business managers, the people driving the design of the application, always pushed the envelope of the app's access control system. When it comes to opening up their sensitive business data to customers and partners outside the company, business managers always want robust and highly granular control of who has access to what.

It turns out that providing a highly granular level of content access control can be tricky to implement. I have noticed a common misconception among developers who assume that role-based security is the answer to virtually any security problem. In my experience, group- or role-based security is inadequate for typical B2B applications.

For example, a company that owns a B2B Web site might have a document that it wants to make available only to executives of their supplier companies. With role-based security, the company's content manager on the B2B site could create a role called Executives and another role called Suppliers. However, the problem is that you typically cannot do a logical AND between the roles with role-based security. Set-based operations between the roles are not available in typical role-based security systems.

The content manager might specify the Executive's role and the Supplier's role as having access to this document, but that would mean that anyone who is an executive, whether he or she works for a supplier or not, and anyone who works for a supplier, whether he or she is an executive or not, would be able to access this document. In other words, granting access to the Executive's role and the Supplier's role creates a logical OR between the roles, which is a union of the sets of Executives and Suppliers.

To create a logical AND between the roles, the content manager would have to hardwire it into another role called SupplierExecutives, which would be the intersection of the Executive's role and the Supplier's role. The problem with this approach is that the number of roles the content manager must create mushrooms as it becomes apparent how many logical ANDs are required between their various roles. As the roles proliferate, they become difficult to manage. In addition, performing the security checks, whether at login time or each time a resource is accessed, can become a significant drag on performance.

There is another limitation with the role-based security found in operating systems and databases that makes it inadequate for B2B applications. Typically there is a requirement that content managers on the B2B Web site must be able to administer the content access settings. The problem is that content managers are generally not system administrators or database administrators or developers; they are nontechnical business users who are responsible for content on the site and who want to specify who can see what.

So B2B application developers cannot expect these nontechnical content managers to run any operating system administration utilities or database administration utilities to administer the content access control on the B2B Web site. I mention this not as a complaint about these utilities but rather to point out that developers of B2B applications cannot assume their users will be able to use them effectively. Therefore developers have to build administration screens for content access settings that are more elegant than those utilities based on the (lack of) technical savvy of the content managers.

The bottom line is that for B2B applications, developers must create application-level security that is more powerful than system-level group or role-based security and at the same time is easier to use than operating system and database administration screens.

Later in this chapter, I describe a permission list–based access control algorithm that enables security to be applied to distinct resources on a Web site. Those resources could be individual documents or pages. The granularity of the algorithm can be extended to apply security to portions of pages and to methods on Web services.

This permission list–based access control algorithm is implemented using a few tables and stored procedures in SQL Server, which could be exposed to nontechnical content managers on a B2B Web site using elegant and simple HTML forms. But before getting into the SQL schema and code, there are a few fundamental concepts on implementing security that must be clarified.

  • + Share This
  • 🔖 Save To Your Account