Showing posts with label software testing. Show all posts
Showing posts with label software testing. Show all posts

Monday, 23 May 2016

Why in Penetration Testing required?



Penetration Testing or Pentesting is a legal software attack on a software system which is carried out in order to uncover potential security weaknesses eventually gaining access to the data and features. Penetration testing can be described, executed and marketed in a lot many ways. It is often confused as a vulnerability scan, security assessment or a compliance audit. However, penetration testing stands apart from all in the following ways:



-      A penetration test is not over after detecting vulnerabilities. It proceeds forward to the next step to exploit the vulnerability to establish the attack vectors against the company’s data and assets.

-      The focus of penetration testing is on the team or individual testers and the experience they bring into practice. This is because even the most sophisticated technologies are vulnerable to the free thinking human mind which can analyze and synthesize, is capable of thinking more laterally and is driven by an unfading motive and determination.

-      A penetration testing is designed to evaluate effectiveness of the implemented security controls against a skilled human attacker. An organization with a 100% compliance may still be vulnerable against a human threat in the real world.

-      A penetration testing explores multiple attack vectors against the same target. Most of the successful compromises are generally the combination of vulnerabilities and information across different systems. 

There are many reasons for conducting penetration testing. The nature and scope of penetration testing is mainly dependant on the driving force of the organization, which in turn determines the goals of testing. This driving force also influences the other factors such as scope, target selection, assumptions as well as the budget amount allocated for the test.

Considerations for the Penetration Testing

-      Scope: For the purpose of testing it is very important what is to be scoped in and what should be scoped out of the target environment. Before test initiation, IP address ranges, external URLs and application should be clearly defined. Additional scope considerations include the acceptable level of social engineering interactions, physical access of tangible resources, etc.  In order to focus efforts on high value assets, the defined scope should always be prioritized. Limiting the scope increases the effort  of testing in the most important areas of the organization. It is important to maintain a balance in scope definition. If it is too broad, efforts may go stray and if it is too narrow, the testers may not get enough flexibility to explore all possible paths of exploitation.

-      The testing approach: The testing approach can be white box or black box. There are pros and cons of both these testing approaches. In case of the white box testing, less time and money is required for the identification of the tests and more can be invested in the actual exploitation process. However, it runs a potential risk of underestimating inside attackers and leaves them one step closer to the internal environment. On the other hand, the black box approach provides a better real life perspective of the system from the attacker’s point of view. It forces the hacker to spend time and effort in obtaining internal unauthorized information. This provides a good intel for the organization about potential breaches and enables them to take protective steps.

-      Objectives: Establishing the goals and objectives of the test is very important along with the scope. It helps to produce a report addressing the goals. Any objective of priority should be explicitly addressed in the goals. However, it should be taken into account that not all goals can be achieved despite repeated attempts. This is a positive outcome as  this ensures that the security stands tall.

Conclusion

At the end, all that matters is the real-world security. The effectiveness of penetration testing mainly depends on the people trusted with the task. Hence, after a security incident or a security testing, it is necessary for the company to determine the vectors which helped to gain access to the compromised syste

Tuesday, 8 March 2016

Implementing Continuous Security through DevOps



DevOps can be defined as a cultural change in work or a set of technology practices. It focuses on building a quality code, enabling automated testing based on a culture of continuous improvement eventually leading to improved stability and throughput and moving new features to customers quickly. Although DevOps is not a particular set of tools, but implementing DevOps practices leads to using certain tool sets.



-      The Version control systems track changes to the files and allow collaboration between teams. This leads to comparisons and merging of versions and rollbacks of issues. 

-      The Configuration management system automates new systems, enforces consistent application installation and configuration of system and application across different classes of servers. 

-      The ‘infrastructure as  code’ can be versioned and tested, ensuring that identical configurations are in place. This improves the odds that the software that was tested fine in the staging system will be fine in the production system as well. 

-      The automated system which helps to move through the build, deploy, test and release phase in the key component. 

Apart from the efficiency provided by DevOps, it can also create challenges in the implementation of security control infrastructures. Deployment through cloud reduces the control over the visibility of hardware and network layers. Further, it also complicates the tracking of hardware assets over time. DevOps blurs the limitations of the developers and operations and their duties are not well segregated.

