Skip to content

Commit c2d1124

Browse files
authored
Merge pull request #58 from cloudgraphdev/alpha
Beta release
2 parents 55cdabd + 12b7675 commit c2d1124

File tree

12 files changed

+205
-165
lines changed

12 files changed

+205
-165
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## [0.64.3-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-azure/compare/0.64.2...0.64.3-alpha.1) (2022-12-16)
2+
3+
4+
### Bug Fixes
5+
6+
* Added missing attributes for recoveryInstances ([4d68222](https://github.com/cloudgraphdev/cloudgraph-provider-azure/commit/4d68222bf1aaf0497d14ad82e45ab53ff1c2af0e))
7+
* Fixed missing attributes and duplicated ids for virtualMachineScaleSet ([94230d1](https://github.com/cloudgraphdev/cloudgraph-provider-azure/commit/94230d14a821da1f9f0382bf4f9d550a9f552bc4))
8+
* Fixed policyAssingment duplication ([076b257](https://github.com/cloudgraphdev/cloudgraph-provider-azure/commit/076b2570231f88091bf34ea8478e5bac76fb9b95))
9+
* Solved duplication issues for backupVaults and backupPolicies ([cb9114c](https://github.com/cloudgraphdev/cloudgraph-provider-azure/commit/cb9114cef0e5e125b2f628b81bb1bffdc60bf842))
10+
* Solved recoveryPolicies id duplication ([28bd758](https://github.com/cloudgraphdev/cloudgraph-provider-azure/commit/28bd758b2d8192c17bcfb959c5222d8ef6c2db28))
11+
12+
## [0.64.2](https://github.com/cloudgraphdev/cloudgraph-provider-azure/compare/0.64.1...0.64.2) (2022-11-28)
13+
14+
15+
### Bug Fixes
16+
17+
* cve vulnerabilities remediations ([b8fc985](https://github.com/cloudgraphdev/cloudgraph-provider-azure/commit/b8fc9852612ff8944cbd493a11397029f4fb8e7b))
18+
119
## [0.64.2-beta.1](https://github.com/cloudgraphdev/cloudgraph-provider-azure/compare/0.64.1...0.64.2-beta.1) (2022-11-28)
220

321

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-azure",
3-
"version": "0.64.2-beta.1",
3+
"version": "0.64.3-alpha.1",
44
"description": "CloudGraph provider plugin for Azure used to fetch Azure cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",

src/services/backupPolicies/format.ts

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const formatTrigger = (
7575
}
7676

7777
const formatProperties = (
78+
id: string,
7879
properties?: BackupPolicy
7980
): AzureBackupPolicyProperties => {
8081
if (isEmpty(properties)) {
@@ -98,6 +99,7 @@ const formatProperties = (
9899
isDefault,
99100
}) => ({
100101
id: generateUniqueId({
102+
id,
101103
name,
102104
objectType,
103105
}),
@@ -106,15 +108,15 @@ const formatProperties = (
106108
isDefault,
107109
backupParameters: backupParameters
108110
? {
109-
backupType: backupParameters.backupType,
110-
objectType: backupParameters.objectType,
111-
}
111+
backupType: backupParameters.backupType,
112+
objectType: backupParameters.objectType,
113+
}
112114
: {},
113115
dataStore: dataStore
114116
? {
115-
dataStoreType: dataStore.dataStoreType,
116-
objectType: dataStore.objectType,
117-
}
117+
dataStoreType: dataStore.dataStoreType,
118+
objectType: dataStore.objectType,
119+
}
118120
: {},
119121
trigger: formatTrigger(trigger),
120122
lifecycles:
@@ -131,15 +133,15 @@ const formatProperties = (
131133
}),
132134
deleteAfter: deleteAfter
133135
? {
134-
duration: deleteAfter.duration,
135-
objectType: deleteAfter.objectType,
136-
}
136+
duration: deleteAfter.duration,
137+
objectType: deleteAfter.objectType,
138+
}
137139
: {},
138140
sourceDataStore: sourceDataStore
139141
? {
140-
dataStoreType: sourceDataStore.dataStoreType,
141-
objectType: sourceDataStore.objectType,
142-
}
142+
dataStoreType: sourceDataStore.dataStoreType,
143+
objectType: sourceDataStore.objectType,
144+
}
143145
: {},
144146
targetDataStoreCopySettings:
145147
targetDataStoreCopySettings?.map(
@@ -150,15 +152,15 @@ const formatProperties = (
150152
}),
151153
copyAfter: copyAfter
152154
? {
153-
duration: copyAfter.duration,
154-
objectType: copyAfter.objectType,
155-
}
155+
duration: copyAfter.duration,
156+
objectType: copyAfter.objectType,
157+
}
156158
: {},
157159
dataStore: dataStoreCopySettings
158160
? {
159-
dataStoreType: dataStoreCopySettings.dataStoreType,
160-
objectType: dataStoreCopySettings.objectType,
161-
}
161+
dataStoreType: dataStoreCopySettings.dataStoreType,
162+
objectType: dataStoreCopySettings.objectType,
163+
}
162164
: {},
163165
})
164166
) || [],
@@ -185,7 +187,7 @@ export default ({
185187
region,
186188
subscriptionId,
187189
resourceGroupId,
188-
properties: formatProperties(properties),
190+
properties: formatProperties(id, properties),
189191
...transformSystemData(systemData),
190192
}
191193
}

src/services/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ export default class Provider extends CloudGraph.Client {
151151
)}`
152152
)
153153
this.logger.success(
154-
`subscriptionIds: ${
155-
this.subscriptions.length > 1
156-
? this.subscriptions.join(', ')
157-
: this.subscriptions[0]
154+
`subscriptionIds: ${this.subscriptions.length > 1
155+
? this.subscriptions.join(', ')
156+
: this.subscriptions[0]
158157
}`
159158
)
160159
this.logger.success(
@@ -340,7 +339,7 @@ export default class Provider extends CloudGraph.Client {
340339
* getSchema is used to get the schema for provider
341340
* @returns A string of graphql sub schemas
342341
*/
343-
getSchema(): any {
342+
getSchema(): any {
344343
const typesArray = loadFilesSync(path.join(__dirname), {
345344
recursive: true,
346345
extensions: ['graphql'],

src/services/policyAssignment/data.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { AzureServiceInput } from '../../types'
88
import { tryCatchWrapper } from '../../utils'
99
import { lowerCaseLocation } from '../../utils/format'
1010
import { getResourceGroupFromEntity } from '../../utils/idParserUtils'
11-
import { regionMap } from '../../enums/regions'
1211

1312
const { logger } = CloudGraph
1413
const lt = { ...azureLoggerText }

src/services/policyAssignment/format.ts

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,39 @@ export default ({
3535
metadata,
3636
} = service
3737

38+
const getParameterValue = (value) => {
39+
// Set parameter value
40+
let parameterValue = JSON.stringify(value)
41+
if (isString(value)) parameterValue = value
42+
if (isArray(value)) {
43+
parameterValue = (value as Array<any>)
44+
.map(i => (isString(i) && i) || JSON.stringify(i))
45+
.join(',')
46+
}
47+
return parameterValue
48+
}
49+
3850
const parameters: AzurePolicyAssignmentParameters[] =
39-
Object.entries(params).map(([k, v]) => ({
40-
id: generateUniqueId({
41-
value: v
42-
}),
43-
key: k,
44-
value: Object.entries(v.value).map(([k2, v2]) => ({
45-
id: isObject(v) ? generateUniqueId({
46-
...v,
47-
}) : `${k2}:${v2}`,
51+
Object.entries(params).map(([k, v]) => {
52+
53+
return ({
54+
id: generateUniqueId({
55+
key: k,
56+
value: v
57+
}),
4858
key: k,
49-
value:
50-
(isString(v2) && v2) ||
51-
(isArray(v2) &&
52-
(v2 as Array<any>)
53-
.map(i => (isString(i) && i) || JSON.stringify(i))
54-
.join(',')) ||
55-
JSON.stringify(v2), // not sure about this one
56-
})),
57-
})) || []
59+
value: Object.entries(v.value).map(([k2, v2]) => ({
60+
id: isObject(v) ? generateUniqueId({
61+
id,
62+
...v,
63+
}) : `${k2}:${v2}`,
64+
key: k,
65+
value: getParameterValue(v.value)
66+
})
67+
),
68+
})
69+
}
70+
) || []
5871

5972
return {
6073
id,

src/services/recoveryInstances/format.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export interface RawAzureProtectedItem extends ProtectedItem {
5050
fabricName?: string
5151
computerName?: string
5252
deferredDeleteSyncTimeInUTC?: number
53+
softDeleteRetentionPeriod?: number
54+
ConfiguredRPGenerationFrequency?: string
55+
vaultId?: string
5356
}
5457

5558
const formatProperties = (
@@ -66,6 +69,7 @@ const formatProperties = (
6669
kpisHealths = {},
6770
healthDetails = [],
6871
sourceAssociations = [],
72+
ConfiguredRPGenerationFrequency,
6973
...rest
7074
} = properties
7175
const {
@@ -116,6 +120,7 @@ const formatProperties = (
116120
key,
117121
value: sourceAssociations[key],
118122
})),
123+
configuredRPGenerationFrequency: ConfiguredRPGenerationFrequency,
119124
...rest,
120125
}
121126
}

src/services/recoveryInstances/schema.graphql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ type azureRecoveryInstanceProperties
140140
fabricName: String @search(by: [hash, regexp])
141141
computerName: String @search(by: [hash, regexp])
142142
deferredDeleteSyncTimeInUTC: Int @search
143+
softDeleteRetentionPeriod: Int @search
144+
configuredRPGenerationFrequency: String @search(by: [hash, regexp])
145+
vaultId: String @search(by: [hash, regexp])
143146
}
144147

145148
type azureRecoveryInstance implements azureBaseResource

src/services/recoveryPolicies/format.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,24 @@ const formatProperties = (
194194
return {
195195
subProtectionPolicy:
196196
subProtectionPolicy?.map(
197-
({
198-
schedulePolicy: subSchedulePolicy,
199-
retentionPolicy: subRetentionPolicy,
200-
...p
201-
}) => ({
202-
id: generateUniqueId({
203-
...subProtectionPolicy,
204-
}),
205-
schedulePolicy: formatSchedulePolicy(subSchedulePolicy),
206-
retentionPolicy: formatRetentionPolicy(subRetentionPolicy),
207-
...p,
197+
(protectionPolicy
198+
) => {
199+
const {
200+
schedulePolicy: subSchedulePolicy,
201+
retentionPolicy: subRetentionPolicy,
202+
...p
203+
} = protectionPolicy
204+
205+
return {
206+
id: generateUniqueId({
207+
...protectionPolicy,
208+
}),
209+
schedulePolicy: formatSchedulePolicy(subSchedulePolicy),
210+
retentionPolicy: formatRetentionPolicy(subRetentionPolicy),
211+
...p,
212+
}
208213
})
209-
) || [],
214+
|| [],
210215
schedulePolicy: formatSchedulePolicy(schedulePolicy),
211216
retentionPolicy: formatRetentionPolicy(retentionPolicy),
212217
...rest,

0 commit comments

Comments
 (0)