Skip to content

Commit a950224

Browse files
authored
Merge pull request #63 from cloudgraphdev/fix/add-acl-grants-to-s3-service
fix: Added ACL Grants needed for aws cis 1.3.0-3.3 rule
2 parents fc5d719 + 88dd8ce commit a950224

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

src/services/s3/format.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ export default ({
243243
: `${total}`,
244244
transferAcceleration: accelerationStatus,
245245
notificationConfiguration: notificationConfigurationData,
246+
aclGrants: grants?.map(g => ({
247+
id: cuid(),
248+
granteeType: g.Grantee?.Type,
249+
granteeUri: g.Grantee?.URI,
250+
permission: g.Permission,
251+
})) || [],
246252
}
247253
return s3
248254
}

src/services/s3/schema.graphql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ type awsS3NotificationConfiguration
5353
lambdaFunctionConfigurations: [awsS3LambdaFunctionConfiguration]
5454
}
5555

56+
type awsS3AclGrant
57+
@generate(
58+
query: { get: false, query: true, aggregate: false }
59+
mutation: { add: false, delete: false }
60+
subscription: false
61+
) {
62+
id: String! @id
63+
granteeType: String @search(by: [hash])
64+
granteeUri: String @search(by: [hash])
65+
permission: String @search(by: [hash])
66+
}
67+
5668
type awsS3 implements awsBaseService @key(fields: "arn") {
5769
access: String @search(by: [hash, regexp])
5870
bucketOwnerName: String @search(by: [hash, regexp])
@@ -75,6 +87,7 @@ type awsS3 implements awsBaseService @key(fields: "arn") {
7587
notificationConfiguration: awsS3NotificationConfiguration
7688
policy: awsIamJSONPolicy
7789
rawPolicy: String @search(by: [hash, regexp])
90+
aclGrants: [awsS3AclGrant]
7891
kinesisFirehose: [awsKinesisFirehose] @hasInverse(field: s3)
7992
tags: [awsRawTag]
8093
cloudfrontDistributions: [awsCloudfront] @hasInverse(field: s3)

src/types/generated.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3773,6 +3773,7 @@ export type AwsRouteTable = AwsBaseService & {
37733773

37743774
export type AwsS3 = AwsBaseService & {
37753775
access?: Maybe<Scalars['String']>;
3776+
aclGrants?: Maybe<Array<Maybe<AwsS3AclGrant>>>;
37763777
blockPublicAcls?: Maybe<Scalars['String']>;
37773778
blockPublicPolicy?: Maybe<Scalars['String']>;
37783779
bucketOwnerName?: Maybe<Scalars['String']>;
@@ -3805,6 +3806,13 @@ export type AwsS3 = AwsBaseService & {
38053806
versioning?: Maybe<Scalars['String']>;
38063807
};
38073808

3809+
export type AwsS3AclGrant = {
3810+
granteeType?: Maybe<Scalars['String']>;
3811+
granteeUri?: Maybe<Scalars['String']>;
3812+
id: Scalars['String'];
3813+
permission?: Maybe<Scalars['String']>;
3814+
};
3815+
38083816
export type AwsS3ConfigurationBase = {
38093817
events?: Maybe<Array<Maybe<Scalars['String']>>>;
38103818
filterRules?: Maybe<Array<Maybe<AwsS3FilterRule>>>;

0 commit comments

Comments
 (0)