Skip to content

Commit 2f94abd

Browse files
committed
Merge remote-tracking branch 'origin/alpha' into fix/connection-subnet-nacl
2 parents d79a230 + 447b324 commit 2f94abd

125 files changed

Lines changed: 2059 additions & 1766 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1+
# [0.79.0-alpha.8](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.7...0.79.0-alpha.8) (2022-04-11)
2+
3+
4+
### Bug Fixes
5+
6+
* Added iamRole connection to kinesisFirehose service ([dc17214](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/dc1721403a6d86aa1d7a00542dff237011514654))
7+
8+
# [0.79.0-alpha.7](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.6...0.79.0-alpha.7) (2022-04-11)
9+
10+
11+
### Bug Fixes
12+
13+
* Added iamRole to lambda service ([ae6177d](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/ae6177de995975ab5194c5d2fcc8aaf98ec8d06d))
14+
15+
# [0.79.0-alpha.6](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.5...0.79.0-alpha.6) (2022-04-11)
16+
17+
18+
### Features
19+
20+
* Handle TODOs for ecs cluster ([554dff7](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/554dff7785dc2c69403a41416c7739625fd02263))
21+
* Update kms connection ([1e3e66d](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/1e3e66d41e886bbb39ad9f000167fa93c7313b26))
22+
* Updated README connections ([f536b73](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/f536b73f97c1f0ddbea687588e5d10f089fd2500))
23+
24+
# [0.79.0-alpha.5](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.4...0.79.0-alpha.5) (2022-04-08)
25+
26+
27+
### Bug Fixes
28+
29+
* Fixed error scanning iamUsers without enough permissions ([43b7d22](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/43b7d22c4b3c8b0056ec302f7ec8e7ec9646fa0f))
30+
31+
# [0.79.0-alpha.4](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.3...0.79.0-alpha.4) (2022-04-08)
32+
33+
34+
### Features
35+
36+
* Handle TODOs for dynamoDB ([d2b42ce](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/d2b42cec491776ecebbedc30f691a49960cfd47e))
37+
* Handle TODOs for dynamoDB ([9b3ae42](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/9b3ae425097f06972f292f3c82930bd7f97bb5ac))
38+
39+
# [0.79.0-alpha.3](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.2...0.79.0-alpha.3) (2022-04-08)
40+
41+
42+
### Features
43+
44+
* **appSync:** add iamRole/wafV2WebAcl connections ([36b90f2](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/36b90f256445568dd33d9f0fcbed8dc66531407a))
45+
46+
# [0.79.0-alpha.2](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0-alpha.1...0.79.0-alpha.2) (2022-04-08)
47+
48+
49+
### Features
50+
51+
* Added iamInstanceProfile connection ([652f2f7](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/652f2f7b9bf551cab37afa2893bea5bb504699c9))
52+
* Added IamRole connection to ec2 ([4ff22ec](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/4ff22ecb130345de06cd6afd06c15f2978c8a4c7))
53+
* Handle TODOs for EC2 ([832fc7b](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/832fc7bdff1a02d89fbdbf50d1d030669d7568b9))
54+
55+
# [0.79.0-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.78.2-alpha.1...0.79.0-alpha.1) (2022-04-07)
56+
57+
58+
### Features
59+
60+
* Handle TODOs for dynamoDB ([625701e](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/625701ea2a47b6be8bdf1fe910a541fd6f1ed132))
61+
* Handle TODOs for dynamoDB ([2911751](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/2911751e96908793dc1b042b07c28bba340f1134))
62+
63+
## [0.78.2-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.78.1...0.78.2-alpha.1) (2022-04-06)
64+
65+
66+
### Bug Fixes
67+
68+
* Standardized aws service schemas using base schema ([f0f7cfd](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/f0f7cfdc3b71a202f211ed7255ea6b0aa1e4988d))
69+
170
## [0.78.1](https://gitlab.com/auto-cloud/cloudgraph/provider/cloudgraph-provider-aws/compare/0.78.0...0.78.1) (2022-03-29)
271

372

README.md

Lines changed: 97 additions & 96 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudgraph/cg-provider-aws",
3-
"version": "0.78.1",
3+
"version": "0.79.0-alpha.8",
44
"description": "cloud-graph provider plugin for AWS used to fetch AWS cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",
@@ -76,4 +76,4 @@
7676
"git add --force"
7777
]
7878
}
79-
}
79+
}

src/enums/relations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export default {
88
route53HostedZone: ['route53Record'],
99
emrCluster: ['emrInstance', 'emrStep'],
1010
ecsService: ['ecsTaskSet', 'ecsTaskDefinition'],
11+
iamInstanceProfile: ['ec2Instance'],
1112
}

