Skip to content

Commit 496c043

Browse files
committed
Merge branch 'fix/add-missing-properties-for-nist-rules' into 'master'
fix: Added missing properties needed for nist rules See merge request auto-cloud/cloudgraph/provider/cloudgraph-provider-aws!229
2 parents 7aa2d09 + 0536584 commit 496c043

5 files changed

Lines changed: 49 additions & 1 deletion

File tree

src/services/cloudfront/format.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
AwsCloudfrontCustomErrorResponse,
1515
AwsCloudfrontOriginData,
1616
AwsCloudfrontViewerCertificate,
17+
AwsCloudfrontLoggingConfig,
1718
} from '../../types/generated'
1819
import { RawAwsCloudfront } from './data'
1920

@@ -120,6 +121,7 @@ export default ({
120121
Restrictions: { GeoRestriction: { Items: geoRestrictions = [] } } = {
121122
GeoRestriction: { RestrictionType: '', Items: [], Quantity: 0 },
122123
},
124+
Logging: logging,
123125
},
124126
etag,
125127
summary: {
@@ -212,6 +214,15 @@ export default ({
212214
})
213215
)
214216

217+
const loggingConfig: AwsCloudfrontLoggingConfig = logging
218+
? {
219+
enabled: logging.Enabled,
220+
includeCookies: logging.IncludeCookies,
221+
bucket: logging.Bucket,
222+
prefix: logging.Prefix,
223+
}
224+
: {}
225+
215226
return {
216227
id,
217228
accountId: account,
@@ -238,5 +249,6 @@ export default ({
238249
tags: formatTagsFromMap(Tags),
239250
viewerCertificate,
240251
webAclId,
252+
logging: loggingConfig,
241253
}
242254
}

src/services/cloudfront/schema.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type awsCloudfront @key(fields: "id") {
1919
orderedCacheBehaviors: [awsCloudfrontCacheBehavior]
2020
viewerCertificate: awsCloudfrontViewerCertificate
2121
origins: [awsCloudfrontOriginData]
22+
logging: awsCloudfrontLoggingConfig
2223
elb: [awsElb] @hasInverse(field: cloudfrontDistribution)
2324
s3: [awsS3] @hasInverse(field: cloudfrontDistribution)
2425
tags: [awsRawTag]
@@ -89,3 +90,10 @@ type awsCloudfrontCustomErrorResponse {
8990
responseCode: String @search(by: [hash, regexp])
9091
responsePagePath: String @search(by: [hash, regexp])
9192
}
93+
94+
type awsCloudfrontLoggingConfig {
95+
enabled: Boolean @search
96+
includeCookies: Boolean @search
97+
bucket: String @search(by: [hash, regexp])
98+
prefix: String @search(by: [hash, regexp])
99+
}

src/services/cloudtrail/format.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ export default ({
5050
let eventSelectors = []
5151
if (!isEmpty(EventSelectors)) {
5252
eventSelectors = EventSelectors.map(
53-
({ ReadWriteType, IncludeManagementEvents }) => ({
53+
({ ReadWriteType, IncludeManagementEvents, DataResources }) => ({
5454
id: cuid(),
5555
readWriteType: ReadWriteType,
5656
includeManagementEvents: IncludeManagementEvents,
57+
dataResources: DataResources?.map(({ Type, Values }) => ({id: cuid(), type: Type, values : Values})) || [],
5758
})
5859
)
5960
}

src/services/cloudtrail/schema.graphql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,16 @@ type awsCloudtrailEventSelector
5151
id: String! @id @search(by: [hash])
5252
readWriteType: String @search(by: [hash, regexp])
5353
includeManagementEvents: Boolean @search
54+
dataResources: [awsCloudtrailDataResource]
55+
}
56+
57+
type awsCloudtrailDataResource
58+
@generate(
59+
query: { get: false, query: true, aggregate: false }
60+
mutation: { add: false, delete: false }
61+
subscription: false
62+
) {
63+
id: String! @id @search(by: [hash])
64+
type: String @search(by: [hash, regexp])
65+
values: [String] @search(by: [hash, regexp])
5466
}

src/types/generated.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ export type AwsCloudfront = {
785785
id: Scalars['String'];
786786
ipv6Enabled?: Maybe<Scalars['String']>;
787787
lastModified?: Maybe<Scalars['String']>;
788+
logging?: Maybe<AwsCloudfrontLoggingConfig>;
788789
orderedCacheBehaviors?: Maybe<Array<Maybe<AwsCloudfrontCacheBehavior>>>;
789790
origins?: Maybe<Array<Maybe<AwsCloudfrontOriginData>>>;
790791
priceClass?: Maybe<Scalars['String']>;
@@ -828,6 +829,13 @@ export type AwsCloudfrontCustomOriginConfig = {
828829
originSslProtocols?: Maybe<AwsCloudfrontOriginSslProtocols>;
829830
};
830831

832+
export type AwsCloudfrontLoggingConfig = {
833+
bucket?: Maybe<Scalars['String']>;
834+
enabled?: Maybe<Scalars['Boolean']>;
835+
includeCookies?: Maybe<Scalars['Boolean']>;
836+
prefix?: Maybe<Scalars['String']>;
837+
};
838+
831839
export type AwsCloudfrontOriginCustomHeader = {
832840
id: Scalars['String'];
833841
name?: Maybe<Scalars['String']>;
@@ -890,7 +898,14 @@ export type AwsCloudtrail = {
890898
tags?: Maybe<Array<Maybe<AwsRawTag>>>;
891899
};
892900

901+
export type AwsCloudtrailDataResource = {
902+
id: Scalars['String'];
903+
type?: Maybe<Scalars['String']>;
904+
values?: Maybe<Array<Maybe<Scalars['String']>>>;
905+
};
906+
893907
export type AwsCloudtrailEventSelector = {
908+
dataResources?: Maybe<Array<Maybe<AwsCloudtrailDataResource>>>;
894909
id: Scalars['String'];
895910
includeManagementEvents?: Maybe<Scalars['Boolean']>;
896911
readWriteType?: Maybe<Scalars['String']>;

0 commit comments

Comments
 (0)