Security teams need to be engaged early in the DevOps process in order to ensure continuous deployment. The following critical controls may be enforced in order to reduce potential security risks.

  1. Inventory of Authorized and Unauthorized Devices: In DevOps environment, the very idea of ‘devices’ and servers is obscured in layers of deployed containers and virtual machines. Hence, cloud provider portals and APIs can provide verification of automated inventory along with cloud assets as well.
  2. Inventory of Authorized and Unauthorized Software: The common practices of DevOps limit the servers to an approved list of the installed software. The configuration management tools can also be used to restrict to block software versions with known vulnerabilities.
  3. Secure configurations for Hardware and Software on Servers: Installing and running only the required softwares, keeping them updated and configured is one of the best ways minimizing attacks. Once the configurations for OS and applications are developed, DevOps greatly simplifies the process of syncing these configurations throughout the system.
  4. Continuous Assessment of vulnerability and Remediation: Keeping up with new vulnerabilities is a challenge. However, the DevOps environment provides a strong foundation for testing new patches. Deployment related security scans verify that all updates are addressed and reaches all intended targets.
  5. Security of Application Software: The DevOps automated deployment pipeline performs  the code review, static analysis and web application scanning before the new software is deployed in production. Further, security testing such as security related functionality, vulnerability scanning and application security scans can be run in parallel to acceptance testing within the staging environment.
  6. Controlled use of Administrative privileges: In a DevOps model, the code itself acts as a privileged user. Administrative privileges are used by configuration management that install new software, make configuration changes as per events and alerts. These credential secrets must only be used by orchestration systems and should not be made available to any unauthorized access.
As the DevOps movement matures,  security can no longer be considered as an afterthought, rather the best security practices need to be implemented into the DevOps evolution. Recently, there has been a considerable development of tools which help in securing DevOps environment. They range from repository firewalls, new application scanners, security functional test infrastructures to new SSH management solutions.

Conclusion

DevOps practices come with both advantages as well as disadvantages when Critical control based control infrastructure is implemented. The DevOps team needs to implement security early in the process to ensure a seamless deployment. The new security tools that is enforced for DevOps provides a new level of visibility and automation for security control implementations.

Thursday, 4 February 2016

Security Testing in Software Development Lify Cycle.



Security Testing ensures the confidentiality of the data. It can be started right from the requirement gathering phase of the Software Development Life Cycle. This can verify the fact that any intentional or unintentional actions are not able to stop or delay the system. The complexity of security testing is different in different phases. 







  1. Requirement Gathering:In this phase, we need to determine the level of security that the system may require while we assess the requirements. The level of security can vary through government level, bank level, e-commerce level, simple information level confidentiality, etc. Another consideration is the effort that can be invested with respect to security testing.
  2. Design Phase: Here, a detailed plan for Security testing needs to be created. This involves listing of the testing tools, manual approaches and the list of vulnerabilities that will be covered.
The different types of vulnerabilities can be defined as 

-      Data confidentiality
-      Authentication
-      Authorization
-      Integrity
-      Availability
-      Non-repudiation

The different types of techniques that can be applied are:

-      SQL Command Injection
-      Cross Site Scripting
-      Session Management and broken authentication
-      Insecure direct object references
-      Exposure of sensitive data
-      Security misconfiguration
-      Function level access control
-      Cross Site Request Forgery
-      Invalid redirects
-      Using vulnerable components.

- Development Phase: Here tools for static analysis can be used for security testing. This tool helps in identifying the security loop holes based on patterns and rules. Testing in this phase is the most recommended, as it involves unit level testing. Here, each code block is tested for potential bugs. These bugs if left unchecked, result in a bigger error at the later stages. Examples of such bugs 

-      Exception Handling
-      Ignored Return Values
-      Buffer Overruns
-      Complicated Functions

- Integration Phase: As the code blocks are integrated one by one to form the whole system, integration testing is performed. This is also known as black box testing. These tests are performed to eliminate security vulnerabilities before deployment. These uncovers errors that were missed out or were nonexistent in the unit level testing. It also detects configuration errors, potential security inconsistencies with third party applications and the overall system. 

