@cloud-copilot/iam-simulate 0.1.71 → 0.1.73
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/cjs/context_keys/contextKeys.js +1 -1
- package/dist/cjs/context_keys/contextKeys.js.map +1 -1
- package/dist/cjs/global_conditions/globalConditionKeys.d.ts +2 -25
- package/dist/cjs/global_conditions/globalConditionKeys.d.ts.map +1 -1
- package/dist/cjs/global_conditions/globalConditionKeys.js +3 -312
- package/dist/cjs/global_conditions/globalConditionKeys.js.map +1 -1
- package/dist/cjs/simulation_engine/contextKeys.d.ts.map +1 -1
- package/dist/cjs/simulation_engine/contextKeys.js +9 -3
- package/dist/cjs/simulation_engine/contextKeys.js.map +1 -1
- package/dist/esm/context_keys/contextKeys.js +1 -1
- package/dist/esm/context_keys/contextKeys.js.map +1 -1
- package/dist/esm/global_conditions/globalConditionKeys.d.ts +2 -25
- package/dist/esm/global_conditions/globalConditionKeys.d.ts.map +1 -1
- package/dist/esm/global_conditions/globalConditionKeys.js +3 -307
- package/dist/esm/global_conditions/globalConditionKeys.js.map +1 -1
- package/dist/esm/simulation_engine/contextKeys.d.ts.map +1 -1
- package/dist/esm/simulation_engine/contextKeys.js +10 -4
- package/dist/esm/simulation_engine/contextKeys.js.map +1 -1
- package/package.json +2 -2
|
@@ -106,7 +106,7 @@ function replaceVariableInContextKey(specKey, actualKey) {
|
|
|
106
106
|
async function typeForContextKey(contextKey) {
|
|
107
107
|
const globalConditionKey = (0, globalConditionKeys_js_1.getGlobalConditionKeyWithOrWithoutPrefix)(contextKey);
|
|
108
108
|
if (globalConditionKey) {
|
|
109
|
-
return globalConditionKey.
|
|
109
|
+
return globalConditionKey.type;
|
|
110
110
|
}
|
|
111
111
|
const keyDetails = await serviceContextKeyDetails(contextKey);
|
|
112
112
|
if (keyDetails) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextKeys.js","sourceRoot":"","sources":["../../../src/context_ke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;IAED,MAAM,UAAU,GAAG,MAAM,wBAAwB,CAAC,UAAU,CAAC,CAAA;IAC7D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,IAAwB,CAAA;IAC5C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iBAAiB,UAAU,YAAY,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,CAAA;IAC/B,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
key: string;
|
|
4
|
-
category: string;
|
|
5
|
-
dataType: ConditionKeyType;
|
|
6
|
-
}
|
|
7
|
-
export declare function getGlobalConditionKeyWithOrWithoutPrefix(key: string): GlobalConditionKey | undefined;
|
|
8
|
-
export declare function getGlobalConditionKey(key: string): GlobalConditionKey | undefined;
|
|
9
|
-
export declare function globalConditionKeyExists(key: string): boolean;
|
|
10
|
-
export declare function getGlobalConditionKeysByCategory(category: string): GlobalConditionKey[];
|
|
11
|
-
/**
|
|
12
|
-
* Get the details for a global condition key that has a variable by it's prefix
|
|
13
|
-
* for example, it will find aws:ResourceTag/tag-key if you pass in aws:ResourceTag
|
|
14
|
-
*
|
|
15
|
-
* @param prefix - The prefix of the global condition key, case insensitive
|
|
16
|
-
* @returns The global condition key details if found
|
|
17
|
-
*/
|
|
18
|
-
export declare function getVariableGlobalConditionKeyByPrefix(prefix: string): GlobalConditionKey | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Get all the global condition keys as lower case strings
|
|
21
|
-
*
|
|
22
|
-
* @returns a list of all the global condition keys
|
|
23
|
-
*/
|
|
24
|
-
export declare function allGlobalConditionKeys(): string[];
|
|
25
|
-
export {};
|
|
1
|
+
import { ConditionKey } from '@cloud-copilot/iam-data';
|
|
2
|
+
export declare function getGlobalConditionKeyWithOrWithoutPrefix(key: string): ConditionKey | undefined;
|
|
26
3
|
//# sourceMappingURL=globalConditionKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalConditionKeys.d.ts","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"globalConditionKeys.d.ts","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,yBAAyB,CAAA;AAEhC,wBAAgB,wCAAwC,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAM9F"}
|
|
@@ -1,321 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGlobalConditionKeyWithOrWithoutPrefix = getGlobalConditionKeyWithOrWithoutPrefix;
|
|
4
|
-
|
|
5
|
-
exports.globalConditionKeyExists = globalConditionKeyExists;
|
|
6
|
-
exports.getGlobalConditionKeysByCategory = getGlobalConditionKeysByCategory;
|
|
7
|
-
exports.getVariableGlobalConditionKeyByPrefix = getVariableGlobalConditionKeyByPrefix;
|
|
8
|
-
exports.allGlobalConditionKeys = allGlobalConditionKeys;
|
|
9
|
-
const globalConditionKeys = [
|
|
10
|
-
{
|
|
11
|
-
key: 'aws:PrincipalArn',
|
|
12
|
-
category: 'principal',
|
|
13
|
-
dataType: 'ARN'
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
key: 'aws:PrincipalAccount',
|
|
17
|
-
category: 'principal',
|
|
18
|
-
dataType: 'String'
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
key: 'aws:PrincipalOrgPaths',
|
|
22
|
-
category: 'principal',
|
|
23
|
-
dataType: 'ArrayOfString'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
key: 'aws:PrincipalOrgID',
|
|
27
|
-
category: 'principal',
|
|
28
|
-
dataType: 'String'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
key: 'aws:PrincipalTag/tag-key',
|
|
32
|
-
category: 'principal',
|
|
33
|
-
dataType: 'String'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
key: 'aws:PrincipalIsAWSService',
|
|
37
|
-
category: 'principal',
|
|
38
|
-
dataType: 'Bool'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
key: 'aws:PrincipalServiceName',
|
|
42
|
-
category: 'principal',
|
|
43
|
-
dataType: 'String'
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: 'aws:PrincipalServiceNamesList',
|
|
47
|
-
category: 'principal',
|
|
48
|
-
dataType: 'ArrayOfString'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
key: 'aws:PrincipalType',
|
|
52
|
-
category: 'principal',
|
|
53
|
-
dataType: 'String'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
key: 'aws:userid',
|
|
57
|
-
category: 'principal',
|
|
58
|
-
dataType: 'String'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
key: 'aws:username',
|
|
62
|
-
category: 'principal',
|
|
63
|
-
dataType: 'String'
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
key: 'aws:AssumedRoot',
|
|
67
|
-
category: 'session',
|
|
68
|
-
dataType: 'String'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: 'aws:FederatedProvider',
|
|
72
|
-
category: 'session',
|
|
73
|
-
dataType: 'String'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
key: 'aws:TokenIssueTime',
|
|
77
|
-
category: 'session',
|
|
78
|
-
dataType: 'Date'
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
key: 'aws:MultiFactorAuthAge',
|
|
82
|
-
category: 'session',
|
|
83
|
-
dataType: 'Numeric'
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
key: 'aws:MultiFactorAuthPresent',
|
|
87
|
-
category: 'session',
|
|
88
|
-
dataType: 'Bool'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
key: 'aws:ChatbotSourceArn',
|
|
92
|
-
category: 'session',
|
|
93
|
-
dataType: 'ARN'
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
key: 'aws:Ec2InstanceSourceVpc',
|
|
97
|
-
category: 'session',
|
|
98
|
-
dataType: 'String'
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
key: 'aws:Ec2InstanceSourcePrivateIPv4',
|
|
102
|
-
category: 'session',
|
|
103
|
-
dataType: 'IPAddress'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
key: 'aws:SourceIdentity',
|
|
107
|
-
category: 'session',
|
|
108
|
-
dataType: 'String'
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: 'ec2:RoleDelivery',
|
|
112
|
-
category: 'session',
|
|
113
|
-
dataType: 'Numeric'
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
key: 'ec2:SourceInstanceArn',
|
|
117
|
-
category: 'session',
|
|
118
|
-
dataType: 'ARN'
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
key: 'glue:RoleAssumedBy',
|
|
122
|
-
category: 'session',
|
|
123
|
-
dataType: 'String'
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
key: 'glue:CredentialIssuingService',
|
|
127
|
-
category: 'session',
|
|
128
|
-
dataType: 'String'
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
key: 'lambda:SourceFunctionArn',
|
|
132
|
-
category: 'session',
|
|
133
|
-
dataType: 'ARN'
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
key: 'ssm:SourceInstanceArn',
|
|
137
|
-
category: 'session',
|
|
138
|
-
dataType: 'ARN'
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
key: 'identitystore:UserId',
|
|
142
|
-
category: 'session',
|
|
143
|
-
dataType: 'String'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
key: 'aws:SourceIp',
|
|
147
|
-
category: 'network',
|
|
148
|
-
dataType: 'IPAddress'
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
key: 'aws:SourceVpc',
|
|
152
|
-
category: 'network',
|
|
153
|
-
dataType: 'String'
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
key: 'aws:SourceVpce',
|
|
157
|
-
category: 'network',
|
|
158
|
-
dataType: 'String'
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
key: 'aws:VpcSourceIp ',
|
|
162
|
-
category: 'network',
|
|
163
|
-
dataType: 'IPAddress'
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
key: 'aws:ResourceAccount',
|
|
167
|
-
category: 'resource',
|
|
168
|
-
dataType: 'String'
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
key: 'aws:ResourceOrgID',
|
|
172
|
-
category: 'resource',
|
|
173
|
-
dataType: 'String'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
key: 'aws:ResourceOrgPaths',
|
|
177
|
-
category: 'resource',
|
|
178
|
-
dataType: 'ArrayOfString'
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
key: 'aws:ResourceTag/tag-key',
|
|
182
|
-
category: 'resource',
|
|
183
|
-
dataType: 'String'
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
key: 'aws:CalledVia',
|
|
187
|
-
category: 'request',
|
|
188
|
-
dataType: 'ArrayOfString'
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
key: 'aws:CalledViaFirst',
|
|
192
|
-
category: 'request',
|
|
193
|
-
dataType: 'String'
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
key: 'aws:CalledViaLast',
|
|
197
|
-
category: 'request',
|
|
198
|
-
dataType: 'String'
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
key: 'aws:ViaAWSService',
|
|
202
|
-
category: 'request',
|
|
203
|
-
dataType: 'Bool'
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
key: 'aws:CurrentTime',
|
|
207
|
-
category: 'request',
|
|
208
|
-
dataType: 'Date'
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
key: 'aws:EpochTime',
|
|
212
|
-
category: 'request',
|
|
213
|
-
dataType: 'Date' //Can Also be Numeric...
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
key: 'aws:referer',
|
|
217
|
-
category: 'request',
|
|
218
|
-
dataType: 'String'
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
key: 'aws:RequestedRegion',
|
|
222
|
-
category: 'request',
|
|
223
|
-
dataType: 'String'
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
key: 'aws:RequestTag/tag-key',
|
|
227
|
-
category: 'request',
|
|
228
|
-
dataType: 'String'
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
key: 'aws:TagKeys',
|
|
232
|
-
category: 'request',
|
|
233
|
-
dataType: 'ArrayOfString'
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
key: 'aws:SecureTransport',
|
|
237
|
-
category: 'request',
|
|
238
|
-
dataType: 'Bool'
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
key: 'aws:SourceArn',
|
|
242
|
-
category: 'request',
|
|
243
|
-
dataType: 'ARN'
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
key: 'aws:SourceAccount',
|
|
247
|
-
category: 'request',
|
|
248
|
-
dataType: 'String'
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
key: 'aws:SourceOwner',
|
|
252
|
-
category: 'request',
|
|
253
|
-
dataType: 'String'
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
key: 'aws:SourceOrgPaths',
|
|
257
|
-
category: 'request',
|
|
258
|
-
dataType: 'ArrayOfString'
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
key: 'aws:SourceOrgID',
|
|
262
|
-
category: 'request',
|
|
263
|
-
dataType: 'String'
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
key: 'aws:UserAgent',
|
|
267
|
-
category: 'request',
|
|
268
|
-
dataType: 'String'
|
|
269
|
-
}
|
|
270
|
-
];
|
|
271
|
-
const keysByName = globalConditionKeys.reduce((acc, key) => {
|
|
272
|
-
acc[key.key.toLowerCase()] = key;
|
|
273
|
-
return acc;
|
|
274
|
-
}, {});
|
|
275
|
-
const variableKeysByName = globalConditionKeys.reduce((acc, key) => {
|
|
276
|
-
if (key.key.includes('/')) {
|
|
277
|
-
acc[key.key.split('/')[0].toLowerCase()] = key;
|
|
278
|
-
}
|
|
279
|
-
return acc;
|
|
280
|
-
}, {});
|
|
281
|
-
const keysByCategory = globalConditionKeys.reduce((acc, key) => {
|
|
282
|
-
const lowerCategory = key.category.toLowerCase();
|
|
283
|
-
acc[lowerCategory] = acc[lowerCategory] || [];
|
|
284
|
-
acc[lowerCategory].push(key);
|
|
285
|
-
return acc;
|
|
286
|
-
}, {});
|
|
4
|
+
const iam_data_1 = require("@cloud-copilot/iam-data");
|
|
287
5
|
function getGlobalConditionKeyWithOrWithoutPrefix(key) {
|
|
288
6
|
const slashIndex = key.indexOf('/');
|
|
289
7
|
if (slashIndex !== -1) {
|
|
290
|
-
return
|
|
8
|
+
return (0, iam_data_1.getGlobalConditionKeyByPrefix)(key.slice(0, slashIndex));
|
|
291
9
|
}
|
|
292
|
-
return
|
|
293
|
-
}
|
|
294
|
-
function getGlobalConditionKey(key) {
|
|
295
|
-
return keysByName[key.toLowerCase()];
|
|
296
|
-
}
|
|
297
|
-
function globalConditionKeyExists(key) {
|
|
298
|
-
return !!getGlobalConditionKey(key);
|
|
299
|
-
}
|
|
300
|
-
function getGlobalConditionKeysByCategory(category) {
|
|
301
|
-
return keysByCategory[category.toLowerCase()] || [];
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Get the details for a global condition key that has a variable by it's prefix
|
|
305
|
-
* for example, it will find aws:ResourceTag/tag-key if you pass in aws:ResourceTag
|
|
306
|
-
*
|
|
307
|
-
* @param prefix - The prefix of the global condition key, case insensitive
|
|
308
|
-
* @returns The global condition key details if found
|
|
309
|
-
*/
|
|
310
|
-
function getVariableGlobalConditionKeyByPrefix(prefix) {
|
|
311
|
-
return variableKeysByName[prefix.toLowerCase()];
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Get all the global condition keys as lower case strings
|
|
315
|
-
*
|
|
316
|
-
* @returns a list of all the global condition keys
|
|
317
|
-
*/
|
|
318
|
-
function allGlobalConditionKeys() {
|
|
319
|
-
return Object.keys(keysByName);
|
|
10
|
+
return (0, iam_data_1.getGlobalConditionKeyByName)(key);
|
|
320
11
|
}
|
|
321
12
|
//# sourceMappingURL=globalConditionKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalConditionKeys.js","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"globalConditionKeys.js","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":";;AAMA,4FAMC;AAZD,sDAIgC;AAEhC,SAAgB,wCAAwC,CAAC,GAAW;IAClE,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACtB,OAAO,IAAA,wCAA6B,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAA;IAChE,CAAC;IACD,OAAO,IAAA,sCAA2B,EAAC,GAAG,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextKeys.d.ts","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contextKeys.d.ts","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAwBnB"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allowedContextKeysForRequest = allowedContextKeysForRequest;
|
|
4
4
|
const iam_data_1 = require("@cloud-copilot/iam-data");
|
|
5
|
-
const globalConditionKeys_js_1 = require("../global_conditions/globalConditionKeys.js");
|
|
6
5
|
const util_js_1 = require("../util.js");
|
|
7
6
|
/**
|
|
8
7
|
* Get the allowed context keys for a request.
|
|
@@ -18,7 +17,7 @@ async function allowedContextKeysForRequest(service, action, resource) {
|
|
|
18
17
|
const actionConditionKeys = (0, util_js_1.lowerCaseAll)(actionDetails.conditionKeys);
|
|
19
18
|
const isWildCardOnly = await (0, util_js_1.isWildcardOnlyAction)(service, action);
|
|
20
19
|
if (isWildCardOnly) {
|
|
21
|
-
return [...actionConditionKeys, ...(
|
|
20
|
+
return [...actionConditionKeys, ...lowerCaseGlobalConditionKeys()];
|
|
22
21
|
}
|
|
23
22
|
const resourceTypes = await (0, util_js_1.getResourceTypesForAction)(service, action, resource);
|
|
24
23
|
if (resourceTypes.length === 0) {
|
|
@@ -31,7 +30,14 @@ async function allowedContextKeysForRequest(service, action, resource) {
|
|
|
31
30
|
return [
|
|
32
31
|
...(0, util_js_1.lowerCaseAll)(resourceTypeConditions),
|
|
33
32
|
...actionConditionKeys,
|
|
34
|
-
...(
|
|
33
|
+
...lowerCaseGlobalConditionKeys()
|
|
35
34
|
];
|
|
36
35
|
}
|
|
36
|
+
let lowerCaseConditionKeys;
|
|
37
|
+
function lowerCaseGlobalConditionKeys() {
|
|
38
|
+
if (!lowerCaseConditionKeys) {
|
|
39
|
+
lowerCaseConditionKeys = (0, iam_data_1.getAllGlobalConditionKeys)().map((k) => k.toLowerCase());
|
|
40
|
+
}
|
|
41
|
+
return lowerCaseConditionKeys;
|
|
42
|
+
}
|
|
37
43
|
//# sourceMappingURL=contextKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextKeys.js","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"contextKeys.js","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":";;AAYA,oEA4BC;AAxCD,sDAAqF;AACrF,wCAA0F;AAE1F;;;;;;;;GAQG;AACI,KAAK,UAAU,4BAA4B,CAChD,OAAe,EACf,MAAc,EACd,QAAgB;IAEhB,MAAM,aAAa,GAAG,MAAM,IAAA,2BAAgB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC7D,MAAM,mBAAmB,GAAG,IAAA,sBAAY,EAAC,aAAa,CAAC,aAAa,CAAC,CAAA;IAErE,MAAM,cAAc,GAAG,MAAM,IAAA,8BAAoB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAClE,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,mBAAmB,EAAE,GAAG,4BAA4B,EAAE,CAAC,CAAA;IACpE,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,IAAA,mCAAyB,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IAChF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,sCAAsC,MAAM,eAAe,OAAO,EAAE,CAAC,CAAA;IACvF,CAAC;SAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,eAAe,OAAO,EAAE,CAAC,CAAA;IAC7F,CAAC;IACD,MAAM,sBAAsB,GAAG,aAAa,CAAC,aAAa,CAAC,IAAI,CAC7D,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CACxC,CAAC,aAAa,CAAA;IAEhB,OAAO;QACL,GAAG,IAAA,sBAAY,EAAC,sBAAsB,CAAC;QACvC,GAAG,mBAAmB;QACtB,GAAG,4BAA4B,EAAE;KAClC,CAAA;AACH,CAAC;AAED,IAAI,sBAA4C,CAAA;AAChD,SAAS,4BAA4B;IACnC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,sBAAsB,GAAG,IAAA,oCAAyB,GAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;IAClF,CAAC;IACD,OAAO,sBAAsB,CAAA;AAC/B,CAAC"}
|
|
@@ -100,7 +100,7 @@ function replaceVariableInContextKey(specKey, actualKey) {
|
|
|
100
100
|
export async function typeForContextKey(contextKey) {
|
|
101
101
|
const globalConditionKey = getGlobalConditionKeyWithOrWithoutPrefix(contextKey);
|
|
102
102
|
if (globalConditionKey) {
|
|
103
|
-
return globalConditionKey.
|
|
103
|
+
return globalConditionKey.type;
|
|
104
104
|
}
|
|
105
105
|
const keyDetails = await serviceContextKeyDetails(contextKey);
|
|
106
106
|
if (keyDetails) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextKeys.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AAU,iBAAiB,CAAC,UAAkB;IACxD,MAAM,kBAAkB,GAAG,wCAAwC,CAAC,UAAU,CAAC,CAAA;IAC/E,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC,IAAwB,CAAA;IACpD,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,wBAAwB,CAAC,UAAU,CAAC,CAAA;IAC7D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,IAAwB,CAAA;IAC5C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iBAAiB,UAAU,YAAY,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,CAAA;IAC/B,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
key: string;
|
|
4
|
-
category: string;
|
|
5
|
-
dataType: ConditionKeyType;
|
|
6
|
-
}
|
|
7
|
-
export declare function getGlobalConditionKeyWithOrWithoutPrefix(key: string): GlobalConditionKey | undefined;
|
|
8
|
-
export declare function getGlobalConditionKey(key: string): GlobalConditionKey | undefined;
|
|
9
|
-
export declare function globalConditionKeyExists(key: string): boolean;
|
|
10
|
-
export declare function getGlobalConditionKeysByCategory(category: string): GlobalConditionKey[];
|
|
11
|
-
/**
|
|
12
|
-
* Get the details for a global condition key that has a variable by it's prefix
|
|
13
|
-
* for example, it will find aws:ResourceTag/tag-key if you pass in aws:ResourceTag
|
|
14
|
-
*
|
|
15
|
-
* @param prefix - The prefix of the global condition key, case insensitive
|
|
16
|
-
* @returns The global condition key details if found
|
|
17
|
-
*/
|
|
18
|
-
export declare function getVariableGlobalConditionKeyByPrefix(prefix: string): GlobalConditionKey | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Get all the global condition keys as lower case strings
|
|
21
|
-
*
|
|
22
|
-
* @returns a list of all the global condition keys
|
|
23
|
-
*/
|
|
24
|
-
export declare function allGlobalConditionKeys(): string[];
|
|
25
|
-
export {};
|
|
1
|
+
import { ConditionKey } from '@cloud-copilot/iam-data';
|
|
2
|
+
export declare function getGlobalConditionKeyWithOrWithoutPrefix(key: string): ConditionKey | undefined;
|
|
26
3
|
//# sourceMappingURL=globalConditionKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalConditionKeys.d.ts","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"globalConditionKeys.d.ts","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,yBAAyB,CAAA;AAEhC,wBAAgB,wCAAwC,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAM9F"}
|
|
@@ -1,313 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
{
|
|
3
|
-
key: 'aws:PrincipalArn',
|
|
4
|
-
category: 'principal',
|
|
5
|
-
dataType: 'ARN'
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
key: 'aws:PrincipalAccount',
|
|
9
|
-
category: 'principal',
|
|
10
|
-
dataType: 'String'
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
key: 'aws:PrincipalOrgPaths',
|
|
14
|
-
category: 'principal',
|
|
15
|
-
dataType: 'ArrayOfString'
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
key: 'aws:PrincipalOrgID',
|
|
19
|
-
category: 'principal',
|
|
20
|
-
dataType: 'String'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
key: 'aws:PrincipalTag/tag-key',
|
|
24
|
-
category: 'principal',
|
|
25
|
-
dataType: 'String'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
key: 'aws:PrincipalIsAWSService',
|
|
29
|
-
category: 'principal',
|
|
30
|
-
dataType: 'Bool'
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
key: 'aws:PrincipalServiceName',
|
|
34
|
-
category: 'principal',
|
|
35
|
-
dataType: 'String'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
key: 'aws:PrincipalServiceNamesList',
|
|
39
|
-
category: 'principal',
|
|
40
|
-
dataType: 'ArrayOfString'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
key: 'aws:PrincipalType',
|
|
44
|
-
category: 'principal',
|
|
45
|
-
dataType: 'String'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
key: 'aws:userid',
|
|
49
|
-
category: 'principal',
|
|
50
|
-
dataType: 'String'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
key: 'aws:username',
|
|
54
|
-
category: 'principal',
|
|
55
|
-
dataType: 'String'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
key: 'aws:AssumedRoot',
|
|
59
|
-
category: 'session',
|
|
60
|
-
dataType: 'String'
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
key: 'aws:FederatedProvider',
|
|
64
|
-
category: 'session',
|
|
65
|
-
dataType: 'String'
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
key: 'aws:TokenIssueTime',
|
|
69
|
-
category: 'session',
|
|
70
|
-
dataType: 'Date'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
key: 'aws:MultiFactorAuthAge',
|
|
74
|
-
category: 'session',
|
|
75
|
-
dataType: 'Numeric'
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
key: 'aws:MultiFactorAuthPresent',
|
|
79
|
-
category: 'session',
|
|
80
|
-
dataType: 'Bool'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
key: 'aws:ChatbotSourceArn',
|
|
84
|
-
category: 'session',
|
|
85
|
-
dataType: 'ARN'
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
key: 'aws:Ec2InstanceSourceVpc',
|
|
89
|
-
category: 'session',
|
|
90
|
-
dataType: 'String'
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
key: 'aws:Ec2InstanceSourcePrivateIPv4',
|
|
94
|
-
category: 'session',
|
|
95
|
-
dataType: 'IPAddress'
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
key: 'aws:SourceIdentity',
|
|
99
|
-
category: 'session',
|
|
100
|
-
dataType: 'String'
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
key: 'ec2:RoleDelivery',
|
|
104
|
-
category: 'session',
|
|
105
|
-
dataType: 'Numeric'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
key: 'ec2:SourceInstanceArn',
|
|
109
|
-
category: 'session',
|
|
110
|
-
dataType: 'ARN'
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
key: 'glue:RoleAssumedBy',
|
|
114
|
-
category: 'session',
|
|
115
|
-
dataType: 'String'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
key: 'glue:CredentialIssuingService',
|
|
119
|
-
category: 'session',
|
|
120
|
-
dataType: 'String'
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
key: 'lambda:SourceFunctionArn',
|
|
124
|
-
category: 'session',
|
|
125
|
-
dataType: 'ARN'
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
key: 'ssm:SourceInstanceArn',
|
|
129
|
-
category: 'session',
|
|
130
|
-
dataType: 'ARN'
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
key: 'identitystore:UserId',
|
|
134
|
-
category: 'session',
|
|
135
|
-
dataType: 'String'
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
key: 'aws:SourceIp',
|
|
139
|
-
category: 'network',
|
|
140
|
-
dataType: 'IPAddress'
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
key: 'aws:SourceVpc',
|
|
144
|
-
category: 'network',
|
|
145
|
-
dataType: 'String'
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
key: 'aws:SourceVpce',
|
|
149
|
-
category: 'network',
|
|
150
|
-
dataType: 'String'
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
key: 'aws:VpcSourceIp ',
|
|
154
|
-
category: 'network',
|
|
155
|
-
dataType: 'IPAddress'
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
key: 'aws:ResourceAccount',
|
|
159
|
-
category: 'resource',
|
|
160
|
-
dataType: 'String'
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
key: 'aws:ResourceOrgID',
|
|
164
|
-
category: 'resource',
|
|
165
|
-
dataType: 'String'
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
key: 'aws:ResourceOrgPaths',
|
|
169
|
-
category: 'resource',
|
|
170
|
-
dataType: 'ArrayOfString'
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
key: 'aws:ResourceTag/tag-key',
|
|
174
|
-
category: 'resource',
|
|
175
|
-
dataType: 'String'
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
key: 'aws:CalledVia',
|
|
179
|
-
category: 'request',
|
|
180
|
-
dataType: 'ArrayOfString'
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
key: 'aws:CalledViaFirst',
|
|
184
|
-
category: 'request',
|
|
185
|
-
dataType: 'String'
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
key: 'aws:CalledViaLast',
|
|
189
|
-
category: 'request',
|
|
190
|
-
dataType: 'String'
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
key: 'aws:ViaAWSService',
|
|
194
|
-
category: 'request',
|
|
195
|
-
dataType: 'Bool'
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
key: 'aws:CurrentTime',
|
|
199
|
-
category: 'request',
|
|
200
|
-
dataType: 'Date'
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
key: 'aws:EpochTime',
|
|
204
|
-
category: 'request',
|
|
205
|
-
dataType: 'Date' //Can Also be Numeric...
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
key: 'aws:referer',
|
|
209
|
-
category: 'request',
|
|
210
|
-
dataType: 'String'
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
key: 'aws:RequestedRegion',
|
|
214
|
-
category: 'request',
|
|
215
|
-
dataType: 'String'
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
key: 'aws:RequestTag/tag-key',
|
|
219
|
-
category: 'request',
|
|
220
|
-
dataType: 'String'
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
key: 'aws:TagKeys',
|
|
224
|
-
category: 'request',
|
|
225
|
-
dataType: 'ArrayOfString'
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
key: 'aws:SecureTransport',
|
|
229
|
-
category: 'request',
|
|
230
|
-
dataType: 'Bool'
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
key: 'aws:SourceArn',
|
|
234
|
-
category: 'request',
|
|
235
|
-
dataType: 'ARN'
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
key: 'aws:SourceAccount',
|
|
239
|
-
category: 'request',
|
|
240
|
-
dataType: 'String'
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
key: 'aws:SourceOwner',
|
|
244
|
-
category: 'request',
|
|
245
|
-
dataType: 'String'
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
key: 'aws:SourceOrgPaths',
|
|
249
|
-
category: 'request',
|
|
250
|
-
dataType: 'ArrayOfString'
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
key: 'aws:SourceOrgID',
|
|
254
|
-
category: 'request',
|
|
255
|
-
dataType: 'String'
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
key: 'aws:UserAgent',
|
|
259
|
-
category: 'request',
|
|
260
|
-
dataType: 'String'
|
|
261
|
-
}
|
|
262
|
-
];
|
|
263
|
-
const keysByName = globalConditionKeys.reduce((acc, key) => {
|
|
264
|
-
acc[key.key.toLowerCase()] = key;
|
|
265
|
-
return acc;
|
|
266
|
-
}, {});
|
|
267
|
-
const variableKeysByName = globalConditionKeys.reduce((acc, key) => {
|
|
268
|
-
if (key.key.includes('/')) {
|
|
269
|
-
acc[key.key.split('/')[0].toLowerCase()] = key;
|
|
270
|
-
}
|
|
271
|
-
return acc;
|
|
272
|
-
}, {});
|
|
273
|
-
const keysByCategory = globalConditionKeys.reduce((acc, key) => {
|
|
274
|
-
const lowerCategory = key.category.toLowerCase();
|
|
275
|
-
acc[lowerCategory] = acc[lowerCategory] || [];
|
|
276
|
-
acc[lowerCategory].push(key);
|
|
277
|
-
return acc;
|
|
278
|
-
}, {});
|
|
1
|
+
import { getGlobalConditionKeyByName, getGlobalConditionKeyByPrefix } from '@cloud-copilot/iam-data';
|
|
279
2
|
export function getGlobalConditionKeyWithOrWithoutPrefix(key) {
|
|
280
3
|
const slashIndex = key.indexOf('/');
|
|
281
4
|
if (slashIndex !== -1) {
|
|
282
|
-
return
|
|
5
|
+
return getGlobalConditionKeyByPrefix(key.slice(0, slashIndex));
|
|
283
6
|
}
|
|
284
|
-
return
|
|
285
|
-
}
|
|
286
|
-
export function getGlobalConditionKey(key) {
|
|
287
|
-
return keysByName[key.toLowerCase()];
|
|
288
|
-
}
|
|
289
|
-
export function globalConditionKeyExists(key) {
|
|
290
|
-
return !!getGlobalConditionKey(key);
|
|
291
|
-
}
|
|
292
|
-
export function getGlobalConditionKeysByCategory(category) {
|
|
293
|
-
return keysByCategory[category.toLowerCase()] || [];
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Get the details for a global condition key that has a variable by it's prefix
|
|
297
|
-
* for example, it will find aws:ResourceTag/tag-key if you pass in aws:ResourceTag
|
|
298
|
-
*
|
|
299
|
-
* @param prefix - The prefix of the global condition key, case insensitive
|
|
300
|
-
* @returns The global condition key details if found
|
|
301
|
-
*/
|
|
302
|
-
export function getVariableGlobalConditionKeyByPrefix(prefix) {
|
|
303
|
-
return variableKeysByName[prefix.toLowerCase()];
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Get all the global condition keys as lower case strings
|
|
307
|
-
*
|
|
308
|
-
* @returns a list of all the global condition keys
|
|
309
|
-
*/
|
|
310
|
-
export function allGlobalConditionKeys() {
|
|
311
|
-
return Object.keys(keysByName);
|
|
7
|
+
return getGlobalConditionKeyByName(key);
|
|
312
8
|
}
|
|
313
9
|
//# sourceMappingURL=globalConditionKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalConditionKeys.js","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"globalConditionKeys.js","sourceRoot":"","sources":["../../../src/global_conditions/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAEhC,MAAM,UAAU,wCAAwC,CAAC,GAAW;IAClE,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACtB,OAAO,6BAA6B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAA;IAChE,CAAC;IACD,OAAO,2BAA2B,CAAC,GAAG,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextKeys.d.ts","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contextKeys.d.ts","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAwBnB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { iamActionDetails } from '@cloud-copilot/iam-data';
|
|
2
|
-
import { allGlobalConditionKeys } from '../global_conditions/globalConditionKeys.js';
|
|
1
|
+
import { getAllGlobalConditionKeys, iamActionDetails } from '@cloud-copilot/iam-data';
|
|
3
2
|
import { getResourceTypesForAction, isWildcardOnlyAction, lowerCaseAll } from '../util.js';
|
|
4
3
|
/**
|
|
5
4
|
* Get the allowed context keys for a request.
|
|
@@ -15,7 +14,7 @@ export async function allowedContextKeysForRequest(service, action, resource) {
|
|
|
15
14
|
const actionConditionKeys = lowerCaseAll(actionDetails.conditionKeys);
|
|
16
15
|
const isWildCardOnly = await isWildcardOnlyAction(service, action);
|
|
17
16
|
if (isWildCardOnly) {
|
|
18
|
-
return [...actionConditionKeys, ...
|
|
17
|
+
return [...actionConditionKeys, ...lowerCaseGlobalConditionKeys()];
|
|
19
18
|
}
|
|
20
19
|
const resourceTypes = await getResourceTypesForAction(service, action, resource);
|
|
21
20
|
if (resourceTypes.length === 0) {
|
|
@@ -28,7 +27,14 @@ export async function allowedContextKeysForRequest(service, action, resource) {
|
|
|
28
27
|
return [
|
|
29
28
|
...lowerCaseAll(resourceTypeConditions),
|
|
30
29
|
...actionConditionKeys,
|
|
31
|
-
...
|
|
30
|
+
...lowerCaseGlobalConditionKeys()
|
|
32
31
|
];
|
|
33
32
|
}
|
|
33
|
+
let lowerCaseConditionKeys;
|
|
34
|
+
function lowerCaseGlobalConditionKeys() {
|
|
35
|
+
if (!lowerCaseConditionKeys) {
|
|
36
|
+
lowerCaseConditionKeys = getAllGlobalConditionKeys().map((k) => k.toLowerCase());
|
|
37
|
+
}
|
|
38
|
+
return lowerCaseConditionKeys;
|
|
39
|
+
}
|
|
34
40
|
//# sourceMappingURL=contextKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextKeys.js","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"contextKeys.js","sourceRoot":"","sources":["../../../src/simulation_engine/contextKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACrF,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,OAAe,EACf,MAAc,EACd,QAAgB;IAEhB,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC7D,MAAM,mBAAmB,GAAG,YAAY,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;IAErE,MAAM,cAAc,GAAG,MAAM,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAClE,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,mBAAmB,EAAE,GAAG,4BAA4B,EAAE,CAAC,CAAA;IACpE,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IAChF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,sCAAsC,MAAM,eAAe,OAAO,EAAE,CAAC,CAAA;IACvF,CAAC;SAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,eAAe,OAAO,EAAE,CAAC,CAAA;IAC7F,CAAC;IACD,MAAM,sBAAsB,GAAG,aAAa,CAAC,aAAa,CAAC,IAAI,CAC7D,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CACxC,CAAC,aAAa,CAAA;IAEhB,OAAO;QACL,GAAG,YAAY,CAAC,sBAAsB,CAAC;QACvC,GAAG,mBAAmB;QACtB,GAAG,4BAA4B,EAAE;KAClC,CAAA;AACH,CAAC;AAED,IAAI,sBAA4C,CAAA;AAChD,SAAS,4BAA4B;IACnC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,sBAAsB,GAAG,yBAAyB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;IAClF,CAAC;IACD,OAAO,sBAAsB,CAAA;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-copilot/iam-simulate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.73",
|
|
4
4
|
"description": "Simulate evaluation of AWS IAM policies",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vitest": "^3.0.7"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@cloud-copilot/iam-data": ">=0.
|
|
52
|
+
"@cloud-copilot/iam-data": ">=0.15.0 <1.0.0",
|
|
53
53
|
"@cloud-copilot/iam-policy": "^0.1.35",
|
|
54
54
|
"@cloud-copilot/iam-utils": "^0.1.7"
|
|
55
55
|
},
|