Coder Social home page Coder Social logo

talarian1 / jfrog-vscode-extension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jfrog/jfrog-vscode-extension

0.0 1.0 0.0 39.21 MB

JFrog VS-Code Extension

Home Page: https://jfrog.github.io/jfrog-vscode-extension

License: Apache License 2.0

TypeScript 92.96% JavaScript 0.28% Python 6.46% Java 0.30%

jfrog-vscode-extension's Introduction

JFrog Visual Studio Code Extension

Visual Studio Marketplace

Table of Contents

About this Extension

General

The cost of remediating a vulnerability is akin to the cost of fixing a bug. The earlier you remediate a vulnerability in the release cycle, the lower the cost. JFrog Xray is instrumental in flagging components when vulnerabilities are discovered in production systems at runtime, or even sooner, during the development.

The JFrog VS Code Extension adds JFrog Xray scanning of project dependencies to your VS Code IDE. It allows developers to view panels displaying vulnerability information about the components and their dependencies directly in their VS Code IDE. With this information, a developer can make an informed decision on whether to use a component or not before it gets entrenched into the organization’s product.

Don't have JFrog Xray? Start for free.

Supported Features

Features Go Maven npm Pypi .NET
Issues and licenses scanning
Filter dependencies by severity, license, and scope
Trigger scan on startup
Jump from dependency tree to project descriptor
Jump from project descriptor to dependency tree
Show vulnerabilities inside the project descriptor
Upgrade vulnerable dependencies to fixed versions
Automatically trigger a scan upon code changes
Unlimited free project scanning
Exclude transitive dependencies from project descriptor

Free Go Modules Security Scanning and Metadata from GoCenter

The JFrog Extension also includes unlimited free security scanning and metadata of Go Modules from JFrog GoCenter. Read more in the Go Projects section.

Viewing and Updating Project Dependencies

View the dependencies used by the project in a tree, where the direct dependencies are at the top. Open_Extension

The JFrog extension automatically triggers a scan of the project's dependencies whenever a change is detected after building the code. To invoke a scan manually, click on the Refresh Refresh button or click on Start Xray Scan from within the editor. Refresh

View the security information for a depedency by hovering over it in the editor. You can also navigate from the depedency declaration directly into the tree view. This allows you to see transitive (indirect) depedencies. Refresh

Search for a dependency in the tree: Search_In_Tree

View the issues associated with direct and transitive (indirect) dependencies. Search_In_Tree

Update a vulnerable dependency to a fixed version: Set_Fixed_Version

To filter the dependencies viewed, click on the Filter Filter button. Filter

Navigate from the tree view to a depedency's declaration in the editor. Filter

General Configuration

Configuring JFrog Xray

Connect to JFrog Xray by clicking on the green Connect Connect button: Connect

The extension also support connecting to JFrog Xray using environment variables.

Note: For security reasons, it is recommended to unset the environment variables after launching VS Code.

  • JFROG_IDE_URL - JFrog Xray URL
  • JFROG_IDE_USERNAME - JFrog Xray username
  • JFROG_IDE_PASSWORD - JFrog Xray password
  • JFROG_IDE_STORE_CONNECTION - Set the value of this environment variable to true, if you'd like VS Code to store the connection details after reading them from the environment variables.

Proxy Configuration

If your JFrog Xray instance is behind an HTTP/S proxy, follow these steps to configure the proxy server:

  1. Go to Preferences --> Settings --> Application --> Proxy
  2. Set the proxy URL under 'Proxy'.
  3. Make sure 'Proxy Support' is 'override' or 'on'.
  • Alternatively, you can use the HTTP_PROXY and HTTPS_PROXY environment variables.

Proxy Authorization

If your proxy server requires credentials, follow these steps:

  1. Follow 1-3 steps under Proxy configuration.
  2. Encode with base64: [Username]:[Password].
  3. Under 'Proxy Authorization' click on 'Edit in settings.json'.
  4. Add to settings.json: "http.proxyAuthorization": "Basic [Encoded credentials]".
Example
  • Username: foo
  • Password: bar

settings.json:

{
   "http.proxyAuthorization": "Basic Zm9vOmJhcg=="
}

Exclude Paths from Scan

By default, paths containing the words test, venv and node_modules are excluded from Xray scan. The exclude pattern can be configured in the Extension Settings.

Extension Settings

To open the extension settings, use the following VS Code menu command:

  • On Windows/Linux - File > Preferences > Settings > Extensions > JFrog
  • On macOS - Code > Preferences > Settings > Extensions > JFrog

Go Projects

