JFrog Frog Bot
Overview
JFrog Frogbot is a Git bot that scans your Git repositories for security vulnerabilities. It has a few features:
- It can scan pull requests after they are opened, but not after they are merged. This allows for vulnerabilities to be picked up in the code before it can be introduced into the codebase.
- It can also scan the Git repository and can create pull requests with fixes for the detected vulnerabilities.
Frogbot supports the following: - Azure Repos - Bitbucket Server - GitHub - GitLab
Supported Technologies
Feature | Go | Maven | npm | Yarn v1-v3 | Pip | Pipenv | Poetry | .NET CLI | NuGet | Terraform | Gradle | Pnpm | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SCA | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | |
Contextual Analysis | Coming Soon | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | Coming Soon | Coming Soon | ❌ | ✅ | ✅ | |
Secrets Detection | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
SAST | Beta | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | Roadmap | Roadmap | ❌ | ✅ | ✅ | |
Infrastructure as Code (IaC) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | |
PR Scan | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
Monitor Scan | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
Autofix with new PR for direct dep. | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | |
License Violations | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Pull Request Scanning
Successful Example
If the pull request has no vulnerabilities then Frogbot will leave a comment indicating success.
Failed Example
If the pull request has vulnerabilities then Frogbot will leave detailed comments detailing its findings.
Setup and Installation
Expand the arrows for sample code. NOTE: FrogBot currently does not support Azure Service Connections, you will need to authenticate through the pipeline and environment variables.
Predefined Azure Pipelines variables. There's no need to modify them.
JF_GIT_PROJECT: $(System.TeamProject)
JF_GIT_REPO: $(Build.Repository.Name)
JF_GIT_API_ENDPOINT: $(System.CollectionUri)
JF_GIT_BASE_BRANCH: $(Build.SourceBranchName)
JF_GIT_OWNER: $(System.TeamProject)
JF_GIT_PROVIDER: 'azureRepos'
Azure Pipelines
Scanning repository branches and fixing issues
``` pool: vmImage: ubuntu-latest variables: JF_GIT_PROJECT: $(System.TeamProject) JF_GIT_REPO: $(Build.Repository.Name) JF_GIT_API_ENDPOINT: $(System.CollectionUri) JF_GIT_BASE_BRANCH: $(Build.SourceBranchName) JF_GIT_OWNER: $(System.TeamProject) JF_GIT_PROVIDER: 'azureRepos' jobs: - job: displayName: "Frogbot Scan Repository and Fix" steps: - task: CmdLine@2 displayName: 'Download and Run Frogbot' env: JF_URL: $(JF_URL) JF_ACCESS_TOKEN: $(JF_ACCESS_TOKEN) JF_GIT_TOKEN: $(JF_GIT_TOKEN) # [Optional Parameters] # JF_USER: $JF_USER # JF_PASSWORD: $JF_PASSWORD # JF_RELEASES_REPO: "" # JF_INSTALL_DEPS_CMD: "" # JF_WORKING_DIR: maven # JF_PATH_EXCLUSIONS: "*.git*;*node_modules*;*target*;*venv*;*test*" # JF_WATCHES:Scanning pull requests
pool:
vmImage: ubuntu-latest
variables:
JF_GIT_PULL_REQUEST_ID: $(System.PullRequest.PullRequestId)
JF_GIT_PROJECT: $(System.TeamProject)
JF_GIT_REPO: $(Build.Repository.Name)
JF_GIT_API_ENDPOINT: $(System.CollectionUri)
JF_GIT_BASE_BRANCH: $(System.PullRequest.TargetBranchName)
JF_GIT_OWNER: $(System.TeamProject)
JF_GIT_PROVIDER: 'azureRepos'
jobs:
- job:
displayName: "Frogbot Scan Pull Request"
steps:
- task: CmdLine@2
displayName: 'Download and Run Frogbot'
env:
JF_URL: $(JF_URL)
JF_ACCESS_TOKEN: $(JF_ACCESS_TOKEN)
JF_GIT_TOKEN: $(JF_GIT_TOKEN)
# [Optional Parameters]
# JF_USER: $JF_USER
# JF_PASSWORD: $JF_PASSWORD
# JF_RELEASES_REPO: ""
# JF_SMTP_SERVER: ""
# JF_SMTP_USER: ""
# JF_SMTP_PASSWORD: ""
# JF_WORKING_DIR: path/to/project/dir
# JF_PATH_EXCLUSIONS: "*.git*;*node_modules*;*target*;*venv*;*test*"
# JF_WATCHES: <watch-1>,<watch-2>...<watch-n>
# JF_PROJECT: <project-key>
# JF_INCLUDE_ALL_VULNERABILITIES: "TRUE"
# JF_FAIL: "FALSE"
# JF_DEPS_REPO: ""
# JF_FIXABLE_ONLY: "TRUE"
# JF_MIN_SEVERITY: ""
# JF_EMAIL_RECEIVERS: ""
# JF_ALLOWED_LICENSES: "MIT, Apache-2.0"
# JF_AVOID_EXTRA_MESSAGES: "TRUE"
# JF_PR_COMMENT_TITLE: ""
inputs:
script: |
getFrogbotScriptPath=$(if [ -z "$JF_RELEASES_REPO" ]; then echo "https://releases.jfrog.io"; else echo "${JF_URL}/artifactory/${JF_RELEASES_REPO}"; fi)
curl -fLg "$getFrogbotScriptPath/artifactory/frogbot/v2/[RELEASE]/getFrogbot.sh" | sh
./frogbot spr
Frogbot Configuration
Advanced configutations can be made to Frogbot by creating a frogbot-config.yml file.
This file is not mandatory. This file can include details about the repository's directory structure. This can include package manager commands that can be necessary for Frogbot to scan a project's dependencies.
Frogbot-config.yml Template
The config file should be located in the following path relative to the root of the repo:
.frogbot/frogbot-config.yml