Skip to content

Latest commit

Β 

History

History
121 lines (99 loc) Β· 6.48 KB

File metadata and controls

121 lines (99 loc) Β· 6.48 KB
published true
title γ„΄ FOSSLight Source Scanner

FOSSLight Source Scanner

FOSSLight Source is released under the Apache-2.0 License. Current python package version. GitHub Repository REUSE status

FOSSLight Source ScannerλŠ” ScanCode, SCANOSS와 KB(LGE Only) mode둜 λ™μž‘ν•©λ‹ˆλ‹€.

  • ScanCode : 파일 μ•ˆμ— ν¬ν•¨λœ Copyrightκ³Ό License 문ꡬλ₯Ό κ²€μΆœν•©λ‹ˆλ‹€.
  • SCANOSS : OSS Name, OSS Version, Download Location, Copyright, License 정보λ₯Ό OSSKBμ—μ„œ κ²€μƒ‰ν•©λ‹ˆλ‹€.
  • KB(LGE Only) : LGμ „μžμ—μ„œ κ΅¬μΆ•ν•œ Knowledge Database μ„œλ²„λ‘œλΆ€ν„° ν•΄λ‹Ή 파일의 좜처λ₯Ό μ‘°νšŒν•˜μ—¬ OSS Name, OSS Version, Download Location 정보λ₯Ό 좜λ ₯ν•©λ‹ˆλ‹€.

Build Script, Binary, Directory, νŠΉμ • Directory (ex-test), μˆ¨κΉ€ 폴더 μ•ˆμ˜ νŒŒμΌμ€ μ œμ™Έλ©λ‹ˆλ‹€.

μ„€μΉ˜ 방법

{: .left-bar-title} FOSSLight Source ScannerλŠ” pip3λ₯Ό μ΄μš©ν•˜μ—¬ μ„€μΉ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
python 3.10 + virtualenv ν™˜κ²½μ—μ„œ μ„€μΉ˜ν•  것을 ꢌμž₯ν•©λ‹ˆλ‹€.

$ pip3 install fosslight_source



μ‹€ν–‰ 방법

{: .left-bar-title}

Source Code 뢄석을 μ‹€ν–‰ν•œ ν›„ FOSSLight Report ν˜•μ‹μœΌλ‘œ 좜λ ₯ν•©λ‹ˆλ‹€.

$ fosslight_source [option] <arguments>

Options

{: .specific-title}

πŸ“– Usage
    ────────────────────────────────────────────────────────────────────
    fosslight_source [options] <arguments>

    πŸ“ Description
    ────────────────────────────────────────────────────────────────────
    FOSSLight Source Scanner analyzes source code to detect copyright and
    license information using several modes.

    Note: Build scripts, binary files, and test directories are automatically
          excluded from analysis.

    πŸ“š Guide: https://fosslight.org/fosslight-guide/scanner/2_source.html

    βš™οΈ  General Options
    ────────────────────────────────────────────────────────────────────
    -p <path>              Source path to analyze (default: current directory)
    -o <path>              Output file path or directory
    -f <format>            Output formats: excel, csv, opossum, yaml, spdx-yaml, spdx-json, spdx-xml, spdx-tag, cyclonedx-json, cyclonedx-xml
                           (multiple formats can be specified, separated by space)
    -e <pattern>           Exclude paths from analysis (files and directories)
                           ⚠️  IMPORTANT: Always wrap in quotes to avoid shell expansion
                           Example: fosslight_source -e "dev/" "tests/" "*.jar"
    -m                     Generate detailed scan results on separate sheets
    -h                     Show this help message
    -v                     Show version information

    πŸ” Scanner-Specific Options
    ────────────────────────────────────────────────────────────────────
    -s <mode>              Choose mode: scancode, scanoss, kb, or all(default)
    -c <number>            Number of CPU cores/threads to use for scanning
    -t <seconds>           Timeout in seconds for ScanCode scanning
    -j                     Generate raw scanner results in JSON format
    --no_correction        Skip OSS information correction with sbom-info.yaml
    --correct_fpath <path> Path to custom sbom-info.yaml file
    --hide_progress        Hide the progress bar during scanning

    πŸ’‘ Examples
    ────────────────────────────────────────────────────────────────────
    # Scan current directory
    fosslight_source

    # Scan specific path with exclusions
    fosslight_source -p /path/to/source -e "test/" "node_modules/"

    # Generate output in specific format
    fosslight_source -f excel -o results/

    # Generate raw scanner results in JSON format
    fosslight_source -p /path/to/source -j
  • -s μ˜΅μ…˜μ΄ μΆ”κ°€λ˜μ§€ μ•Šμ„ 경우 all λͺ¨λ“œ(ScanCode, SCANOSS, KB)κ°€ λ™μž‘ν•œ κ²°κ³Όκ°€ μ·¨ν•©λ©λ‹ˆλ‹€.
  • -e μ˜΅μ…˜ κ΄€λ ¨ Pattern λ§€μΉ­ κ°€μ΄λ“œ
    • ⚠️ μ‚¬μš© μ‹œ λ°˜λ“œμ‹œ 쌍 λ”°μ˜΄ν‘œ("")λ₯Ό μ΄μš©ν•˜μ—¬ μž…λ ₯ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.
      • μ˜ˆμ‹œ) fosslight_source -e "dev/" "tests/"
    • ⚠️ μž…λ ₯ μ‹œ 파일λͺ…κ³Ό ν™•μž₯μžλŠ” λŒ€μ†Œλ¬Έμžλ₯Ό μ •ν™•νžˆ ꡬ뢄해야 ν•©λ‹ˆλ‹€.

Example

{: .specific-title} Source Code 뢄석

$ fosslight_source -p /home/source_path 

κ²°κ³Ό

{: .left-bar-title}

$ tree
.
β”œβ”€β”€ fosslight_log_src_260311_1503.txt   
└── fosslight_report_src_260311_1544.xlsx  
  • fosslight_log_src_[datetime].txt : μ‹€ν–‰ λ‘œκ·Έκ°€ μ €μž₯된 파일
  • fosslight_report_src_[datetime].xlsx : FOSSLight Report ν˜•νƒœμ˜ Source Code 뢄석 κ²°κ³Ό
  • fosslight_opossum_src_[datetime].json : OpossumUIμ—μ„œ ν™œμš© κ°€λŠ₯ν•œ Source Code 뢄석 κ²°κ³Ό ( -f opossum μ˜΅μ…˜)
  • fosslight_report_src_[datetime].csv : FOSSLight Reportλ₯Ό csv둜 좜λ ₯ν•œ κ²°κ³Ό ( -f csv μ˜΅μ…˜)
  • scancode_raw_result.json : ScanCode μ‹€ν–‰ κ²°κ³Ό ( -j μ˜΅μ…˜ )
  • scanoss_raw_result.json : SCANOSS μ‹€ν–‰ κ²°κ³Ό ( -j μ˜΅μ…˜ )
  • scanner_output.wfp : SCANOSS μ‹€ν–‰ μ‹œ μƒμ„±λœ Finger Print ( -j μ˜΅μ…˜ )