Monday, February 6, 2023

How your SaaS team can run its own API & web application security testing

Unfortunately, security testing for web applications is often performed in an ad-hoc and disjointed manner. But to truly protect your customer data and prevent embarrassing data breaches, you need a web app security testing structure.

The number of web applications has skyrocketed in the past decades with their use in banking, FinTech, PropTech, HealthTech, RegTech, e-commerce, and pretty much every other sector you can imagine. That has created a golden opportunity that cybercriminals have been waiting for.

You're probably reading this because your company is at a stage where you have significant IP and customers' sensitive data to protect.

Or maybe you're looking to shift left with application security so that you can build a culture of security within your development team?

Whatever your reasons for researching this topic, the good news for you is that your team can take ownership of many of your application security testing activities. And in the process you'll become less reliant on external partners.

Web application security testing

Fortunately, security testing for web applications exists to ensure the security posture of your cloud software is as strong as possible.

Table Of Contents

    What is web application security testing?

    In simple terms, web application security testing involves assessing a web application for any vulnerabilities or data breaches. That is to say that unauthorized persons should not access the data and confidential information stored or managed by these web apps. Also, the assessment should identify any unintended behavior or manipulation of web applications.

    For instance, an unauthorized individual should not access the data on a web application through SQL injection, password cracking, cross-site scripting, or any other brutal force.

    Web app security testing identifies many, if not all, possible loopholes in the system and ideally should provide fixes for any vulnerabilities that are found.

    Remember, security testing for web apps can be done with different methods:

    1. Manually, by experienced penetration testing services providers who have the right credentials, years of experience and the right penetration testing framework.

    2. Automatically, but web application & API security testing toools that can integrate with your DevOps or CICD pipeline and be unleashed on your application each time it is updated with new features or code.

    What you should avoid are ad-hoc security activities because they waste your money and uplifit in your security posture from them may only last for a few days or at most a few weeks - until you next code commit happens.

    A better investment of your time and money will be a pentesting as a service model, which will help you build a structure of web app security that grows and adapts to your software development environment.

    Want my team to show you how too can have 7-star application security?

    Why is security testing is essential for web applications?

    Web application security testing has the objective of identifying security vulnerabilities. That is crucial to keep hackers or cybercriminals at bay. You would have heard about the instances of cyber attacks on software companies increasing by the day.

    But on a more operational level, vulnerabilities are like functional bugs - they keep coming back with new code commits. This means your seemingly secure web application may have a serious vulnerability with your next code commit.

    Web application security vulnerabilities can spell disaster if not identified and address on time. Many businesses and companies have collapsed following a cyberattack on their web applications. The losses may be irreparable in many cases. That is the reason you should take your web application security seriously.

    Why is security testing is essential for web applications?

    If you are building a B2B SaaS then proving you have thorough and consistent for securing your web applications and APIs can ultimately end up making or breaking your sales efforts.

    While investing in application security can seem like a cost without an ROI, you will change your mind on its benefits once you understand the many flow-on effects of being able to prove that your software is in the top 8-9% in terms of security standards.

    How do you secure a web-based application?

    You can protect your web-based software from an external attack in many ways.

    Using up-to-date encryption, proper user authentication, continuous webapp security testing and patching, and secure development practices are just a few very basic, yet often ignored examples of must-have security practices.

    Unfortunately, despite your best efforts, hackers can still find their way through advanced security systems and steal user data or cause economic damage. That's why the goal of web application security testing should be to minimize risk, instead of aiming for zero malicious attacks.

    But you can minimize their chances by employing this type of application security structure in your SDLC:

    1. Automated vulnerability scanning tool to run automated scans every time your devs push new code.

    2. A knowledge base to help your devs find best-practice remediation instructions.

    3. A Penetration testing-as-a-service platform that helps you get expert help when you need it.

    4. Collaboration tools so that your team can get on-demand help from qualified white hat testers.

    5. Dashboards with real-time data to help you visualise your security posture and better understand the ROI from your investment.

    6. Manually verification of your security posture on at least a monthly basis.

    7. Manual penetration testing services 2-4 times per year.

    Want to see how frictionless automated security testing tool can help you achieve 7-star security?

    What are the common security vulnerabilities in web applications?

    Web app cyber attacks can range from targeting the server database or aim at disrupting a large-scale network. Let me quickly highlight the most common security loopholes that conducting a security test can help you mitigate.

    Cross-Site Scripting (XSS)

    As the name suggests, this approach allows an attacker to insert a client-side script into a webpage. The injected script gives the hacker access to information stored in the web software or impersonates a legit user. Some cybercriminals use this approach to lure users into revealing confidential information for malicious use.

    SQL Injection (SQLi)

    SQL injection is where an attacker uses security loopholes in how the database processes search queries. If successful, the hacker gains access to confidential information. Many use this approach to create new user permissions and manipulate or delete sensitive data.

    URL Manipulation

    Some web apps pass sensitive information between the client and server using the HTTP GET method. This security flaw allows attackers to intercept transmitted information and manipulate it to gain access to the application. Penetration testers should, therefore, check if the information is a query string or not and take the best action.

    Password Cracking

    Many websites now require users to use a combination of letters, numbers, and special characters when creating passwords. Some even restrict users on the minimum password length to make it difficult for attackers to crack. A simple or short password is easy to break. Also, passwords and usernames stored in cookies without encryption are a security loophole, as hackers can easily access them.

    Do you want an automated security testing tool that finds these vulnerabilities in your application & APIs?

    How is web app security testing done?

    Remember from above, web application security testing can be done using autoamted tools or by experienced and accredited security professionals who are able to find security flaws that cannot be found by autoamted tools.

    However, a manual security test is an elaborate, and therefore a slower process. It requires specialised skills in ethical hacking with well defined test plans, usually called penetration testing frameworks.

    Generally, the following steps are followed during a manual web application security test:

    • Make a list of all your web application security areas and associated resources that will require testing.

    • Check that your web application is using an up-to-date security feature.

    • Check all user permissions to ensure they comply with all set rules relating to their roles.

    • Ensure that all the security methods you use, such as firewall, malware scanner, and SSL, are in place and active.

    • Conduct penetration tests on your code to ensure it is effective against SQL injection and other related attacks.

    • Check any database errors and ensure it is immune to malicious SQL queries.

    • Check the security of your network by conducting configuration tests.

    • Check the design and implementation of your web app for any errors and stray logic.

    • Check any scripts running on the web browser at launch time and follow the set rules.

    • Check all validation rules are in place for user inputs

    • Check the authentication and session management rules to ensure no security issues.

    • Check authorization and ensure no one gains access to your web application illegally.

    Download this application security checklist to understand the tests that your team should conduct when doing your own in-house web app and API security tests.

    Want my team to show you how too can have 7-star application security?

    What are the different types of manual webapp security tests

    Typically, testing methods are classified as white box, black box, and grey box penetration testing:

    White box penetration testing

    White box penetration testing, is the most in-depth type of security test because it requires you to provide the penetration tester with all network and system information, such as network maps, test user accounts AND access to your source code.

    A white box penetration test is helpful for simulating a targeted assault using as many attack vectors as possible on specific computer systems.

    This type of testing is performed by SAST or static automated scanning tools.

    Black box penetration testing

    In black box testing, the tester receives no information. Here, the pen tester mimics an unprivileged attacker's strategy for sensitive data searches. 

    As the most authentic scenario, this shows how an adversary without inside knowledge could target and compromise an organization. As a result, black box testing is typically the most expensive option.

    Grey box penetration testing

    Known as a translucent box test, this pen test shares limited information with the tester. The purpose of grey box testing is to help determine what level of access a privileged user could gain and the potential damage they could cause.

    A grey box test combines depth with efficiency, and it can simulate either an insider threat or an attack that has breached the perimeter of a network.

    Which type of web security testing do I need?

    There is no one-size-fits-all paradigm when it comes to security for web applications. The answer to this will depend on your application, your users and the type of data that your software and APIs store and consume.

    For most of our SaaS clients a grey-box security test provides a great balance between penetration test cost, testing robustness and value for money.

    However, if you application handles sensitive data like healthcare or banking data, or you are positioning your SaaS company as one that is enterprise-ready so that you can sell to larger customers, then a white-box pentest might be necessary.

    Want a "scare-free" call to have all your security testing questions answered?

    Who performs security tests on web apps?

    Most businesses hire security professionals to conduct web application security test on their behalf. But you don’t need to go that route if you have an in-house security team. In fact, you can test your web app for security issues yourself.

    However, using an external party for web application security testing is the most recommended approach if you don’t have a testing tool. The process is often complex and requires expertise, so nothing slips undetected.

    How long does it take to perform a web app security test?

    The time it will take you to test your web app security depends on many factors. It depends on who you hire to handle the task or if you will do it yourself. An application security professional can take a much shorter time. It is even faster if you use a web security testing tool, which can give you results in minutes.

    Also, the time it takes to test any web software depends on the application itself. A complex one will take considerably longer. It can take a week or more to scrutinize every page and functionality of a web app.

    What are the best tools for security testing of web applications?

    We have covered the best vulnerability scanning tools in detail previously. However, the gist is that you can choose between open source and paid tools.

    It's important to understand that web application vulnerability testing tools are a very misunderstood category. Automated web security testing tools come in two main categories:

    1. DAST scanners or dynamic web application scanning tools; and

    2. SAST or static web application scanning tools.

    The most common misconception is that one tool is better or more important than the other. So, is this true?

    DAST or SAST security testing tools?

    Should I use a dynamic or static application security testing tool?

    This is an easy question to answer: both.

    If you are serious about securing your web apps and putting in place a best-practice SaaS security structure, incorporate both types of tools. Including them in your software development life cycle ensures security.

    The two most common questions we get on web app security testing tools are:

    1. What is dynamic application security testing?

    2. What is static application security testing?

    Watch this video from our co-founder, Ayush Trivedi, to answer these questions. The information will help you understand the differences between static and dynamic security testing tools and why you eventually will need to use both of them:


    Which dynamic application security testing tool do you recommend?

    We've covered the best web application penetration testing tools in a lot of detail but TL:DR: Cyber Chief is an automated security testing tool that is built especially for frictionless integration with your software development life cycle.

    It allows you to quickly shift left with application security without overburdening your web developers, because it has some very neat features:

    • Built for software development teams who need a "plug-n-play" vulnerability testing tool.

    • Integrations frictionlessly with DevOps/CICD software deployment pipelines.

    • Performs APIs security testing in addition to web apps.

    • Simple to set up and promotes team accountability.

    • Comes with outstanding support.

    • Extremely user friendly with almost zero configuration or plugin setup required.

    • Isolate issues to each application environment by creating customised workspaces.

    • Helps you stay in compliance with your SOC 2 certification and/or ISO 27001 certification (and maybe even GDPR, depending on who you choose to believe).

    Is automated vulnerability scanning enough to take care of web app security?

    No. An automated web app and API vulnerability scanning is essential in detecting flaws in the system, though never enough to address security issues. This process only involves assessing the web app but not providing security measures for addressing the concerns.

    Experts use their intelligence, creative thinking skills, and expertise to create custom rules and conduct penetration testing and security audits. They also give insights from web app security analytics data in the report, which ensure the web app is secure.

    Want my team to show you how too can have 7-star application security?

    Which security issues are automated scanning tools not good at uncovering?

    Automated scanning tools are ineffective against these types of vulnerability categories:

    • Business logic vulnerabilities

    • Authentication vulnerabilities

    • Application logic flaws

    • Session management flaws

    • Shared hosting vulnerabilities

    • Leakage of sensitive information

    This gap exists in all web app and API vulnerability scanning tools, irrespective of how popular or fabled they may be.

    The only way to bridge this gap is to put in place an application security structure like the one offered by our pentesting as a service solution. That solution is the one that will help you also build the culture of security that you're looking to implement.

    How can I do API security testing for my web application?

    All good web application security testing processes should include API security too. For example, our recommended vulnerability scanning tool, Cyber Chief, also allows you to test, find and fix vulnerabilities for the following types of APIs:

    1. REST APIs.
    2. SOAP APIs.
    3. GraphQL APIs.

    However, you should also ensure that the customised test plan for your manual web app penetration testing services include at least the following API security tests:

    1. Authentication Testing: Verify that authentication mechanisms such as OAuth, JWT, API keys, etc. are implemented correctly and securely.

    2. Authorization Testing: Check that the API implements proper access control and only authorized users can access the data they are entitled to.

    3. Input Validation Testing: Ensure that the API properly validates all inputs, including query parameters, request body, headers, etc., to prevent attacks such as SQL injection and Cross-Site Scripting (XSS).

    4. Output Encoding Testing: Verify that the API properly encodes output data to prevent Cross-Site Scripting (XSS) and other injection attacks.

    5. Session Management Testing: Test that session tokens are properly generated, stored, and managed, and that they are securely transmitted between client and server.

    6. Error Handling Testing: Check that the API handles errors and exceptions securely, without disclosing sensitive information such as stack traces, database error messages, etc.

    7. Penetration Testing: Conduct a simulated attack on the API to identify vulnerabilities and weaknesses that can be exploited by malicious actors.

    8. Monitoring and Logging: Monitor API activity logs to detect and respond to security incidents and ensure that they are properly logged for auditing purposes.

    What if I need help with security testing?

    Any good application security program needs external help, so it's ok to see help from external partners who you trust.

    If you don't have an existing application security testing partner then here are a few tips to choose a pentesting company that will help you maximise the ROI from your appsec investment.

    The most obvious place to get more information about what my team does for software development teams like yours is from our web app pentesting as a service page.

    Or you can take a positive next step and get real answers that are specific to your situation by booking a discovery call with my team. On this call my team will help you understand how you can get to the next phase of your SaaS security journey.


    SaaS Brief