Skip to content

Commit 0dbc17f

Browse files
authored
Merge pull request #120 from cloudgraphdev/beta
Release 0.86.0
2 parents 46a41e7 + 4a934e2 commit 0dbc17f

29 files changed

+625
-3
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
# [0.86.0-beta.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.85.1...0.86.0-beta.1) (2023-03-08)
2+
3+
4+
### Bug Fixes
5+
6+
* **CG-1328:** add account level s3 public access block for the rule check ([0ab5f21](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/0ab5f21c2d6dfd8d4697e731bd659c8b26101114))
7+
* **services:** expose scope on wafv2 ([82f044a](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/82f044a715795171414c87753ab5d81ffc15cbc5))
8+
* **services:** update format file for new schema ([2a3333f](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/2a3333fb4d3384564f24206384d3b0e8ae1f131b))
9+
* **services:** update route53 to have setIdentifier and name in the schema ([904ba79](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/904ba7969be00078ee33bc7890bf35dc6fb7ce1c))
10+
11+
12+
### Features
13+
14+
* **CG-1339:** add aws ebs snapshot ([376551a](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/376551ad7bdd0de51833351c24c13c99a974df93))
15+
* **CG-1339:** add kms connection to ebs snapshot ([beac5fd](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/beac5fd6bf78e29dac14cbbd4ae58f70dfe19cb0))
16+
* **CG-1339:** update README ([38a9d5e](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/38a9d5e43c75734c73505bcc074fe2c61517617a))
17+
18+
# [0.86.0-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.85.2-alpha.1...0.86.0-alpha.1) (2023-03-08)
19+
20+
21+
### Bug Fixes
22+
23+
* **services:** expose scope on wafv2 ([82f044a](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/82f044a715795171414c87753ab5d81ffc15cbc5))
24+
* **services:** update format file for new schema ([2a3333f](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/2a3333fb4d3384564f24206384d3b0e8ae1f131b))
25+
* **services:** update route53 to have setIdentifier and name in the schema ([904ba79](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/904ba7969be00078ee33bc7890bf35dc6fb7ce1c))
26+
27+
28+
### Features
29+
30+
* **CG-1339:** add aws ebs snapshot ([376551a](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/376551ad7bdd0de51833351c24c13c99a974df93))
31+
* **CG-1339:** add kms connection to ebs snapshot ([beac5fd](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/beac5fd6bf78e29dac14cbbd4ae58f70dfe19cb0))
32+
* **CG-1339:** update README ([38a9d5e](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/38a9d5e43c75734c73505bcc074fe2c61517617a))
33+
34+
## [0.85.2-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.85.1...0.85.2-alpha.1) (2023-03-05)
35+
36+
37+
### Bug Fixes
38+
39+
* **CG-1328:** add account level s3 public access block for the rule check ([0ab5f21](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/0ab5f21c2d6dfd8d4697e731bd659c8b26101114))
40+
141
## [0.85.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.85.0...0.85.1) (2023-02-11)
242

343

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ CloudGraph AWS Provider will ask you what regions you would like to crawl and wi
9494
| customerGateway | vpnConnection |
9595
| dynamodb | appSync, iamRole, kms |
9696
| dmsReplicationInstance | securityGroup, subnet, vpc, kms |
97-
| ebs | asg, ec2, emrInstance |
97+
| ebs | asg, ec2, emrInstance, ebsSnapshot |
98+
| ebsSnapshot | ebs, kms |
9899
| ec2 | alb, asg, ebs, eip, emrInstance, eksCluster, elasticBeanstalkEnv, iamInstanceProfile, iamRole, networkInterface, securityGroup, subnet, systemsManagerInstance, vpc, ecsContainer |
99100
| ecr | |
100101
| ecsCluster | cloudwatchLog, ecsService, ecsTask, ecsTaskSet, kms, s3 |
@@ -134,7 +135,7 @@ CloudGraph AWS Provider will ask you what regions you would like to crawl and wi
134135
| iot | |
135136
| kinesisFirehose | kinesisStream, s3, iamRole |
136137
| kinesisStream | kinesisFirehose |
137-
| kms | cloudtrail, cloudwatchLog, codebuild, ecsCluster, efs, eksCluster, elastiCacheReplicationGroup, elasticSearchDomain, emrCluster, managedAirflow, lambda, rdsCluster, rdsClusterSnapshot, rdsDbInstance, sns, sageMakerNotebookInstance, secretsManager, dmsReplicationInstance, redshiftCluster, s3 |
138+
| kms | cloudtrail, cloudwatchLog, codebuild, ecsCluster, efs, eksCluster, elastiCacheReplicationGroup, elasticSearchDomain, emrCluster, managedAirflow, lambda, rdsCluster, rdsClusterSnapshot, rdsDbInstance, sns, sageMakerNotebookInstance, secretsManager, dmsReplicationInstance, redshiftCluster, s3, ebsSnapshot |
138139
| lambda | appSync, cognitoUserPool, kms, s3, secretsManager, securityGroup, subnet, vpc, iamRole |
139140
| managedAirflow | cloudwatchLog, iamRole, kms, securityGroups, subnet, s3 |
140141
| managedPrefixList | |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudgraph/cg-provider-aws",
3-
"version": "0.85.1",
3+
"version": "0.86.0-beta.1",
44
"description": "cloud-graph provider plugin for AWS used to fetch AWS cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",

