StackHawk
Hamburger Icon

What is SOC 2
Security Testing and
Why is it Important?

Matt Tanner

Matt Tanner|February 8, 2023

Find out what SOC 2 security testing is, the benefits of becoming SOC 2 certified, and how to get started.

Anyone who is working in a highly-regulated industry or is a SaaS provider has likely heard about SOC 2 compliance. SOC 2 certification has become the gold standard of security for many technology companies. It guarantees a high level of information security and a promise to keep customer data private and secure. SOC 2 compliance can take varying amounts of time and effort to achieve, but in our modern world of daily security breaches and data leaks, it’s a must for many organizations.

In this blog, we will cover some of the building blocks of SOC 2 security testing. We will go over what it is and why it is important and finish off with some pointers on how to achieve SOC 2 compliance, how to build SOC 2 compliant applications and APIs, and look at how StackHawk can assist developers in their SOC 2 efforts. Let’s start by looking at what SOC 2 security testing entails.

What Is SOC 2 Security Testing?

SOC 2 (Service Organization Controls 2) security testing is a type of audit that assesses the security controls of a service organization. The audit is performed by a certified independent auditor who will evaluate the organization's controls related to the security, availability, processing integrity, confidentiality, and privacy of the systems and data that the organization uses to deliver its services. The audit is designed to help organizations demonstrate to their clients and stakeholders that they have strong controls in place to protect sensitive data and systems. The audit is based on the AICPA (American Institute of Certified Public Accountants) Trust Services Principles and Criteria, which provide a framework for evaluating the design and effectiveness of controls. The results of the audit are consolidated into a SOC 2 report, which summarizes the findings of the audit and provides recommendations for improvement, if necessary.

What Is Needed To Be SOC 2 Compliant?

To be compliant with SOC 2, an organization must have controls in place that meet the AICPA's Trust Services Principles and Criteria. These principles and criteria are:

  1. Security: The organization must have controls in place to protect against unauthorized access to or use of systems and data.

  2. Availability: The organization must have controls in place to ensure that systems and data are available when needed.

  3. Processing integrity: The organization must have controls in place to ensure the accuracy and completeness of data processing.

  4. Confidentiality: The organization must have controls in place to protect the confidentiality of sensitive information.

  5. Privacy: The organization must have controls in place to protect the privacy of personal information.

To meet these principles and criteria, an organization may need to implement a variety of controls. Depending on the company and application, the company may need to implement controls for access, data backup and recovery, change management, and incident management. The specific controls that an organization needs to implement will depend on:

  • the nature of its business

  • the services it provides

  • the data it handles

Only after these criteria are met should an organization undergo a SOC audit to ensure SOC 2 compliance. From this audit, a SOC report will be issued showing whether the organization has met the requirements for SOC 2 compliance.

A SOC report is issued after a third-party auditor examines an organization. The audit is done to verify that an organization has an effective system of controls related to security, availability, processing integrity, confidentiality, and/or privacy. The report, which is issued by a Certified Public Accountant (CPA), provides reasonable assurance over the design and operating effectiveness of controls. Part of the report also clearly outlines any potential risks for customers or partners that are considering working with the organization. Since the SOC 2 report will be available to potential customers, this allows them to make an educated decision on whether to use the provider or not.

Is Penetration Testing Required For SOC 2 Compliance?

Penetration testing, also known as pen testing, is a type of security testing that is designed to identify vulnerabilities in systems and networks by simulating a cyber attack. While pen testing is not specifically required for SOC 2 compliance, it can be an important part of a comprehensive security program. Pen testing is another great tool that can be added to help organizations identify and remediate vulnerabilities in their systems.

The Trust Services Criteria that are relevant to SOC 2 compliance do not specifically mention penetration testing. However, the principles and criteria do require organizations to have controls in place to protect against unauthorized access to or use of systems and data. Pen testing can be a useful tool for identifying these types of vulnerabilities, such as a system that allows for unauthorized access. Using penetration testing to discover vulnerabilities that could be exploited by an attacker, and remediating them can help an organization meet this requirement in the SOC 2 compliance guidelines.

In addition, some regulations or industry standards may require or recommend pen testing as part of a comprehensive security program. For example, the Payment Card Industry Data Security Standard (PCI DSS) recommends that organizations perform pen testing at least annually.

While pen testing is not specifically required for SOC 2 compliance, conducting a penetration test can be a valuable tool for identifying vulnerabilities and helping organizations meet the Trust Services Criteria.

What Are The Different Types Of SOC 2 Compliance?

