เพิ่ม PackJ ลงในเวิร์กโฟลว์ของคุณเพื่อตรวจสอบคำขอดึงของคุณสำหรับการพึ่งพา NPM/PYPI/Ruby ที่เป็นอันตราย/เสี่ยง
ขับเคลื่อนด้วยเครื่องมือโอเพนซอร์ซของเรา
PackJ จะแสดงความคิดเห็นเกี่ยวกับการประชาสัมพันธ์หากพบการพึ่งพาที่มีความเสี่ยง ดูตัวอย่างการตรวจสอบคำขอดึง

เพียงเพิ่มสิ่งต่อไปนี้ในเวิร์กโฟลว์ของคุณ:
- 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)falsePackJ สามารถตรวจสอบแพ็คเกจ PYPI, NPM และ RubyGems มันดำเนินการ:
connect , exec )open() , fork() )แพ็คเกจที่มีโดเมนอีเมลที่หมดอายุช่องว่างเวลาวางจำหน่ายขนาดใหญ่ API ที่ละเอียดอ่อน ฯลฯ จะถูกตั้งค่าสถานะเป็นความเสี่ยงด้วยเหตุผลด้านความปลอดภัย
การออกแบบ PackJ นั้นได้รับคำแนะนำจากการศึกษาตัวอย่างมัลแวร์ 651 ตัวอย่างของการโจมตีซัพพลายเชนซอฟต์แวร์โอเพนซอร์ซที่บันทึกไว้ มันสแกนสำหรับรหัสที่มีความเสี่ยง 40+ และคุณลักษณะข้อมูลเมตาที่ทำให้แพคเกจมีความเสี่ยงต่อการโจมตีห่วงโซ่อุปทาน
| เสี่ยง | เหตุผล |
|---|---|
| แพ็คเกจการแอบอ้างแพ็คเกจยอดนิยม | นักแสดงที่ไม่ดีดำเนินการโจมตีที่พิมพ์ผิดพลาดโดยแพ็คเกจที่เป็นอันตรายที่เผยแพร่แพ็คเกจยอดนิยม (เช่น Lodash vs Loadash) |
| แพ็คเกจเก่าหรือ abandonded | แพ็คเกจเก่าหรือไม่ได้รับการแก้ไขไม่ได้รับการแก้ไขความปลอดภัย |
| แพ็คเกจโดยใช้ APIs ที่ละเอียดอ่อนเช่น Exec และ Eval | มัลแวร์ใช้ APIs จากระบบปฏิบัติการหรือรันไทม์ภาษาเพื่อดำเนินการที่ละเอียดอ่อน (เช่นอ่านคีย์ SSH) |
| แพ็คเกจที่มีที่อยู่อีเมลไม่ถูกต้องหรือไม่มี | ที่อยู่อีเมลไม่ถูกต้องหรือขาดหาย |
| แพ็คเกจที่มีการซื้อคืนที่ไม่ถูกต้องหรือไม่มีแหล่งสาธารณะ | การไม่มีการซื้อคืนสาธารณะหมายถึงวิธีการตรวจสอบหรือตรวจสอบรหัสแหล่งที่มาสาธารณะอย่างง่ายดาย |
| แพ็คเกจที่มีช่องโหว่ที่รู้จัก | ช่องโหว่ด้านความปลอดภัยที่รู้จักกันดี (CVES) ในรหัสแพ็คเกจอาจถูกนำไปใช้โดยนักแสดงที่ไม่ดี |
PackJ สามารถปรับแต่งเพื่อส่งการแจ้งเตือนที่ใช้กับรูปแบบการคุกคามของคุณเท่านั้น เพียงเพิ่มไฟล์ .packj.yaml ใน repo ของคุณตามเทมเพลตของเรา (ด้านล่าง) และเปิด/ปิดการแจ้งเตือนที่สำคัญสำหรับคุณ
# # 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