src/enums/resources.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default {
2323
sqsQueue: 'aws_sqs_queue',
2424
iamGroup: 'aws_iam_group',
2525
snsTopic: 'aws_sns_topic',
26+
ebsSnapshot: 'aws_ebs_snapshot',
2627
ebsVolume: 'aws_ebs_volume',
2728
iamPolicy: 'aws_iam_policy',
2829
vpnGateway: 'aws_vpn_gateway',

src/enums/schemasMap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default {
3131
[services.dmsReplicationInstance]: 'awsDmsReplicationInstance',
3232
[services.dynamodb]: 'awsDynamoDbTable',
3333
[services.ebs]: 'awsEbs',
34+
[services.ebsSnapshot]: 'awsEbsSnapshot',
3435
[services.ec2Instance]: 'awsEc2',
3536
[services.ecr]: 'awsEcr',
3637
[services.ecsCluster]: 'awsEcsCluster',

src/enums/serviceAliases.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default {
1717
[services.codebuild]: 'codebuilds',
1818
[services.configurationRecorder]: 'configurationRecorders',
1919
[services.dmsReplicationInstance]: 'dmsReplicationInstances',
20+
[services.ebsSnapshot]: 'ebsSnapshots',
2021
[services.ec2Instance]: 'ec2Instances',
2122
[services.ecsCluster]: 'ecsClusters',
2223
[services.ecsContainer]: 'ecsContainers',

src/enums/serviceMap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import CognitoIdentityPool from '../services/cognitoIdentityPool'
2323
import CognitoUserPool from '../services/cognitoUserPool'
2424
import DynamoDB from '../services/dynamodb'
2525
import EBS from '../services/ebs'
26+
import EBSSnapshot from '../services/ebsSnapshot'
2627
import EC2 from '../services/ec2'
2728
import EcsCluster from '../services/ecsCluster'
2829
import EcsContainer from '../services/ecsContainer'
@@ -133,6 +134,7 @@ export default {
133134
[services.cognitoUserPool]: CognitoUserPool,
134135
[services.configurationRecorder]: ConfigurationRecorder,
135136
[services.ebs]: EBS,
137+
[services.ebsSnapshot]: EBSSnapshot,
136138
[services.ec2Instance]: EC2,
137139
[services.ecr]: ECR,
138140
[services.efs]: EFS,

src/enums/services.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default {
2525
dmsReplicationInstance: 'dmsReplicationInstance',
2626
dynamodb: 'dynamodb',
2727
ebs: 'ebs',
28+
ebsSnapshot: 'ebsSnapshot',
2829
ec2Instance: 'ec2Instance',
2930
ecr: 'ecr',
3031
ecsCluster: 'ecsCluster',

src/properties/logger.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ export default {
249249
doneFetchingEbsData: '✅ Done fetching EBS Data ✅',
250250
fetchedEbsVolumes: (num: number): string => `Fetched ${num} EBS Volumes`,
251251
lookingForEbs: 'Looking for EBS volumes for EC2 instances...',
252+
/**
253+
* EBS Snapshot
254+
*/
255+
fetchingEbsSnapshotData: 'Fetching EBS Snapshot data for this AWS account via the AWS SDK...',
256+
doneFetchingEbsSnapshotData: '✅ Done fetching EBS Snapshot Data ✅',
257+
fetchedEbsSnapshots: (num: number): string => `Fetched ${num} EBS Snapshots`,
258+
lookingForEbsSnapshot: 'Looking for EBS Snapshots...',
252259
/**
253260
* EC2
254261
*/

src/services/ebs/connections.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import isEmpty from 'lodash/isEmpty'
2+
3+
import {
4+
Volume,
5+
Snapshot,
6+
TagList,
7+
} from 'aws-sdk/clients/ec2'
8+
9+
import { ServiceConnection } from '@cloudgraph/sdk'
10+
11+
import services from '../../enums/services'
12+
13+
/**
14+
* EBS
15+
*/
16+
17+
export default ({
18+
service: volume,
19+
data,
20+
region,
21+
account,
22+
}: {
23+
account: string
24+
data: { name: string; data: { [property: string]: any[] } }[]
25+
service: Volume & {
26+
region: string
27+
Tags?: TagList
28+
}
29+
region: string
30+
}): { [key: string]: ServiceConnection[] } => {
31+
const connections: ServiceConnection[] = []
32+
33+
const {
34+
VolumeId: id,
35+
SnapshotId: snapshotId,
36+
} = volume
37+
38+
/**
39+
* Find EBS Snapshot
40+
* related to this EBS Volume
41+
*/
42+
const ebsSnapshots: {
43+
name: string
44+
data: { [property: string]: Snapshot[] }
45+
} = data.find(({ name }) => name === services.ebsSnapshot)
46+
47+
if (ebsSnapshots?.data?.[region]) {
48+
const snapshotInRegion: Snapshot[] = ebsSnapshots.data[region].filter(
49+
({ SnapshotId }: Snapshot) => SnapshotId === snapshotId
50+
)
51+
52+
if (!isEmpty(snapshotInRegion)) {
53+
for (const sh of snapshotInRegion) {
54+
connections.push({
55+
id: sh.SnapshotId,
56+
resourceType: services.ebsSnapshot,
57+
relation: 'child',
58+
field: 'ebsSnapshots',
59+
})
60+
}
61+
}
62+
}
63+
64+
const ebsResult = {
65+
[id]: connections,
66+
}
67+
return ebsResult
68+
}

0 commit comments

Comments
 (0)