Although we generally speak about SOC 2 compliance as a single entity, there are two types of SOC 2 compliance: SOC 2 Type I and SOC 2 Type II.

SOC 2 Type I compliance refers to the controls that an organization has in place at a specific point in time. A SOC 2 Type I audit is focused on the design of the controls, and it evaluates whether the controls are suitable for meeting the Trust Services Principles and Criteria.

SOC 2 Type II compliance, on the other hand, refers to the operating effectiveness of the controls over some time. A SOC 2 Type II audit is focused on the effectiveness of the controls, and it evaluates whether the controls are operating as intended and are achieving their intended results.

Both types of audits are performed by a certified independent auditor, and the results are presented in a SOC 2 report. As mentioned previously, the report provides a detailed assessment of the controls that are in place and makes recommendations for improvement, if necessary. Organizations generally will do a SOC 2 Type I audit first and, usually, 3-12 months later, will have the SOC 2 Type II audit completed to ensure they meet the requirements over an extended period.

Why Is SOC 2 Compliance Important?

SOC 2 compliance is an important criterion for organizations to demonstrate to their clients and stakeholders that they have strong controls in place to protect sensitive data and systems. By undergoing a SOC 2 audit, an organization can assure that it has implemented appropriate controls to safeguard the security, availability, processing integrity, confidentiality, and privacy of the systems and data it uses to deliver its services.

For organizations that handle sensitive data, such as financial information, personal information, or healthcare data, SOC 2 compliance is highly important. Many organizations must comply with regulations or industry standards that mandate the use of strong security controls. personal data may be required to comply with data protection regulations such as the General Data Protection Regulation (GDPR) or the California Consumer Privacy Act (CCPA). A SOC 2 audit can help an organization demonstrate compliance with these regulations. It helps to build trust with clients and stakeholders by showing that your organization takes security seriously and is committed to protecting sensitive data.

SOC 2 compliance is important because it helps organizations build trust, protect sensitive data, and demonstrate compliance with industry standards and regulations. It’s a surefire way to demonstrate to new and existing customers security and compliance are top of mind for your organization.

What Is The Easiest Way To Become SOC 2 Compliant?

There is no easy or quick way to become SOC 2 compliant. Achieving SOC 2 compliance requires a robust and ongoing security program that includes the implementation and maintenance of appropriate controls.

That being said, there are steps that organizations can take to streamline the process of becoming SOC 2 compliant:

  1. Identify the specific Trust Services Principles and Criteria that are relevant to your organization. This will help you focus your efforts on the controls that are most important for your business.

  2. Implement a security framework, such as the NIST Cybersecurity Framework or ISO 27001. These frameworks provide a structured approach to implementing and maintaining security controls.

  3. Develop a security policy and procedures manual that outlines the specific controls that your organization has in place to meet the Trust Services Principles and Criteria.

  4. Train employees on security best practices and the importance of protecting sensitive data.

  5. Regularly monitor and test your controls to ensure that they are operating effectively and to identify any potential issues.

  6. Work with a certified independent auditor to conduct a SOC 2 audit. The auditor will review your controls and provide recommendations for improvement, if necessary.

By taking these steps, you can help ensure that your organization has a strong foundation for SOC 2 compliance. However, it's important to note that achieving and maintaining SOC 2 compliance requires ongoing effort and attention.

The typical SOC 2 compliance journey looks like this:

Audit Prep

At this stage, companies begin to uncover what is needed for SOC 2 compliance. As part of this discovery and prep process, an organization will create policies and processes to adhere to the needs of SOC 2 compliance guidelines. The organization will train employees on their roles in attaining SOC 2 compliance and make changes to any technical configurations to meet SOC 2 requirements. This phase generally takes about one to three months.

SOC 2 Type I Audit

After the audit prep, some organizations will choose to do the optional SOC 2 Type I audit. As mentioned, this audit essentially proves that at this point, your business is compliant. This is when you can start the clock on attaining the SOC 2 Type II certification.

Evidence Collection

Once the clock has started, there is a three to twelve-month evaluation period that is part of the SOC 2 Type II evaluation process. During this time, the auditor will collect evidence to show long-term proof of SOC 2 compliance. This is because SOC 2 Type II certification is based on the ongoing ability of an organization to demonstrate compliance, unlike the point-in-time verification done in a SOC 2 Type I audit. During the evidence collection period, the auditor will document processes, policies, and controls that are being maintained by the organization.

SOC 2 Type II Audit

