CB3591 Engineering Software Secure System Notes
CB3591 Engineering Software Secure System Notes
Introduction
Software is everywhere. We all rely on complex, interconnected, software intensive
information systems that use the internet as their means for communicating and transporting
information. Building, deploying, operating and using software that has not been developed
with high security in mind can be high risk. Here we discusses why security is increasingly a
software problem. It defines the dimensions of software assurance and software security. It
identifies threats that target most software and the shortcomings of the software development
process that can render software vulnerable to threats.
Software assurance has become critical because dramatic increases in business and mission
risks are now known to be attributable to exploitable software.
The growing extent of the resulting risk exposure is rarely understood, as evidenced by these
facts:
• Software is the weakest link in the successful execution of interdependent
systems and software applications.
• Software size and complexity obscure intent and preclude exhaustive testing.
• Outsourcing and the use of unvetted software supply-chain components
increase risk exposure.
• The sophistication and increasingly more stealthy nature of attacks
facilitates exploitation.
• Reuse of legacy software with other applications introduces unintended
consequences, increasing the number of vulnerable targets.
• Business leaders are unwilling to make risk-appropriate investments in
software security.
According to the U.S. Committee on National Security Systems’ “National
Information Assurance (IA) Glossary”, software assurance is the level of confidence that
software is free from vulnerabilities, either intentionally designed into the software or
accidentally inserted at any time during its life cycle, and that the software functions in the
intended manner.
• Software assurance includes the disciplines of software reliability (also known
as software fault tolerance), software safety, and software security.
• The focus of Software Security Engineering: A Guide for Project
Managers is on the third of these, software security, which is the ability of
software to resist, tolerate, and recover from events that intentionally threaten
its dependability.
• The main objective of software security is to build more-robust, higher-
quality, defect-free software that continues to function correctly under
malicious attack.
The objective of software security is to field software-based systems that satisfy the
following criteria:
• The system is as vulnerability and defect free as possible.
• The system limits the damage resulting from any failures caused by attack-
triggered faults, ensuring that the effects of any attack are not propagated, and
it recovers as quickly as possible from those failures.
• The system continues operating correctly in the presence of most attacks by
either resisting the exploitation of weaknesses in the software by the attacker
or tolerating the failures that result from such exploits.
Software that has been developed with security in mind generally reflects the following
properties throughout its development life cycle:
Predictable execution. There is justifiable confidence that the software, when executed,
functions as intended. The ability of malicious input to alter the execution or outcome in a
way favorable to the attacker is significantly reduced or eliminated.
Trustworthiness. The number of exploitable vulnerabilities is intentionally minimized to the
greatest extent possible. The goal is no exploitable vulnerabilities.
Conformance. Planned, systematic, and multidisciplinary activities ensure that software
components, products, and systems conform to requirements and applicable standards and
procedures for specified uses.
These objectives and properties must be interpreted and constrained based on the practical
realities that you face, such as what constitutes an adequate level of security, what is most
critical to address, and which actions fit within the project’s cost and schedule. These are
risk management decisions.
To achieve attack resilience, a software system should be able to recover from failures that
result from successful attacks by resuming operation at or above some predefined minimum
acceptable level of service in a timely manner. The system must eventually recover full
service at the specified level of performance. These qualities and properties, as well as attack
patterns.
• Projects that achieve lower defect rates typically have shorter schedules. But
many organizations currently develop software with defect levels that result in
longer schedules than necessary.
• The “95 percent defect removal” line is significant because that level of
prerelease defect removal appears to be the point at which projects achieve the
shortest schedules for the least effort and with the highest levels of user
satisfaction.
• If more than 5 percent of defects are found after a product has been released,
then the product is vulnerable to the problems associated with low quality, and
the organization takes longer to develop its software than necessary.
• Projects that are completed with undue haste are particularly vulnerable to
short changing quality assurance at the individual developer level. Any
developer who has been pushed to satisfy a specific deadline or ship a product
quickly knows how much pressure there can be to cut corners because “we’re
only three weeks from the deadline.”
• As many as four times the average number of defects are reported for released
software products that were developed under excessive schedule pressure.
Developers participating in projects that are in schedule trouble often become
obsessed with working harder rather than working smarter, which gets them
into even deeper schedule trouble.
• One aspect of quality assurance that is particularly relevant during rapid
development is the presence of error-prone modules—that is, modules that are
responsible for a disproportionate number of defects.
• They often are developed under excessive schedule pressure and are not fully
tested. If development speed is important, then identification and redesign of
error-prone modules should be a high priority.
• If an organization can prevent defects or detect and remove them early, it can
realize significant cost and schedule benefits. Studies have found that
reworking defective requirements, design, and code typically accounts for 40
to 50 percent of the total cost of software development.
• As a rule of thumb, every hour an organization spends on defect prevention
reduces repair time for a system in production by three to ten hours. In the
worst case, reworking a software requirements problem once the software is in
operation typically costs 50 to 200 times what it would take to rework the
same problem during the requirements phase. It is easy to understand why this
phenomenon occurs.
• For example, a one-sentence requirement could expand into 5 pages of design
diagrams, then into 500 lines of code, then into 15 pages of user
documentation and a few dozen test cases. It is cheaper to correct an error in
that one-sentence requirement at the time requirements are specified
(assuming the error can be identified and corrected) than it is after design,
code, user documentation, and test cases have been written.
• The below Figure illustrates that the longer defects persist, the more expensive
they are to correct.
• The savings potential from early defect detection is significant: Approximately
60 percent of all defects usually exist by design time.
• A decision early in a project to exclude defect detection amounts to a decision
to postpone defect detection and correction until later in the project, when
defects become much more expensive and time-consuming to address.
• When a software product has too many defects, including security flaws,
vulnerabilities, and bugs, software engineers can end up spending more time
correcting these problems than they spent on developing the software in the
first place.
• Project managers can achieve the shortest possible schedules with a higher-
quality product by addressing security throughout the SDLC, especially during
the early phases, to increase the likelihood that software is more secure the
first time.
Making the business case for software security: current state
• As software project managers and developers, we know that when we want
to introduce new approaches in our development processes, we have to
make a cost–benefit argument to executive management to convince them
that this move offers a business or strategic return on investment.
• Executives are not interested in investing in new technical approaches
simply because they are innovative or exciting. For profit making
organizations, we need to make a case that demonstrates we will improve
market share, profit, or other business elements.
• For other types of organizations, we need to show that we will improve
our software in a way that is important—in a way that adds to the
organization’s prestige, that ensures the safety of troops in the battle field,
and so on.
Managing Secure Software Development
Which security strategy questions should I ask?
Achieving an adequate level of software security means more than complying with
regulations or implementing commonly accepted best practices.
Consider the following questions from an enterprise perspective. Answers to these questions
aid in understanding security risks to achieving project goals and objectives.
• What is the value we must protect?
• To sustain this value, which assets must be protected? Why must they be
protected?
• What happens if they’re not protected?
• What potential adverse conditions and consequences must be prevented and
managed? At what cost? How much disruption can we stand before we take
action?
• How do we determine and effectively manage residual risk (the risk
remaining after mitigation actions are taken)?
• How do we integrate our answers to these questions into an effective,
implementable, enforceable security strategy and plan?
The answers to these questions can help you determine how much to invest, where to invest,
and how fast to invest in an effort to mitigate software security risk.
In the absence of answers to these questions (and a process for periodically reviewing and
updating them), you (and your business leaders) will find it difficult to define and deploy an
effective security strategy and, therefore, may be unable to effectively govern and manage
enterprise, information, and software security.
A risk management framework for software security:
• A necessary part of any approach to ensuring adequate software security is the
definition and use of a continuous risk management process. Software security
risk includes risks found in the outputs and results produced by each life-cycle
phase during assurance activities, risks introduced by insufficient processes,
and personnel-related risks.
• The risk management framework (RMF) introduced here and it can be used to
implement a high-level, consistent, iterative risk analysis that is deeply
integrated throughout the SDLC.
• The below Figure shows the RMF as a closed-loop process with five activity
stages. Throughout the application of the RMF, measurement and reporting
activities occur. These activities focus on tracking, displaying, and
understanding progress regarding software risk.
• The above Figure depicts one example of how to incorporate security into
the SDLC using the concept of touchpoints. Software security best
practices (touchpoints shown as arrows) are applied to a set of software
artifacts (the boxes) that are created during the software development
process.
• The intent of this particular approach is that it is process neutral and,
therefore, can be used with a wide range of software development
processes (e.g., waterfall, agile, spiral, Capability Maturity Model
Integration [CMMI]).
• Security controls in the software’s life cycle should not be limited to the
requirements, design, code, and test phases. It is important to continue
performing code reviews, security tests, strict configuration control, and
quality assurance during deployment and operations to ensure that updates
and patches do not add security weaknesses or malicious logic to
production software.
• Additional considerations for project managers, including the effect of
software security requirements on project scope, project plans, estimating
resources, and product and process measures.
DEFINING PROPERTIES OF SECURE SOFTWARE
• Before we can determine the security characteristics of software and look
for ways to effectively measure and improve them, we must first define the
properties by which these characteristics can be described.
• These properties consist of
(1) a set of core properties whose presence (or absence) are the
ground truth that makes software secure (or not) and
(2) a set of influential properties that do not directly make
software secure but do make it possible to characterize how
secure software is.
Core Properties of Secure Software
Several fundamental properties may be seen as attributes of security as a software property,
as shown in below Figure:
• Dependability
• Correctness
• Predictability
• Reliability
• Safety
These influential properties are further influenced by the size, complexity, and traceability
of the software. Much of the activity of software security engineering focuses on addressing
these properties and thus targets the core security properties themselves.
Dependability and Security
• In simplest terms, dependability is the property of software that ensures
that the software always operates as intended. It is not surprising that
security as a property of software and dependability as a property of
software share a number of subordinate properties (or attributes). The most
obvious, to security practitioners, are availability and integrity.
• To better understand the relationship between security and dependability,
consider the nature of risk to security and, by extension, dependability.
• A variety of factors affect the defects and weaknesses that lead to
increased risk related to the security or dependability of software.
• But are they human-made or environmental?
• Are they intentional or unintentional?
• If they are intentional, are they malicious?
• Nonmalicious intentional weaknesses often result from bad judgment.
• For example, a software engineer may make a tradeoff between
performance and usability on the one hand and security on the other hand
that results in a design decision that includes weaknesses.
• While many defects and weaknesses have the ability to affect both the
security and the dependability of software, it is typically the intentionality,
the exploitability, and the resultant impact if exploited that determine
whether a defect or weakness actually constitutes a vulnerability leading to
security risk.
• Note that while dependability directly implies the core properties of
integrity and availability, it does not necessarily imply confidentiality,
accountability, or non-repudiation.
Correctness and Security
• From the standpoint of quality, correctness is a critical attribute of
software that should be consistently demonstrated under all anticipated
operating conditions.
• Security requires that the attribute of correctness be maintained under
unanticipated conditions as well.
• One of the mechanisms most commonly used to attack the security of
software seeks to cause the software’s correctness to be violated by
forcing it into unanticipated operating conditions, often through
unexpected input or exploitation of environmental assumptions.
• Correctness under anticipated conditions (as it is typically interpreted) is
not enough to ensure that the software is secure, because the conditions
that surround the software when it comes under attack are very likely to be
unanticipated.
• Most software specifications do not include explicit requirements for the
software’s functions to continue operating correctly under unanticipated
conditions. Software engineering that focuses only on achieving
correctness under anticipated conditions, therefore, does not ensure that
the software will remain correct under unanticipated conditions.