src/services/account/schema.graphql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
type awsAccount @key(fields: "id") {
2-
id: String! @id @search(by: [hash])
1+
type awsAccount implements awsOptionalService @key(fields: "id") {
32
regions: [String] @search(by: [hash])
43
albs: [awsAlb]
54
apiGatewayResources: [awsApiGatewayResource]

src/services/alb/schema.graphql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
type awsAlb @key(fields: "arn") {
2-
id: String! @id @search(by: [hash, regexp])
1+
type awsAlb implements awsBaseService @key(fields: "arn") {
32
name: String @search(by: [hash, regexp])
4-
accountId: String! @search(by: [hash, regexp])
5-
arn: String! @id @search(by: [hash, regexp])
6-
region: String @search(by: [hash, regexp])
73
dnsName: String @search(by: [hash, regexp])
84
scheme: String @search(by: [hash, regexp])
95
type: String @search(by: [hash, regexp])

src/services/apiGatewayResource/schema.graphql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ type awsApiGatewayMethod @key(fields: "arn") {
66
apiKeyRequired: Boolean @search
77
}
88

9-
type awsApiGatewayResource @key(fields: "arn") {
10-
id: String! @search(by: [hash])
11-
accountId: String! @search(by: [hash])
12-
arn: String! @id @search(by: [hash, regexp])
13-
region: String @search(by: [hash, regexp])
9+
type awsApiGatewayResource implements awsBaseService @key(fields: "arn") {
1410
restApi: [awsApiGatewayRestApi] @hasInverse(field: resources) #change to plural
1511
path: String @search(by: [hash, regexp])
1612
methods: [awsApiGatewayMethod]
17-
}
13+
}

src/services/apiGatewayRestApi/schema.graphql

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ type awsApiGatewayEndpointConfiguration {
44
vpcEndpointIds: [String] @search(by: [hash])
55
}
66

7-
type awsApiGatewayRestApi @key(fields: "arn") {
8-
id: String! @id @search(by: [hash])
9-
accountId: String! @search(by: [hash])
10-
arn: String! @id @search(by: [hash, regexp])
11-
region: String @search(by: [hash, regexp])
7+
type awsApiGatewayRestApi implements awsBaseService @key(fields: "arn") {
128
description: String @search(by: [hash, regexp, fulltext])
139
policy: awsIamJSONPolicy
1410
endpointConfiguration: awsApiGatewayEndpointConfiguration
@@ -21,5 +17,3 @@ type awsApiGatewayRestApi @key(fields: "arn") {
2117
resources: [awsApiGatewayResource] @hasInverse(field: restApi)
2218
route53Record: [awsRoute53Record] @hasInverse(field: restApi) #change to plural
2319
}
24-
25-

src/services/apiGatewayStage/schema.graphql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ type awsApiGatewayStageVariable
2020
value: String @search(by: [hash])
2121
}
2222

23-
type awsApiGatewayStage @key(fields: "arn") {
24-
id: String! @search(by: [hash])
25-
accountId: String! @search(by: [hash])
26-
arn: String! @id @search(by: [hash, regexp])
27-
region: String @search(by: [hash, regexp])
23+
type awsApiGatewayStage implements awsBaseService @key(fields: "arn") {
2824
name: String @search(by: [hash, regexp])
2925
description: String @search(by: [hash, regexp, fulltext])
3026
cacheCluster: Boolean @search

src/services/appSync/connections.ts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import { RawAwsDynamoDbTable } from '../dynamodb/data'
1010
import { RawAwsLambdaFunction } from '../lambda/data'
1111
import { RawAwsCognitoUserPool } from '../cognitoUserPool/data'
1212
import { RawAwsRdsCluster } from '../rdsCluster/data'
13+
import { RawAwsIamRole } from '../iamRole/data'
14+
import { globalRegionName } from '../../enums/regions'
15+
import { RawAwsWafV2WebAcl } from '../wafV2WebAcl/data'
1316

1417
/**
1518
* AppSync
@@ -27,7 +30,7 @@ export default ({
2730
region: string
2831
}): { [key: string]: ServiceConnection[] } => {
2932
const connections: ServiceConnection[] = []
30-
const { apiId: id, awsDataSources, userPoolConfig } = appSync
33+
const { apiId: id, awsDataSources, userPoolConfig, wafWebAclArn } = appSync
3134

3235
/**
3336
* Find cognito user pools
@@ -153,6 +156,60 @@ export default ({
153156
}
154157
}
155158

159+
/**
160+
* Find related IAM Roles
161+
*/
162+
const roles: { name: string; data: { [property: string]: any[] } } =
163+
data.find(({ name }) => name === services.iamRole)
164+
165+
const roleArns = awsDataSources?.map(
166+
({ serviceRoleArn }) => serviceRoleArn
167+
)
168+
169+
if (roles?.data?.[globalRegionName]) {
170+
const dataAtRegion: RawAwsIamRole[] = roles.data[globalRegionName].filter(
171+
role => roleArns.includes(role.Arn)
172+
)
173+
if (!isEmpty(dataAtRegion)) {
174+
for (const instance of dataAtRegion) {
175+
const { Arn: arn }: RawAwsIamRole = instance
176+
177+
connections.push({
178+
id: arn,
179+
resourceType: services.iamRole,
180+
relation: 'child',
181+
field: 'iamRoles',
182+
})
183+
}
184+
}
185+
}
186+
187+
/**
188+
* Find wafV2WebAcls
189+
*/
190+
const acls: {
191+
name: string
192+
data: { [property: string]: RawAwsWafV2WebAcl[] }
193+
} = data.find(({ name }) => name === services.wafV2WebAcl)
194+
195+
if (acls?.data) {
196+
const allAcls = Object.values(acls.data).flat()
197+
const dataInRegion: RawAwsWafV2WebAcl[] = allAcls.filter(
198+
({ ARN }: RawAwsWafV2WebAcl) => ARN === wafWebAclArn
199+
)
200+
201+
if (!isEmpty(dataInRegion)) {
202+
for (const acl of dataInRegion) {
203+
connections.push({
204+
id: acl.Id,
205+
resourceType: services.wafV2WebAcl,
206+
relation: 'child',
207+
field: 'webAcl',
208+
})
209+
}
210+
}
211+
}
212+
156213
const appSyncResult = {
157214
[id]: connections,
158215
}

0 commit comments

Comments
 (0)