πPynt for .NET (xUnit)
Integrate Pynt with xUnit to enhance API security testing in .NET environments. Automate security scans within your test suites to detect and mitigate vulnerabilities as part of your CI/CD pipeline.
Last updated
Integrate Pynt with xUnit to enhance API security testing in .NET environments. Automate security scans within your test suites to detect and mitigate vulnerabilities as part of your CI/CD pipeline.
π‘ xUnit is a widely-used testing framework for .NET applications, known for its extensibility, simplicity, and integration with Visual Studio. It supports async tests, shared context, and rich assertionsβmaking it ideal for unit, integration, and functional testing. xUnit helps ensure code correctness and reliability through automated and structured test execution.
Pynt integrates seamlessly with .NET test projects using xUnit. By observing traffic from your functional test executions, Pynt generates security tests that simulate real-world attacks and help identify critical vulnerabilities in your APIs.
This enables your .NET team to shift security testing leftβduring developmentβnot after deployment.
Prepare your .NET environment
Ensure you have the .NET SDK installed (version 6 or later is recommended).
Install Pynt container
Follow the Pynt installation guide to install and run the Pynt container.
Clone or write your xUnit-based functional tests
You can use your existing API test suite, or follow the example below.
Weβve created a sample vscode project that tests login and transaction access for goat sample APIs.
Download it here:
Run the tests normally with:
To run Pynt on this test suite:
This will:
Intercept traffic from your functional tests
Automatically generate security test cases
Report vulnerabilities like Broken Auth, IDOR, and more
If your HttpClient configuration requires a specific CA certificate:
If no certificate exists, generate one:
Generate a certificate (Linux/macOS)
Download make_certificate.sh
Download openssl.cnf
Make the script executable:
Run the script:
Then run your test with the generated certificate:
If you're encountering issues with Pynt's CLI, visit the Pynt CLI Troubleshooting Guide for solutions and tips.
For questions or help, reach out to the Pynt Community Support or join our Slack workspace.
Last updated
dotnet testpynt command --cmd "dotnet test"pynt command --cmd "dotnet test" --ca-path <path to certificate file>chmod +x make_certificate.sh./make_certificate.shpynt command --cmd "dotnet test" --ca-path rootCA.pem