Security Testing — Basics that you should know

Overview & Objective :

Security — This is one of the buzzwords every single person in the Digital business comes across in their professional journey.

Whether you are a developer, focusing on building a new application, or a project manager who owns the success or failure of a budding project or a business leader, owning the rise & fall of a new offering in the service line, Security is one of the premium aspects of your application or system or service that plays a pivotal role to success or failure.

While Security is a topic that is ever-evolving with new paradigms in a continuous fashion, in this article, we will just focus on understanding the basic security vulnerabilities that are relevant for an on-premise and/or web & mobile applications, so that you may deploy measures to safeguard your IT infrastructure and applications against such threats.

What is Security Testing ?

SECURITY TESTING is a type of Software Testing that uncovers vulnerabilities, threats & risks in a software system/application/service and prevents malicious attacks from intruders. The purpose of Security Testing is to unearth all possible loopholes and weaknesses of the software system which might result in a loss of information, revenue, repute at the hands of the rogue employees/competitors/outsiders of the Organization leading to malfunction, exploitation & even shut down of a business.

Its an integral part of software testing with a full lifecycle, specially in an Agile Implementation Environment.

Principles of Security Testing :

Availability :

Availability is the assurance that a service/system/application is functional & available and is doing what it is expected to do.

Integrity :

Integrity is the assurance that the data or output that is stored or coming out from a system/application/service is consistent & accurate across platforms & users.

Authentication :

The authentication process comprises confirming the identity of a person/system/application/service, trying to access a protected resource in another system/application/service.

Authorization :

It is the process of defining the roles that a client (user/system/service/application) is permitted to take action(s) on a protected resource residing in a server.

Confidentiality :

It is a security process that protects the data from the outside world through encryption/hashing etc.

Non- repudiation :

The non-repudiation is used to ensure that a conveyed message has been sent and received by the person who claims to have sent and received the message.

Types of Security Testing :

  • Vulnerability Scanning : This is done through automated software tools to scan a system against known vulnerabilities.
  • Security Scanning : It involves identification of network and system weaknesses through Manual and Automated tools, and provides solutions for reducing these risks.
  • Penetration testing : This testing involves analysis of a particular system/service/application to check for potential vulnerabilities through simulation of an hacking attempt.
  • Risk Assessment : This testing involves analysis of security risks & their classification as Low, Medium and High. This testing recommends controls and measures to reduce the risk.
  • Security Auditing : This is an internal inspection of Applications/Systems/Services for security breach incidents.
  • Ethical hacking : It’s hacking an Organization software systems with the intent to expose security flaws in the system.
  • Posture Assessment : This combines Security scanning, Ethical Hacking and Risk Assessments to show an overall security posture of an organization

Security Testing Methodologies :

  • Tiger Box: This hacking is usually done on a laptop which has a mixed collection of OSs and hacking platforms. This testing helps security testers to conduct vulnerability assessment of a system/service/application through penetration testing and ethical hacking.
  • Black Box : Tester is authorized to do E2E testing on everything around functionality, platform, availability & network topology, within the peripheral boundaries of the system.
  • Grey Box: Partial information is given to the tester about the system, and it is a hybrid of white and black box models.

A model security test plan should include:

  • Security-related test cases or scenarios
  • Test data related to security testing
  • Test tools required for security testing
  • Analysis of various test outputs from different security tools

SAST & DAST :

SAST and DAST are application security testing methodologies that are used in tandem to find security vulnerabilities that can make an application susceptible to security threats & attacks.

Static application security testing (SAST) is a white box testing method that examines the source code to find software flaws and weaknesses such as SQL injection, XML Bomb, JSON Bomb, Insufficient Logging & Monitoring and others listed in the OWASP Top 10.

Dynamic application security testing (DAST) is a black box testing method that examines an application in its runtime to find vulnerabilities that a potential attacker may exploit.

OWASP Top 10 :

OWASP (Open Web Application Security Project) is a nonprofit foundation improving the security of software. Its the source for developers and technologists to secure our digital lives.

OWASP provides an ongoing list of the Top 10 security flaws that enable a majority of the successful cyberattacks over the past year and is a great starting place for setting your cybersecurity journey.

The best way to avoid these vulnerabilities (and the successful attacks they invite) is to create awareness in the developer community to shield the systems/services/applications from being exposed to such vulnerabilities.

The OWASP Top 10 2020 list consists of the following

  1. Injection : Injection flaws, such as SQL, NoSQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization.
  2. Broken Authentication : Application functions related to authentication and session management are often implemented incorrectly, allowing attackers to compromise passwords, keys, or session tokens, or to exploit other implementation flaws to assume other users’ identities temporarily or permanently.
  3. Sensitive Data Exposure : Many web applications and APIs do not properly protect sensitive data, such as financial, healthcare, and PII. Attackers may steal or modify such weakly protected data to conduct credit card fraud, identity theft, or other crimes. Sensitive data may be compromised without extra protection, such as encryption at rest or in transit, and requires special precautions when exchanged with the browser.
  4. XML External Entities (XXE) : Many older or poorly configured XML processors evaluate external entity references within XML documents. External entities can be used to disclose internal files using the file URI handler, internal file shares, internal port scanning, remote code execution, and denial of service attacks.
  5. Broken Access Control : Restrictions on what authenticated users are allowed to do are often not properly enforced. Attackers can exploit these flaws to access unauthorized functionality and/or data, such as access other users’ accounts, view sensitive files, modify other users’ data, change access rights, etc.
  6. Security Misconfiguration : Security misconfiguration is the most commonly seen issue. This is commonly a result of insecure default configurations, incomplete or ad hoc configurations, open cloud storage, misconfigured HTTP headers, and verbose error messages containing sensitive information. Not only must all operating systems, frameworks, libraries, and applications be securely configured, but they must be patched/upgraded in a timely fashion.
  7. Cross-Site Scripting XSS : XSS flaws occur whenever an application includes untrusted data in a new web page without proper validation or escaping, or updates an existing web page with user-supplied data using a browser API that can create HTML or JavaScript. XSS allows attackers to execute scripts in the victim’s browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
  8. Insecure Deserialization : Insecure deserialization often leads to remote code execution. Even if deserialization flaws do not result in remote code execution, they can be used to perform attacks, including replay attacks, injection attacks, and privilege escalation attacks.
  9. Using Components with Known Vulnerabilities : Components, such as libraries, frameworks, and other software modules, run with the same privileges as the application. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover. Applications and APIs using components with known vulnerabilities may undermine application defenses and enable various attacks and impacts.
  10. Insufficient Logging & Monitoring : Insufficient logging and monitoring, coupled with missing or ineffective integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to more systems, and tamper, extract, or destroy data. Most breach studies show time to detect a breach is over 200 days, typically detected by external parties rather than internal processes or monitoring.

A Few Leading Security Testing Tools

ØAcunetix

ØNetsparker

ØZED Attack Proxy (ZAP)

ØBurp suite

ØSonarQube

ØKlocwork

--

--

Saumen Mudi
IT Security — Best Practices, Methodologies, Loopholes, Platforms & Strategies

Saumen is a Senior Solutions Architect who primarily helps customers in their Digital Transformation journey in an Agile Integration environment.