The GitHub Action for DevSkim
Перейти к файлу
Michael Scovetta 914fa647b4
Bump upload-sarif to @v3 (#29)
* Bump upload-sarif to @v3
* Bump upload-artifact to v4 in validation workflow

---------

Co-authored-by: Gabe Stocco <98900+gfs@users.noreply.github.com>
2024-03-15 08:12:18 -07:00
.github/workflows Bump upload-sarif to @v3 (#29) 2024-03-15 08:12:18 -07:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-07-14 17:04:23 -07:00
Dockerfile Update Dockerfile (#16) 2023-05-24 22:37:10 +00:00
LICENSE Updating LICENSE to template content 2020-07-14 17:04:26 -07:00
README.md Update Github actions dependencies (#23) 2023-09-08 14:56:23 -07:00
SECURITY.md Initial SECURITY.md commit 2020-07-14 17:04:29 -07:00
action.yml Add Generic Extra Args argument and fix respecting the new options-json argument. 2023-06-26 14:00:38 -07:00
entrypoint.sh Fix missing space in if statement (#27) 2024-03-14 18:29:39 -07:00

README.md

DevSkim

DevSkim is security linter that highlights common security issues in source code.

The DevSkim GitHub Action outputs a sarif file compatible with GitHub's Security Issues view.

Usage

Add DevSkim to your GitHub Actions pipeline like below.

    - uses: actions/checkout@v4
    - uses: microsoft/DevSkim-Action@v1
    - uses: github/codeql-action/upload-sarif@v2
      with:
        sarif_file: devskim-results.sarif

You can also specify a number of options to the action.

    - uses: microsoft/devskim-action@v1
      with:
        directory-to-scan: path/to/scan
        should-scan-archives: false
        output-filename: devskim-results.sarif
        output-directory: path/to/output (appended to $GITHUB_WORKSPACE)
        ignore-globs: "**/.git/**,*.txt"
        exclude-rules: DS176209,DS148264
        options-json: path/to/options.json
        extra-options: --args --to --devskimAnalyze

Arguments

The arguments specified are provided to the DevSkim CLI's Analyze command. See the DevSkim Wiki for detailed usage instruction.

directory-to-scan

Relative path in $GITHUB_WORKSPACE for DevSkim to Scan. Equivalent to the --source-code argument to Analyze.

should-scan-archives

DevSkim can peek into archives to scan the files contained inside them. Setting this to true will enable that behavior. Equivalent to the --crawl-archives argument to Analyze.

output-filename

The filename to use for the results of the Analyze scan. Along with output-directory equivalent to the --output-file argument to Analyze.

output-directory

Relative path to a directory in $GITHUB_WORKSPACE to emit the output file, default to output in the root of $GITHUB_WORKSPACE with the specified output-filename.

ignore-globs

Files which match any of these globs will be skipped during analysis. Equivalent to the --ignore-globs argument to Analyze.

exclude-rules

Comma separated list of Rule IDs to skip during analysis. Equivalent to the --ignore-rule-ids argument to Analyze.

options-json

Relative path in $GITHUB_WORKSPACE to a json serialiation of a SerializedAnalyzeCommandOptions object. Equivalent to the --options-json argument to Analyze.

extra-options

Use this field to specify any other arguments to the DevSkim Analyze command. See the DevSkim Wiki for available options and usage documentation.

Features

  • Built-in ruleset highlighting common security issues in source code
  • Support for scanning code contained in archives
  • Information and guidance provided for identified security issues
  • Broad language support including: C, C++, C#, Cobol, Go, Java, Javascript/Typescript, Python, and more.

Main Project

The DevSkim engine powering this GitHub Action is also available here as a Cli and as IDE extensions for Visual Studio and Visual Studio Code.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.