npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@proofgate-cdk/cdk-plugin

v1.2.0

Published

Lean-powered AWS CDK policy validation plugin for application-specific IAM safety rules.

Downloads

848

Readme

@proofgate-cdk/cdk-plugin

Leanでアプリケーション固有のIAM安全条件を検査する、AWS CDK Validation Pluginです。

インストール

pnpm add @proofgate-cdk/cdk-plugin aws-cdk-lib

Node.js 26以降と、elanで導入したLean 4 / Lakeが必要です。Leanのバージョンはパッケージに同梱したlean/lean-toolchainで固定されています。プラグインは初回検証時に同梱Leanプロジェクトを自動ビルドし、同じsynth内では成果物を再利用します。

CDKへの導入

import { ProofGateValidator } from "@proofgate-cdk/cdk-plugin";
import { App, Validations } from "aws-cdk-lib";

const app = new App();

Validations.of(app).addPlugins(
  new ProofGateValidator({
    protectedBucketArns: ["arn:aws:s3:::production-data"],
  }),
);

プラグインはcdk synth中に合成済みCloudFormationを読み取り、危険な権限昇格経路をPG-IAM-004、ロールが自分でIAMを書き換えられる構成をPG-IAM-005、未対応構文やツールチェーン障害をPG-IAM-003として報告します。 検査する経路は、次の2つです。(1) iam:PassRoleと起動サービス(Lambda、ECS、EC2、CodeBuild、Step Functionsなど)の操作の組み合わせで、渡したロールが保護対象バケットへ届くもの。(2) iam:PassRoleなしで、保護対象バケットへ届くロールで動いている既存のLambda関数、CodeBuildプロジェクト、Step Functionsのステートマシンを変更できるもの(lambda:UpdateFunctionCode、codebuild:StartBuildなど)。どちらもPG-IAM-004です。allowedPassRoleTargetsに挙げたロールは、両方の経路で許可されます。(3) ロールが、自分のロールにポリシーを付けられる(iam:PutRolePolicy、iam:AttachRolePolicy)、バケットに届く別のロールの信頼ポリシーを書き換えられる(iam:UpdateAssumeRolePolicy)、ロールを作ってポリシーを付けられる(iam:CreateRoleと付与)もの。これはPG-IAM-005で、Action: "*"の管理者ロールも入ります。意図してIAMを書き換えるロールは、論理IDをallowedPolicyWritersに入れると許可されます。

ResourceにIAMポリシー変数(${aws:username}など)を含むStatementは、評価せず未対応としてPG-IAM-003で拒否します。

導入の注意

  • 保護対象バケットは、固定の名前(bucketName)とリテラルのARNで指定します。bucket.bucketArnはトークンなので使えません。
  • 普段のsynthに影響させないため、if (process.env.PROOFGATE === "1")の中で登録し、PROOFGATE=1 npx cdk synthで検査します。
  • 読む管理ポリシーは7件だけです(AWSLambdaBasicExecutionRole、AWSLambdaVPCAccessExecutionRole、AmazonAPIGatewayPushToCloudWatchLogs、AmazonSSMManagedInstanceCore、AWSGlueServiceRole、Backupの2件)。ほかの管理ポリシーや、Resourceのパラメータ、Fn::ImportValueはPG-IAM-003になります。
  • IAMリソースのないテンプレートは受理します。検査するプリンシパルがないからで、「証明済み」という意味ではありません。
  • SCP、Permissions Boundary、リソースポリシー、条件、スタックをまたぐ参照、CloudFormationのスタックロール、PassRoleの要らない経路のうち上の3種類以外のサービス(ECS、SSM、Glueなど)、IAMユーザーとグループ、ロールの連鎖は、モデルの外です。

English: the path is iam:PassRole plus a launch action of a service (Lambda, ECS, EC2, CodeBuild, Step Functions, and others) whose passed role reaches a protected bucket. Paths without iam:PassRole (changing an existing Lambda function, CodeBuild project, or state machine) are PG-IAM-004 too. A role that can change IAM itself (self-grant, take-over, creation grant; administrator roles included) is PG-IAM-005; list a role that writes IAM on purpose in allowedPolicyWriters. Use a fixed bucket name and a literal ARN, and register the plugin under PROOFGATE=1. Only seven managed policies are read. A template without IAM resources is accepted because there is nothing to check, not because it was proved safe.

詳細な対応IAM構文と信頼境界は、ProofGateリポジトリを参照してください。