After the evidence has been collected and verified, the auditor will come in and do an on-site audit. Depending on the size of your organization, the scope of your business, and other factors, this part could take anywhere from a few days to several months. The time needed is determined by the amount of time needed for the auditor to be satisfied that they have covered all the necessary bases. After the audit is concluded, usually within a few weeks your organization will receive the SOC 2 Type II audit final report.

Annual Refresh

Each year, the organization will need to do an annual refresh to show continuous compliance with the principles and criteria of SOC 2 compliance. By doing this, organizations know that SOC 2 compliance is being maintained on a daily, weekly, and monthly basis even after the business passed their initial audits.

The complexity of this process may vary from organization to organization but the sequence of events generally follows this path. Since certain periods are baked into the compliance framework, businesses can usually guarantee that achieving  SOC 2 Type II compliance will happen no sooner than three months after the SOC 2 certification process has begun.

How Does SOC 2 Impact Your APIs?

Many companies have a suite of APIs that drive core business functionalities. There are very few businesses, technical or not, that do not have APIs driving at least a part of their products and services. Of course, APIs are also impacted by the requirements of SOC 2 compliance. When it comes to APIs, SOC 2 compliance can impact them in several ways:

  1. APIs that handle sensitive data may be required to comply with SOC 2 to demonstrate to clients and stakeholders that they have strong controls in place to protect that data.

  2. Organizations that use APIs to access sensitive data may require their API providers to be SOC 2 compliant to ensure the security and integrity of that data.

  3. APIs that are not compliant with SOC 2 may be less attractive to potential clients and partners, as they may be seen as less secure and reliable.

  4. Achieving SOC 2 compliance may require organizations to implement additional controls and processes related to their APIs. This can include additions such as authentication and authorization controls, data encryption, and incident management controls.

Overall, SOC 2 compliance is important for APIs that handle sensitive data. Making sure your APIs adhere to SOC 2 policies and controls is likely to be required by clients and partners to ensure the security and integrity of that data.

How To Build SOC 2-Compliant APIs

To build SOC 2-compliant APIs, you will need to implement controls that meet the Trust Services Criteria. This will likely involve building or enhancing your APIs from a few different angles. A SOC 2-compliant API will require a combination of technical, physical, and administrative controls. Some specific steps you can take to build SOC 2-compliant APIs include:

  1. Implement authentication and authorization controls to ensure that only authorized users have access to your APIs.

  2. Implement encryption to protect sensitive data in transit and at rest.

  3. Implement data backup and recovery controls to ensure that data can be recovered in the event of a disaster or data loss.

  4. Implement change management controls to ensure that changes to your APIs are properly tested, approved, and implemented.

  5. Implement incident management controls to ensure that security incidents are promptly detected, investigated, and resolved.

  6. Implement a security awareness and training program to educate employees about security best practices and the importance of protecting sensitive data.

  7. Regularly monitor your APIs and their associated controls to ensure that they are operating effectively and to identify any potential issues.

It's important to note that this is just a high-level overview of how SOC-2-compliant APIs can be built. The specific controls that you need to implement will depend on the nature of your API and the data it handles. The best way to ensure that your APIs will meet compliance requirements is to consult with a security expert or a certified independent auditor. Doing this can help you to determine the specific controls that are appropriate for your APIs.

How To Use DAST Tools To Help With SOC 2 Compliance

Dynamic application security testing (DAST) tools are designed to identify vulnerabilities in web-based applications. DAST tools work by analyzing the application's behavior during runtime, as a black box security testing technique. A DAST tool can help to easily identify vulnerabilities that may impact your ability to achieve SOC 2 compliance. These tools can also ensure that applications and APIs that are being built or updated do not have security defects that could affect your SOC 2 compliance. Using a DAST tool is a great way to ensure that developers are creating secure code in an automated fashion. 

It’s also important to note that running a DAST tool whenever code is committed to the source code repository is possible. Matter of fact, this is the best way to ensure that code is always SOC 2 compliant and is confidently being produced without defects. If defects are found, they can be remedied immediately instead of just before a production release, or worse, after the vulnerability has already been exploited in production. When code is committed, the application is built from the latest source code and the DAST tool can then execute its set of tests against the latest build. Instantly giving feedback to developers about potential vulnerabilities and any security issues which could impact SOC 2 compliance at the application level.

To use a DAST tool for SOC 2 compliance, you will need to:

Identify The Scope of Testing 

Determine which applications and systems need to be tested, as well as which Trust Services Principles and Criteria the testing should focus on. Understand the vulnerabilities which can be identified by the DAST tool, as well as its limitations. Once the scope of testing is determined, you can move forward into configuring and using the tool.

