packj github action
1.0.0
악의적/위험한 NPM/PYPI/RUBY 종속성에 대한 풀 요청을 감사하려면 워크 플로에 packj를 추가하십시오.
Open-Source Tool Packj로 구동됩니다.
Packj는 위험한 의존성이 발견되면 PR에 대해 언급합니다. 예제 PULL 요청 감사를 참조하십시오.

워크 플로에 다음을 추가하십시오.
- name : Packj Security Audit
uses : ossillate-inc/[email protected]
with :
# TODO: replace with your dependency files in the repo
DEPENDENCY_FILES : pypi:requirements.txt,npm:package.json,rubygems:Gemfile
REPO_TOKEN : ${{ secrets.GITHUB_TOKEN } # This is a basic workflow to help you get started with Actions
name : Packj security audit
# Controls when the workflow will run
on :
pull_request :
branches :
- main
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs :
# This workflow contains a single job called "packj-audit"
packj-security-audit :
# The type of runner that the job will run on
runs-on : ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps :
# Audit
- name : Audit dependencies
uses : ossillate-inc/[email protected]
with :
# TODO: replace with your dependency files in the repo
DEPENDENCY_FILES : pypi:requirements.txt,npm:package.json,rubygems:Gemfile
REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}secrets.GITHUB_TOKEN 기본적으로 사용됩니다 (Github Action Runner)false 로 설정하십시오.Packj는 PYPI, NPM 및 RubyGems 패키지를 감사 할 수 있습니다. 그것은 수행합니다 :
connect , exec )의 사용을위한 전체 패키지 코드를 확인합니다.open() , fork() )를 분석하여 패키지의 런타임 동작 (및 모든 종속성)을 확인합니다.만료 된 이메일 도메인, 대규모 릴리스 시간 간격, 민감한 API 등이있는 패키지는 보안상의 이유로 위험한 것으로 표시됩니다.
PACKJ의 설계는 문서화 된 오픈 소스 소프트웨어 공급망 공격의 651 개의 맬웨어 샘플에 대한 연구에 의해 안내됩니다. 패키지를 공급망 공격에 취약하게 만드는 40 개 이상의 위험한 코드 및 메타 데이터 속성을 스캔합니다.
| 위험 | 이유 |
|---|---|
| 인기있는 패키지를 가장하는 패키지 | 나쁜 배우들은 인기있는 패키지를 가장하는 악의적 인 패키지를 출판하여 오타 제곱 공격을 수행합니다 (예 : Lodash vs Loadash) |
| 오래된 패키지 또는 기타 패키지 | 오래된 또는 인재되지 않은 패키지는 보안 수정을받지 못합니다 |
| Exec 및 Eval 과 같은 민감한 API를 사용하는 패키지 | 맬웨어는 운영 체제 또는 언어 런타임의 API를 사용하여 민감한 작업을 수행합니다 (예 : SSH 키 읽기) |
| 기고자의 유효하지 않거나 이메일 주소가없는 패키지 | 이메일 주소가 잘못되거나 누락 된 이메일 주소는 계정에 2FA가 부족하여 나쁜 행위자가 패키지 소유권을 납치하기가 더 쉬워집니다. |
| 유효하지 않거나 공개 소스 repo가없는 패키지 | 공개 repo가 없다는 것은 소스 코드를 공개적으로 감사하거나 검토하는 쉬운 방법이 없음을 의미합니다. |
| 알려진 취약점을 포함하는 패키지 | 패키지 코드에서 알려진 보안 취약점 (CVE)은 나쁜 행위자가 악용 할 수 있습니다. |
PACKJ는 위협 모델에 적용되는 경고 만 보내도록 사용자 정의 할 수 있습니다. 템플릿 (아래)을 기반으로 repo에 .packj.yaml 파일을 추가하고 중요한 알림을 활성화/비활성화하기 만하면됩니다.
# # Audit policies # audit: # # Risk alerts (enable or disable according to your threat model) # alerts: # # category: malicious packages (publicly known and unknown) # malicious: contains known malware: - reason: package is known to contain a dangerous malware - enabled: true typo-squatting or repo-jacking package: - reason: package impersonates another popular package to propagate malware - enabled: true # # alert category: packages vulnerable to code exploits # vulnerable: contains known vulnerabilities: - reason: known vulnerabilities (CVEs) in package code could be exploited - enabled: true # # packages with undesirable or "risky" attributes # undesirable: package is old or abandoned: - reason: old or abandoned packages receive no security updates and are risky - enabled: true invalid or no author email: - reason: a package with lack of or invalid author email suggests 2FA not enabled - enabled: true invalid or no homepage: - reason: a package with no or invalid homepage may not be preferable - enabled: false no source repo: - reason: lack of public source repo may suggest malicious intention - enabled: true fewer downloads: - reason: a package with few downloads may not be preferable - enabled: true no or insufficient readme: - reason: a package with lack of documentation may not be preferable - enabled: false fewer versions or releases: - reason: few versions suggest unstable or inactive project - enabled: true too many dependencies: - reason: too many dependencies increase attack surface - enabled: false version release after a long gap: - reason: a release after a long time may indicate account hijacking - enabled: false contains custom installation hooks: - reason: custom installation hooks may download or execute malicious code - enabled: false # WIP # # type: repo stats # few source repo stars: - reason: a package with few repo stars may not be preferable - enabled: false few source repo forks: - reason: a package with few repo forks may not be preferable - enabled: false forked source repo: - reason: a forked copy of a popular package may contain malicious code - enabled: true # # type: APIs and permissions # generates new code: - reason: package generates new code at runtime, which could be malicious - enabled: false forks or exits OS processes: - reason: package spawns new operating system processes, which could be malicious - enabled: false accesses obfuscated (hidden) code: - enabled: true accesses environment variables: - enabled: false changes system/environment variables: - enabled: false accesses files and dirs: - enabled: false communicates with external network: - enabled: false reads user input: - enabled: false sandbox: rules: # # File system (allow or block accesses to file/dirs) # # ~/ represents home dir # . represents cwd dir # # NOTE: only ONE 'allow' and 'block' lines are allowed # fs: # TODO: customize as per your threat model # block access to home dir and all other locations (except the ones below) block: ~/, / allow: ., ~/.cache, ~/.npm, ~/.local, ~/.ruby, /tmp, /proc, /etc, /var, /bin, /usr/include, /usr/local, /usr/bin, /usr/lib, /usr/share, /lib # # Network (allow or block domains/ports) # # NOTE: only ONE 'allow' and 'block' lines are allowed # network: # TODO: customize as per your threat model # block all external network communication (except the ones below) block: 0.0.0.0 # For installing PyPI, Rubygems, and NPM packages allow: pythonhosted.org:443, pypi.org:443, rubygems.org:443, npmjs.org:0, npmjs.com:0