Free Security Scanning and Metadata from GoCenter

Go Modules in GoCenter are scanned by Xray. You can read more about it in this blog. The JFrog VS Code Extension pulls this security information from GoCenter and displays it inside the IDE. It also displays, for each module, the description summary, license and the number of stars. GoCenter_Issue

For each module there's a direct link to the GoCenter UI, with more information, like the actual CVEs, as well as other projects which use this module. GoCenter_Nav

Enhanced Capabilities with JFrog Xray

By connecting VS Code to JFrog Xray the security information is pulled directly from JFrog Xray. This means that more security information becomes available to the developers inside VS Code. This includes the list of security issues, including the module versions with the fixes. All the module metadata provided by GoCenter is still available when connecting to JFrog Xray.

Behind the Scenes

The JFrog VS Code Extension scans all of the project depedencies, both direct and indirect (transitive), even if they are not declared in the project's go.mod. It builds the Go dependencies tree by running go mod graph. Therefore, please make sure to have Go CLI in your system PATH.

Maven Projects

Excluding transitive dependency in pom.xml

To exclude a transitive dependency from your project, click on the "Exclude dependency" button in the dependencies tree. Exclude_Maven

Behind the Scenes

The JFrog VS Code Extension builds the Maven dependencies tree by running mvn dependency:tree. View licenses and top issue severities directly from the pom.xml.

Important notes:

  1. To have your project dependencies scanned by JFrog Xray, make sure Maven is installed, and that the mvn command is in your system PATH.
  2. For projects which include the Maven Dependency Plugin as a build plugin, with include or exclude configurations, the scanning functionality is disabled. For example:
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <configuration>
            <includes>org.apache.*</includes>
          </configuration>
        </plugin>
      </plugins>

Npm Projects

Behind the scenes, the extension builds the npm dependencies tree by running npm list. View licenses and top issue severities directly from the package.json.

Important: To have your project dependencies scanned by JFrog Xray, make sure the npm CLI is installed on your local machine and that it is in your system PATH. In addition, the project dependencies must be installed using npm install.

Pypi Projects

Behind the scenes, the extension builds the Pypi dependencies tree by running pipdeptree on your Python virtual environment. It also uses the Python interpreter path configured by the Python extension. View licenses and top issue severities directly from your requirements.txt files. The scan your Pypi dependencies, make sure the following requirements are met:

  1. The Python extension for VS Code is installed.
  2. Depending on your project, Please make sure Python 2 or 3 are included in your system PATH.
  3. Create and activate a virtual env as instructed in VS-Code documentation. Make sure that Virtualenv Python interpreter is selected as instructed here.
  4. Open a new terminal and activate your Virtualenv:
    • On macOS and Linux:
      source <venv-dir>/bin/activate
      
      # For example:
      source .env/bin/activate
    • On Windows:
      .\<venv-dir>\Scripts\activate
      
      # For example:
      .\env\Scripts\activate
  5. In the same terminal, install your python project and dependencies according to your project specifications.

.NET Projects

For .NET projects which use NuGet packages as depedencies, the extension displays the NuGet depedencies tree, together with the information for each depedency.
Behind the scenes, the extension builds the NuGet dependencies tree using the NuGet deps tree npm package.

Important:

  • Does your project define its NuGet depedencies using a packages.config file? If so, then please make sure the nuget CLI is installed on your local machine and that it is in your system PATH. The extension uses the nuget CLI to find the location of the NuGet packages on the local file-system.
  • The project must be restored using nuget restore or dotnet restore prior to scanning. After this action, you should click on the Refresh Refresh button, for the tree view to be refreshed and updated.

Troubleshooting

View the extension log: Logs

License

The extension is licensed under Apache License 2.0.

Building and Testing the Sources

To build the extension sources, please follow these steps:

  1. Clone the code from Github.
  2. Build and create the VS-Code extension vsix file by running the following npm command.
npm i
npm run package

After the build finishes, you'll find the vsix file in the jfrog-vscode-extension directory. The vsix file can be loaded into VS-Code

To run the tests:

npm t

Code Contributions

We welcome community contribution through pull requests.

Guidelines

  • Before creating your first pull request, please join our contributors community by signing JFrog's CLA.
  • If the existing tests do not already cover your changes, please add tests.
  • Pull requests should be created on the dev branch.
  • Please run npm run format for formatting the code before submitting the pull request.

jfrog-vscode-extension's People

Contributors

dependabot[bot] avatar eyalbe4 avatar or-geva avatar robinino avatar tomerm12 avatar yahavi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.