# Pynt for Jenkins

## **What is Jenkins?**

{% hint style="info" %}
💡 [**Jenkins**](https://www.jenkins.io/) is an open-source automation server used for continuous integration and delivery. Jenkins allows developers to build, test, and deploy software by automating tasks in customizable pipelines.
{% endhint %}

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2FccgJvHGEMxDPHj2rHe1V%2FJenkins.png?alt=media&#x26;token=83fdb2a0-0a3f-4626-93ed-c6f44ecc7936" alt="" width="188"><figcaption><p>Jenkins</p></figcaption></figure>

***

## Pynt's integration with Jenkins

As part of its [API security testing](https://docs.pynt.io/documentation/api-security-testing), Pynt allows seamless [integration](https://docs.pynt.io/documentation/security-testing-integrations/pynt-on-ci-cd) with Jenkins.

Pynt for Jenkins enables you to seamlessly integrate powerful API security testing into your Jenkins CI/CD pipelines. By incorporating Pynt into your Jenkins workflows, you can automate comprehensive security scans with every build, ensuring that your APIs are protected from vulnerabilities throughout the development process. Pynt’s integration with Jenkins is designed to be straightforward, allowing you to enhance your security posture without disrupting your existing CI/CD practices.

***

## Jenkins Configuration

Add [Pynt ID](https://docs.pynt.io/documentation/security-testing-integrations/pynt-on-ci-cd/how-to-get-pynt-id-for-ci-cd-authentication) to Jenkins environment variables:

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2FhdN72B0nLDnNo4nnOOYG%2Fimage.png?alt=media&#x26;token=44ad9b23-0dd3-4424-8de5-40dd00a3f69c" alt=""><figcaption></figcaption></figure>

* Make sure Python installed on the agent.
* An example for a Jenkins job running Pynt newman against goat collection:

```bash
echo "Pynt API Security testing"

# Using venv is a good practice
python3 -m venv myenv
. myenv/bin/activate

pip install pyntcli
export PATH=$PATH:/var/lib/jenkins/.local/lib/python3.10/site-packages

curl https://raw.githubusercontent.com/pynt-io/pynt/main/goat_functional_tests/goat.postman_collection.json -o goat.json 
pynt newman --collection goat.json --reporters
cat pynt_results.json

deactivate

```

***

## Controlling the return code from Pynt

`pynt newman` and `pynt command` have an optional flag `--severity-level`

With this flag, you have granular control over whether Pynt returns an error code (non zero) in the event of findings. Use this flag to control when Pynt will break the CI/CD run, allowed values are:

```
'all', 'medium', 'high', 'critical', 'none' (default) 
```

***

{% hint style="info" %}
💡 **Need Help?** For any questions or troubleshooting, reach out to the [**Pynt Community Support**](https://www.pynt.io/community).
{% endhint %}