Configure The DAST Tool

Set up the DAST tool to scan the appropriate applications and systems, and configure any relevant settings or preferences. Depending on the tool, you may configure it to crawl your application automatically, supply it with defined application paths, or use a mixture of both.

Conduct The Scan

Run the DAST tool to scan the applications and systems. This may involve interacting with the application in various ways to simulate how the application will behave while in use and identify vulnerabilities. The scan will test the application for vulnerabilities against known and possible attacks and monitor how the application reacts. 

To ensure the most coverage and ongoing SOC 2 compliance, it is best to use an automated scanning process. The best way to do this is to use a tool, like StackHawk, that can be integrated directly into the release pipeline, which will continually test the code. This ensures that as code is written and committed, it is secure.

Review The Results

Review the results of the scan to identify any vulnerabilities that have been identified. Depending on the tool, this may consist of a report which contains the identified vulnerability, the severity, and impact, as well as potential fixes.

Remediate Any Vulnerabilities

If any vulnerabilities are identified in the results of the scan, take steps to fix them. This generally involves refactoring the code to get rid of the security defect. Of course, sometimes this also may involve applying patches, updating software, or implementing additional controls. Once the vulnerability is fixed, follow processes to verify that the fix is effective. As mentioned above, the best way to verify that the fix has been applied and is effective is to automate the DAST testing process. The easiest and most reliable way is by making DAST scans run automatically as part of the CI/CD pipeline. This process will then automatically run another scan with the DAST tool to ensure the fix is acting as intended and the vulnerability is resolved.

Document The Testing Process

Document the testing process, including the scope of the testing, the configuration of the DAST tool, and the results of the scan. This documentation will be useful if you need to demonstrate compliance with SOC 2 to an auditor or other stakeholders.

It's important to note that DAST tools are just one part of a comprehensive security program, and they should be used in conjunction with other controls and testing methods to ensure that your systems and data are secure. There are a variety of testing tools and methods available and by layering them, you can create an extremely robust application security program.

Using StackHawk For SOC 2 Compliance

StackHawk is a DAST platform that provides testing tools for web applications, APIs, and other types of services. As we explored above, DAST tools can easily and effectively be used to identify vulnerabilities that may impact SOC 2 compliance. Knowing this, StackHawk can be used as part of a comprehensive security program to help achieve and maintain SOC 2 compliance. Specifically, you can use StackHawk to:

  • Conduct a vulnerability scan to identify vulnerabilities in your web applications and APIs.

  • Remediate any vulnerabilities that are identified since StackHawk guides developers on how fixes can be achieved.

  • Verify that code fixes and refactoring have remedied any vulnerabilities that were discovered in the initial scan

  • Add StackHawk to your CI/CD pipeline to scan for vulnerabilities on an ongoing basis, as code is created and before it hits production.

  • Document the testing process, including the scope of the testing, the configuration of StackHawk, and the results of the scans.

Adding StackHawk to your security and SOC 2 compliance efforts is a great way to ensure applications are being written securely. StackHawk has a massive amount of functionality that can easily be configured and executed to assist your team in building SOC-2-compliant systems.

Wrapping Up

When it comes to showing users and customers how secure your platform is, SOC 2 compliance is a must-have. SOC 2 compliance guarantees that your platform meets high standards for security and can be trusted. In this blog, we looked at some key parts of SOC 2 security testing, including what it is, why it is important, and how to build and test applications and APIs to ensure SOC 2 compliance.

It's important to note that SOC 2 compliance is not a one-time event; it requires ongoing maintenance and monitoring to ensure that controls remain effective over time. Making sure that your organization continues to maintain SOC 2 compliance within existing services and new ones must be the approach moving forward.

Lastly, we looked at how StackHawk can be used to move your SOC 2 compliance testing forward. By using StackHawk’s DAST platform, you can ensure that vulnerabilities that can impact SOC 2 compliance are remedies early in the development of the application or service. Try StackHawk out for yourself to help you build SOC 2-compliant applications, services, and APIs.


Matt Tanner  |  February 8, 2023

Read More

Add AppSec to Your CircleCI Pipeline With the StackHawk Orb

Add AppSec to Your CircleCI Pipeline With the StackHawk Orb

Application Security is Broken. Here is How We Intend to Fix It.

Application Security is Broken. Here is How We Intend to Fix It.

Using StackHawk in GitLab Know Before You Go (Live)

Using StackHawk in GitLab Know Before You Go (Live)