@proofgate-cdk/model 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +37 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/** 権限昇格経路を検出するルールの安定した識別子です。 */
|
|
2
2
|
export declare const RULE_ID: "PG-IAM-004";
|
|
3
|
+
/**
|
|
4
|
+
* IAMを書き換えて権限を得る経路(自己昇格)のルールIDです(spec proofgate-self-escalation)。
|
|
5
|
+
* The rule ID of paths in which a role changes IAM itself (self-escalation).
|
|
6
|
+
*/
|
|
7
|
+
export declare const RULE_ID_POLICY_WRITE: "PG-IAM-005";
|
|
3
8
|
/** CloudFormationのPolicy Statementを、出典付きで正規化した表現です。 */
|
|
4
9
|
export interface StatementModel {
|
|
5
10
|
readonly effect: "Allow" | "Deny";
|
|
@@ -14,10 +19,31 @@ export interface RoleModel {
|
|
|
14
19
|
readonly trustServices: readonly string[];
|
|
15
20
|
readonly statements: readonly StatementModel[];
|
|
16
21
|
}
|
|
22
|
+
/** ロールで動く既存のリソースの種類です(spec proofgate-implicit-role-paths)。 */
|
|
23
|
+
export type ResourceKind = "lambda-function" | "codebuild-project" | "stepfunctions-state-machine";
|
|
24
|
+
/**
|
|
25
|
+
* ロールを持つリソースです。主体がこのリソースを変更できると、`iam:PassRole`なしでそのロールの権限でコードを動かせます。
|
|
26
|
+
* A resource that runs as a role. A principal that can change it can run code as that role without `iam:PassRole`.
|
|
27
|
+
*/
|
|
28
|
+
export interface ResourceModel {
|
|
29
|
+
readonly logicalId: string;
|
|
30
|
+
readonly kind: ResourceKind;
|
|
31
|
+
/** テンプレートがリテラルで付けた物理名です。なければ、不透明な名前`_generated_<LogicalId>`として読みます。 */
|
|
32
|
+
readonly name?: string;
|
|
33
|
+
/** 物理名がintrinsicで、値を読めないときtrueです。どのResourceパターンも一致しうるものとして扱います(過剰検出の側)。 */
|
|
34
|
+
readonly nameUnknown?: boolean;
|
|
35
|
+
/** このリソースが引き受けるロール(同じテンプレート内)のLogical IDです。 */
|
|
36
|
+
readonly roleLogicalId?: string;
|
|
37
|
+
/** ロールを特定できないときtrueです(パラメータ、インポート、テンプレートにないロールなど)。このとき`roleLogicalId`はありません。 */
|
|
38
|
+
readonly roleUnknown?: boolean;
|
|
39
|
+
readonly sourcePath: string;
|
|
40
|
+
}
|
|
17
41
|
/** TypeScriptとLeanの間で受け渡す、CDKに依存しないスタックモデルです。 */
|
|
18
42
|
export interface StackModel {
|
|
19
43
|
readonly version: "1";
|
|
20
44
|
readonly roles: readonly RoleModel[];
|
|
45
|
+
/** ロールで動くリソースです。なければ空として読みます。 */
|
|
46
|
+
readonly resources?: readonly ResourceModel[];
|
|
21
47
|
}
|
|
22
48
|
/** アプリケーションごとに指定するProofGateの安全条件です。 */
|
|
23
49
|
export interface ProofGateConfig {
|
|
@@ -25,15 +51,25 @@ export interface ProofGateConfig {
|
|
|
25
51
|
readonly protectedBucketArns: readonly string[];
|
|
26
52
|
/** 明示的に許可するPassRole先のLogical IDです。 */
|
|
27
53
|
readonly allowedPassRoleTargets?: readonly string[];
|
|
54
|
+
/**
|
|
55
|
+
* IAMを書き換えることが意図されたロールのLogical IDです。`PG-IAM-005`の対象から除きます(spec proofgate-self-escalation)。
|
|
56
|
+
* Logical IDs of roles that write IAM on purpose; they are excluded from `PG-IAM-005`. An ID that matches no role is ignored.
|
|
57
|
+
*/
|
|
58
|
+
readonly allowedPolicyWriters?: readonly string[];
|
|
28
59
|
}
|
|
29
60
|
/** PG-IAM-004で検出した経路と、診断表示に必要な根拠です。 */
|
|
30
61
|
export interface Violation {
|
|
31
|
-
readonly ruleId: typeof RULE_ID;
|
|
62
|
+
readonly ruleId: typeof RULE_ID | typeof RULE_ID_POLICY_WRITE;
|
|
32
63
|
readonly principalLogicalId: string;
|
|
33
64
|
readonly targetRoleLogicalId: string;
|
|
34
65
|
readonly protectedBucketArn: string;
|
|
35
66
|
readonly sourcePaths: readonly string[];
|
|
36
67
|
readonly explanation: string;
|
|
68
|
+
/**
|
|
69
|
+
* `iam:PassRole`の要らない経路のとき、変更できるリソースのLogical IDです。PassRoleの経路にはありません。
|
|
70
|
+
* Set for a path without `iam:PassRole`: the Logical ID of the resource that the principal can change.
|
|
71
|
+
*/
|
|
72
|
+
readonly resourceLogicalId?: string;
|
|
37
73
|
}
|
|
38
74
|
/** 現在の有限モデルへ安全に変換できなかったCloudFormation構文です。 */
|
|
39
75
|
export interface UnsupportedFinding {
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/** 権限昇格経路を検出するルールの安定した識別子です。 */
|
|
2
2
|
export const RULE_ID = "PG-IAM-004";
|
|
3
|
+
/**
|
|
4
|
+
* IAMを書き換えて権限を得る経路(自己昇格)のルールIDです(spec proofgate-self-escalation)。
|
|
5
|
+
* The rule ID of paths in which a role changes IAM itself (self-escalation).
|
|
6
|
+
*/
|
|
7
|
+
export const RULE_ID_POLICY_WRITE = "PG-IAM-005";
|
|
3
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,YAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,YAAqB,CAAC;AAC7C;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAqB,CAAC"}
|