•  


Add Secure Code Warrior contextual training to SARIF · Actions · GitHub Marketplace · GitHub
Skip to content
shield

GitHub Action

Add Secure Code Warrior contextual training to SARIF

v1.11 Latest version

Add Secure Code Warrior contextual training to SARIF

shield

Add Secure Code Warrior contextual training to SARIF

Add contextual application security training to SARIF files, providing links to secure coding exercises and explainer videos

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Add Secure Code Warrior contextual training to SARIF

uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1.11

Learn more about this action in SecureCodeWarrior/github-action-add-sarif-contextual-training

Choose a version

GitHub Action

This GitHub Action adds Secure Code Warrior contextual application security training material to SARIF files. This training material will be displayed within Code Scanning alerts if the resulting SARIF file is imported using the github/codeql-action/upload-sarif Action, and includes links to secure coding exercises and short explainer videos where available.

This Action currently supports adding training material based on CWE references (e.g. CWE 89) and common vulnerability phrases (e.g. use-after-free vulnerability) included in static analysis findings.

Usage

Individual SARIF file

    steps
:
      
#
 Fetch SARIF - for example:

      #
 - Checkout the repository using `actions/checkout` if the SARIF file is committed. This example assumes the SARIF file is located at `sarif/findings.sarif` within the repository.

      #
     - name: Checkout repository

      #
       uses: actions/checkout@v2

      #
 - Fetch the SARIF file from your SAST tool. The vendor may already have a GitHub Action for this. This example assumes the SARIF file is fetched and saved to `sarif/findings.sarif`.

      #
     - name: Download SARIF

      #
       uses: vendor/sast-tool-sarif@v1

      #
       with:

      #
         user: ${{ secrets.USER }}

      #
         key: ${{ secrets.KEY }}

      #
         scan-id: ${{ secrets.SCAN_ID }}

      #
         output-file: sarif/findings.sarif

      #
 - Convert a SAST tool report into SARIF. The vendor may already have a GitHub Action or script for this. This example assumes the converted SARIF file is located at `sarif/findings.sarif`.

      #
     - name: Convert report to SARIF

      #
       uses: vendor/sast-tool-sarif-converter@v1

      #
       with:

      #
         report-file: reports/sast-scan.xml

      #
         output-file: sarif/findings.sarif


      - 
name
: 
Add SCW Training

        uses
: 
SecureCodeWarrior/github-action-add-sarif-contextual-training@v1

        with
:
          
inputSarifFile
: 
sarif/findings.sarif

          outputSarifFile
: 
sarif/findings.processed.sarif

          githubToken
: 
${{ secrets.GITHUB_TOKEN }}


      - 
name
: 
Import Results

        uses
: 
github/codeql-action/upload-sarif@v1

        with
:
          
sarif_file
: 
sarif/findings.processed.sarif

Multiple SARIF files using glob path

    steps
:
      
#
 Fetch SARIF - see additional examples above

      - 
name
: 
Download SARIF

        uses
: 
vendor/sast-tool-sarif@v1

        with
:
          
user
: 
${{ secrets.USER }}

          key
: 
${{ secrets.KEY }}

          scan-id
: 
${{ secrets.SCAN_ID }}

          output-dir
: 
./sarifs 
#
 in this example we assume the tool outputs multiple SARIF files as .json files


      - 
name
: 
Add SCW Training

        uses
: 
SecureCodeWarrior/github-action-add-sarif-contextual-training@v1

        with
:
          
inputSarifFile
: 
./sarifs/*.json

          outputSarifFile
: 
./processed-sarifs

          githubToken
: 
${{ secrets.GITHUB_TOKEN }}


      - 
name
: 
Import Results

        uses
: 
github/codeql-action/upload-sarif@v1

        with
:
          
sarif_file
: 
./processed-sarifs

Multiple SARIF files in directory

    steps
:
      
#
 Fetch SARIF - see additional examples above

      - 
name
: 
Download SARIF

        uses
: 
vendor/sast-tool-sarif@v1

        with
:
          
user
: 
${{ secrets.USER }}

          key
: 
${{ secrets.KEY }}

          scan-id
: 
${{ secrets.SCAN_ID }}

          output-dir
: 
./sarifs 
#
 in this example we assume the tool outputs multiple SARIF files in nested directories within the specified output directory


      - 
name
: 
Add SCW Training

        uses
: 
SecureCodeWarrior/github-action-add-sarif-contextual-training@v1

        with
:
          
inputSarifFile
: 
./sarifs

          outputSarifFile
: 
./processed-sarifs

          githubToken
: 
${{ secrets.GITHUB_TOKEN }}


      - 
name
: 
Import Results

        uses
: 
github/codeql-action/upload-sarif@v1

        with
:
          
sarif_file
: 
./processed-sarifs

Inputs

inputSarifFile

The SARIF file(s) to add Secure Code Warrior contextual training material to. This can be a path to a single file (e.g. ./findings.sarif ), a glob path (e.g. ./scans/**/*.sarif ) or a directory (d.g. ./scans ), in which case all .sarif files recursively in the specified directory will be processed. Default value: ./findings.sarif

outputSarifFile

The output path of the resulting SARIF file(s) with Secure Code Warrior contextual training material appended. If a glob path or a directory was provided as the inputSarifFile input then the resulting SARIF files will be output to the ./processed-sarifs directory, which can then simply be the path provided in the sarif_file input of the github/codeql-action/upload-sarif action. Default value: ./findings.processed.sarif

githubToken (optional)

Provide ${{ secrets.GITHUB_TOKEN }} to use the GitHub access token automatically supplied by GitHub Workflows. This enables language-specific training links to be generated (where available) by fetching the repository language from the GitHub API.

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본