- System Testing Phase: Here vulnerability scanners are used extensively. They have a predefined set of security rules, adhering to which they crawl through the entire application finally creating a comprehensive report on the system vulnerabilities. It clearly defines the cause, severity and the solution for each case.  However, the scanner should be used with a manual check as it may generate many false positives due to its pre-defined set of rules and no knowledge of the business logic.

- Deployment Phase: Here, PenetrationTesting is performed where a hacking attack is simulated on the system. This is performed to uncover all the remaining security threats. Performing penetration tests avoid network costs as well as regulatory requirements. 

- Support/Maintenance Phase: All the above testing were pre-production testing. After deployment, post production testing need to be performed. This can be done more efficiently by using a Software Security Assurance Program.

Conclusion:

Security Testing is not something which can/needs to be only performed in the production environment. It should be performed through every phase of the SDLC. As it covers all the security issues right from initiation, it also reduces the cost, time and effort for future fixings.

Monday, 23 November 2015

Performing Security Testing for Mobile and Web Applications.



In today’s connected world, we rely more and more on web and mobile applications to store and retrieve important information, security of these applications needs to be ensured. Security testing identifies potential threats and vulnerabilities of the application system.

The different kinds of web and mobile security checking are as follows:

  1. Vulnerability Assessment and Penetration Checking: Vulnerability assessment process discovers different weaknesses in the system that makes threats possible, but it does not categorize them as per their threat potential.  Penetration testing exploits these vulnerabilities and determines the severity of each. Both these tests together provide a detailed picture of the system’s flaws.
  2. Security Scanning and auditing: This helps to identify the network and system problems.
  3. Risk Assessment: This helps to identify potential hazards and its implications on occurrence. 
  4. Ethical Hacking or white hat hacking is another process to expose the system loopholes. This hacking is unlike the malicious intentions and is carried out within the organization.
  5. Command Injections: Here software hackers execute arbitrary commands into an input mechanism basically designed to pass user supplied data.
  6. Data Security: There is always a threat to the confidential data being stolen. Portability of the device is an additional hazard in this case. Hence unlike web data security, for mobiles it is a different testing process. Mobile based data protection and data security help to identify potential data exfiltration threats.
  7. Session Management: For web applications the authenticated state of a user is maintained through the use of cookies which may be HTTP cookies, Flash Cookies or Evercookie. In mobiles, apart from HTTP and browser connections, apps communicate with the back end servers as well. Hence, all cookie based authentications do not hold true for mobile users. With different mobile platforms in Andriod, ioS and Windows, this difference becomes more complicated for different configurations required for VPN.
  8. Unauthorized access: In a web application, an administrator is able to authorize the access to users. In mobile applications this authorization is carried out in both  client side and server side. Also, when apps are installed they are required to be granted a range of user permissions which is not always a preferred choice.
Security Testing need to be carried out in parallel with System Development Life Cycle(SDLC), later implementations result in increased effort, time and cost. 

The testing phases associated with each phase of SDLC are as follows:

Development Phase
Testing
Requirement Specification
Security Analysis
Architecture Planning
Risk Analysis
Design
Security Test Plan
Coding
White Box Testing
Integration
Integration Testing
Black Box Testing
System Testing
Installation
Penetration Testing
Vulnerability Scanning
Support
Impact Analysis

 Below are the mobile testing processes:

-      Preparation

-      Gather Intelligence

-      Threat Modelling

-      Vulnerability Analysis

-      Vulnerability Assessment

-      Develop Countermeasures

When we compare both, we observe that basic testing phases are the same for both, security testing of mobileapps extend a bit further than web applications due to:

-      Portability 

-      Always online and geographically traceable

-      Device Properties

-      More focus on app functionality than security

Conclusion:

In web applications, the security loopholes are associated with SQL injection, redirects and includes for remote files. Here, attackers take a black box approach. In mobile application hacking, more of a reverse engineering skills are put through as the attackers already have access to the codes. Overall Security Testing is most important testing for the success of web or mobile applications. Overlooking Security testing can become the major reason for performance pitfalls and failure of fascinating web and mobile applications.