メインコンテンツへスキップ

All Posts

News bits

vltのPhased Package Installations

vlt v1.0.0-rc.1でPhased Package Installationsを導入。パッケージのインストールとビルドを2つのフェーズに分離し、セキュリティを向上。

従来のパッケージマネージャーはインストール時に自動的にライフサイクルスクリプト(preinstallpostinstallなど)を実行。これにより、インストール前にスクリプトの内容を確認できず、悪意のある依存関係が即座にコードを実行するリスクがあった。

vltではvlt installvlt buildを分離。vlt installはパッケージの解決・ダウンロード・展開のみを実行し、デフォルトで全てのinstall scriptsをブロック(--allow-scriptsのデフォルト値は:not(*))。vlt buildでライフサイクルスクリプトを実行。デフォルトのvlt build:scripts:not(:built):not(:malware)をターゲットとし、スクリプトを持つパッケージのうち、未ビルドかつマルウェアフラグが立っていないもののみをビルド。

Dependency Selector Syntaxで細かく制御可能。特定のスコープやパッケージのみにスクリプト実行を許可、直接依存関係のみに制限、マルウェアフラグが立ったパッケージを除外などが可能。設定はvlt.jsonに保存してチーム全体で共有可能。

bash
# Phase 1: パッケージのダウンロード・展開のみ(スクリプトは実行されない)
$ vlt install

# Phase 2: ライフサイクルスクリプトの実行
$ vlt build

vlt queryで依存関係を確認可能。:scriptsでスクリプトを持つパッケージを一覧、:malwareでマルウェアフラグが立ったパッケージを確認、:builtでビルド済みパッケージを確認できる。

出展:Introducing Phased Package Installations

著者について

Hi there. I'm hrdtbs, a frontend expert and technical consultant. I started my career in the creative industry over 13 years ago, learning on the job as a 3DCG modeler and game engineer in the indie scene.

In 2015 I began working as a freelance web designer and engineer. I handled everything from design and development to operation and advertising, delivering comprehensive solutions for various clients.

In 2016 I joined Wemotion as CTO, where I built the engineering team from the ground up and led the development of core web and mobile applications for three years.

In 2019 I joined matsuri technologies as a Frontend Expert, and in 2020 I also began serving as a technical manager supporting streamers and content creators.

I'm so grateful to be working in this field, doing something that brings me so much joy. Thanks for stopping by.