CISSP Domain 8 - Flashcards
Defining Good Code - Quality
- How fit for a purpose something is
- When developing software: It’s usually thought of after the fact
- Keys to ensuring quality:
- Code Reviews
- Interface Testing
- Misuse cases
Defining Good Code - Software Controls
To address input, output, encryption, logical flow, methods for performing calculations, interprocess communication, access, and interaction with other software
Defining Good Code - Security Controls
- Usually technical
- Will depend on:
- Application’s purpose
- Environment in which it will run
- Sensitivity of the data it will process
- Functionality it will execute
- Security policy attached to it
- Example: If software will only be run behind 3 firewalls and accessible only by an administrator, it will have fewer security requirements. If it is a publicly-accessible web application it will be subject to quite a few very restrictive security controls
Where Do We Place Security? - Introduction
- Software is responsible for the vast majority of vulnerabilities
- The importance of implementing proper security in software is a relatively new focus
- It is very uncommon to find a software developer who is also a security professional
- Software vendors are trying to get products to market as soon as possible and do not make security a priority
- Customers have become accustomed to receiving software with security flaws that are then patched
- Customers cannot fix the security flaws in software they purchase, so they resort to perimeter solutions
Where Do We Place Security? - Environment vs. Application
- Environment (At the OS)
- Great to ensure a consistent approach, but the OS has no visibility or control of access activities within an application
- Perimeter devices are more reactive in nature: they protect best against known vulnerabilities that are discovered over time
- Application
- Provides very granular control, but does nothing for security outside of the application, including any external resource the application requires
- The more functionality that is packed into an application, the more difficult it becomes to achieve a good level of security hygiene
Where Do We Place Security? - Implementation and Default Issues
- Software should default to ‘No Access’ after installation
- Security patches: Often not installed because the administrator:
- Does not keep up to date on security vulnerabilities
- May not realize the importance of applying patches
- Might fear the patches will cause other problems
Software Development Life Cycle - Introduction
SDLC: Concerned with creating a repeatable and predictable process that development teams will follow
- Desired results
- Higher level of product quality
- Fewer missed deadlines
- Lower cost
- Acceptable level of functionality
Software Development Life Cycle - Phases
- Requirements gathering: Figure out what the product will do when completed
- Design: Plan how the product will be put together
- Development: Put the product together
- Testing/validation: Make sure the product does what the requirements said it should do
- Release/maintenance: Ship the product and update as-needed
Software Development Life Cycle - Phases with a Security Perspective
- Requirements gathering
- Security risk assessment
- Privacy risk assessment
- Risk-level acceptance
- Informational, functional and behavioral requirements
- Design
- Attack surface analysis
- Threat modeling
- Development
- Automated CASE tools
- Static analysis
- Testing/validation
- Dynamic analysis
- Fuzzing
- Manual testing
- Unit, integration, acceptance and regression testing
- Release/maintenance
- Final security review
Software Development Life Cycle - Project Management - Introduction
- Ties together all of the pieces required to deliver a product
- Specifically ensures that each phase is addressed properly
Software Development Life Cycle - Project Management - Security management
- Part of PM in which a security plan is created from the beginning
- It must be able to stand alone and have its own lifetime
- Will be referenced after the project has been completed during audits and as a way to validate the product meets specific security objectives
Software Development Life Cycle - Project Management - Statement of work (SOW)
- Drives software projects being developed for specific customers
- Helps clarify customer requirements
Software Development Life Cycle - Project Management - Scope Creep
- Addition of new requirements not originally envisioned
* Project management must ensure that it adheres to the SOW closely to avoid it
Software Development Life Cycle - Project Management - Work Breakdown Structure (WBS)
- Defines the tasks and subtasks that are required to meet the stated requirements
- The SDLC depends on it to be accurate
Software Development Life Cycle - Requirements Gathering Phase - Focus
- What the finished product should be capable of
- What it should look like
- How it should behave
Software Development Life Cycle - Requirements Gathering Phase - Security related tasks
- Security requirements
- Security risk assessment
- Privacy risk assessment
- After completing it, we assign a privacy impact rating to each data element
- Privacy Impact Ratings
- P1: High Privacy Risk: PII is routinely handled and stored
- P2: Moderate Privacy Risk: PII is handled in a one-time, user-initiated data transfer
- P3: Low Privacy Risk: No PII is handled or stored
- Risk-level acceptance: All possible risks will probably not be addressed, so the team should address the most important ones first
Software Development Life Cycle - Requirements Gathering Phase - Models for Software Requirements
- Informational model: Lists the type of information to be processed and how they are processed
- Functional model: Lists the tasks and functions an application needs to provide
- Behavioral model: Lists the states the application will be in during and after specific transactions take place
Software Development Life Cycle - Design Phase - Introduction
- Takes each requirement and shows how the product will meet it
- Skipping this step: Unstable and insecure product
Software Development Life Cycle - Design Phase - Outputs
- Data design
- Architectural design
- Procedural design
Software Development Life Cycle - Design Phase - Attack Surface
- Portion of the application visible to an attacker
- It’s made as small as possible by reducing
- The amount of code running
- Entry points
- Privilege levels
- Unnecessary services
- Attack surface analysis
- Automated scan of an application resulting in a report
- Looks at files, registry entries, data stored in memory, session information, and process and service details
- End goal: Identify and reduce the amount of code and/or functionality that is accessible by untrusted users
Software Development Life Cycle - Design Phase - Threat modeling
- Imagining various malicious scenarios and designing the software to counteract the threats
- Threat Tree
- Useful tool to visualize and document various attack vectors into the software
- Visually shows each threat and how it is related to other threats
Software Development Life Cycle - Development Phase - Introduction
- The design is broken down into scheduled deliverables, and developers get down to work
- Computer-Aided Software Engineering (CASE) tool
- To auto-generate code
- Create automated tests
- Handle debugging activities
- Writing secure code is not an easy task
- Most vulnerabilities result from poor programming practices
Software Development Life Cycle - Development Phase - Common mistakes
- Not checking the input length to avoid buffer overflows
- Not inspecting code to prevent the use of covert channels
- Not checking/enforcing proper data types
- Not ensuring checkpoints cannot be bypassed by users
- Not verifying proper syntax
- Not verifying checksums
Software Development Life Cycle - Development Phase - Buffer Overflows
- Can result in Privilege Escalation:
- This is the act of exploiting a process or configuration setting to gain access to resources that normally are off limits to the process or user
- Can be mitigated by
- Using input validation
- Ensuring least privilege
Software Development Life Cycle - Development Phase - Static Analysis
- Process of examining the source code for defects or security policy violations
- Limitation: cannot understand logic flows
Software Development Life Cycle - Testing/Validation Phase - Approaches to Testing
- Unit Testing: Testing individual components
- Integration Testing: Testing multiple components working together
- Acceptance Testing: Testing to ensure the application meets the customer’s requirements
- Regression Testing: After a change, rerunning all previously passing tests to ensure the application is still on solid footing
Software Development Life Cycle - Testing/Validation Phase - Unit Testing
- Automated test that will exercise individual code modules or classes
- Simulates a range of inputs and checks the resulting output for the expected result. This ensures the code will always run in an expected and secure manner
- Allows the software to be automatically retested at any point to validate that changes have not introduced new defects
Software Development Life Cycle - Testing/Validation Phase - Test-Driven Development (TDD)
- The unit test is written first, followed by the source code that will pass the test
- If done properly, it can result in superior code
Software Development Life Cycle - Testing/Validation Phase - Separation of duties
A separate team should beresponsible for formal testing
Software Development Life Cycle - Testing/Validation Phase - Testing
- Should happen in an environment that mirrors the production environment as close as possible
- The identified risk must be expressed in terms of a repeatable test that proves that the vulnerability has been mitigated to an acceptable level
Software Development Life Cycle - Testing/Validation Phase - Security Testing
- Should use:
- Manual Testing: Needs to be carried out by testers skilled in the security area, and sometimes involves the use of social engineering
- Automatic Testing
Software Development Life Cycle - Testing/Validation Phase - Fuzzing
- Attack technique in which a large amount of randomly malformed and unexpected inputs are provided to an application
- Fuzzing tools: Used for discovering:
- Buffer overflows
- DoS vulnerabilities
- Validation problems
- Injection weaknesses
- Any other input that can cause a crash, freeze or unexpected errors
Software Development Life Cycle - Testing/Validation Phase - Dynamic Analysis
- An application is being evaluated in real-time as it is running
- Profiles the application and checks for memory leaks or dependencies without having access to the source code
Software Development Life Cycle - Testing/Validation Phase - Problems
1) Reported to the development team
2) The development team addresses the issues
3) More testing to ensure the issues were properly fixed
4) This cycle continues until everyone agrees the application is ready for production
4a) If the application is intended for a specific customer, that customer should perform their own testing and formally accept the product when they are satisfied
Software Development Life Cycle - Testing/Validation Phase - Verification/Validation
- Verification: Does the product meet the requirements as written?
- Validation: Does the product meet the original goal as it was envisioned?
- It is possible for a product to be verified, but not valid due to missed or incorrect requirements. It is extremely unlikely that a product could ever be valid but fail verification
Software Development Life Cycle - Release/Maintenance Phase - Patches
- More issues are almost guaranteed to appear
- The development team will address the issue by creating them
- The patch will need to be tested and formally accepted, followed by a rollout to the already installed product
Software Development Life Cycle - Release/Maintenance Phase - Zero-Day Vulnerability
When an issue with software is discovered, it remains a zero-day vulnerability until a patch, update or a configuration change is made available that will address it
Software Development Models - Build and fix model
- Used when a development team follows no formal SDLC model
* No formal requirements or design phases
Software Development Models - Waterfall Model
- Linear-sequential life-cycle approach
- Each phase must come to a complete close before the next phase is allowed to begin
- At the end of each phase, a review is held
- Once the next phase is started, there is no capability to go back and change the output from a previous phase
- It is virtually impossible to know all requirements up-front, so the entire process must be completed before changes can be made on the next release
- Phases
- Feasibility
- Analysis
- Design
- Implement
- Test
- Maintain
Software Development Models - V-Shaped Model
- Allowing testing to start earlier and continue throughout the entire SDLC
- Higher chance of success than the Waterfall model, but not by much
Software Development Models - Prototyping
- Prototype: Simple model of a complex idea that can be used to vet or explore that complex idea without investing too much time or effort
- Rapid Prototype: Creates a ‘throwaway’ product with just enough functionality to decide whether it is worth pursuing
- Evolutionary Prototype: Not intended to be discarded, but rather incrementally improved upon until it reaches full maturity and can be placed into production
- Operational Prototype: Same as an evolutionary prototype but it is designed to be placed into production immediately and ‘tweaked’ on-the-fly as customer feedback is received
Software Development Models - Incremental Model
- Involves iterations of something similar Waterfall Model
- After each iteration of the entire SDLC, the customer provides feedback (i.e. more requirements) and the team goes back to the beginning with the new set of requirements and enhances the previous product.
- Phases of each iteration
- Analysis
- Design
- Code
- Test
Software Development Models - Spiral Model
- Uses an iterative approach
- Employed when a focus on risk analysis is desired
- Good choice for complex projects in which requirements change often
- Phases
- Determine objectives
- Identify and resolve risks
- Development and test
- Plan the next iteration
Software Development Models - Rapid Application Model (RAD)
- Working product is quickly developed
- The intention is to use the product to elicit requirements, as opposed to using the requirements to build the product
- It is a good fit when the customer is unsure of what they want, or requirements are guaranteed to change quickly and often at the beginning of a project
- Phases
- Analysis and quick design
- RAD (build, demonstrate, refine)
- Testing
- Implementation
Software Development Models - Agile Models - Introduction
- Approaches that emphasize incremental product deliveries built on continuous-feedback from the customer
- User Story: A simple description of a single feature written by an end-user
- Agile models do not use prototypes. Instead, they break the product down into smaller features that are being continuously delivered
Software Development Models - Agile Models - Scrum
- Most widely recognized Agile model
- Can handle projects of any size
- Very focused on customer feedback
- Recognizes upfront that customer needs will never be fully understood and will change. Therefore, focus is put on close collaboration with the customer and continuous delivery
- Allows for interruptions at clearly defined points (sprints), after which everyone gathers back together and puts the ball back into play
- Sprints:
- Pre-defined interval (usually 2 weeks) during which the customer is not allowed to make changes
- At the end of each sprint, the customer has the freedom to completely change direction if it so desires
- At the beginning of each sprint, the development team selects the user stories, starting at the top of the backlog
- Backlog: Prioritized list of user stories
Software Development Models - Agile Models - Extreme Programming (XP)
- Relies on Pair Programming
- Developers work in pairs, with one developer telling the other what to type
- Two eyes are constantly reviewing the code as it is being written, which reduces code complexity as well as errors
- Requires test-driven development (TDD)
- The test is written before any code is laid down, so it will immediately fail
- Code is added until the test passes
Software Development Models - Agile Models - Kanban
- Stresses a visual tracking of development tasks, resulting in a just-in- time delivery of features
- Kanban wall
- Sticky notes representing each task and the wall being divided up into vertical sections, with the sections usually being labelled Planned, In Progress and Done
- Developers will always take the top sticky note in the Planned column when they free up
Software Development Models - Agile Models - Exploratory Model
Used when the goals of a project are not well-known, but final specifications that the product must meet are known
Software Development Models - Agile Models - Joint Application Development (JAD)
Can be used when non-developers are able to dedicate their full time to the project and sit with the development team as work progresses
Software Development Models - Agile Models - Reuse Model
Assumes that existing prototypes have already been created and are progressively enhanced
Software Development Models - Agile Models - Cleanroom Model
- Used when preventing errors and mistakes is the highest priority
- Achieved by using structured and formal methods for development and testing
- Usually employed for extremely high-quality and mission-critical applications that will need to pass a strict certification process.
Integrated Product Team - Definition
- Made up from
- Development team
- Representatives from each stakeholder
- More focused on internal customers than external customers
- IPT is not a methodology, but works well with certain methodologies such as JAD or Agile
Integrated Product Team - DevOps
- Intersection of
- Software development
- IT
- QA
- Security is the big winner as it is addressed from the beginning because of IT’s involvement
Capability Maturity Model Integration (CMMI) - Introduction
- Software industry:
- Multiple versions of a capability maturity model (CMM)
- CMM: Attempts to provide guidelines for best-practiced development processes
- CMMI:
- Developed to combine them all into a single cohesive set
- Used as a set of guidelines on establishing a mature software development process
- Companies can become CMMI certified by third-parties
Capability Maturity Model Integration (CMMI) - Maturity Levels
Each level builds on the previous levels: they are accumulative
- Level 1: Initial: Process is unpredictable, poorly controlled and reactive
- Level 2: Repeatable: Process within a project is repeatable
- Level 3: Defined: Process within an organization is repeatable
- Level 4: Managed: Process is quantitatively measured and controlled
- Level 5: Optimizing: Has a focus on continually improving the process
Change Control - Definition
- Process of controlling any changes that take place during a product’s lifetime and documenting the activities that result
- Should be in place at the beginning of a project or chaos will result
Change Control - Reasons for enforcing a change control process
- To have an agreed upon baseline before work starts: any changes may justify additional charges to the customer
- So the development team knows how to deal with changes as they happen
- To ensure changes do not negatively affect other components of the project
Change Control - Common change control process
- Make a formal request for a change
- Analyze the request
a. Develop the implementation strategy
b. Calculate the costs
c. Review security implications - Record the change request
- Submit the change request for approval
- Develop the change
a. Implement the change
b. Link the changes to the formal change control request
c. Test the software
d. Repeat until quality is adequate
e. Make version changes - Report results to management
Change Control - Software Configuration Management (SCM) - Introduction
- Tool that provides traceability throughout the lifetime of the project by tracking change requests as they are entered, approved and delivered to the customer
- Almost always used for implementing change control procedures related to software development
Change Control - Software Configuration Management (SCM) - Versioning systems
- Keeps track of each change made to a file
- At any point the current copy can be ‘rolled back’ to a previous version
- Keep track of the ‘who, what and when’ of each change