Skip to content

Commit 46f9e28

Browse files
Support migration by always checking OrganizationalUnitIDs first
1 parent ca4ce17 commit 46f9e28

File tree

4 files changed

+141
-56
lines changed

4 files changed

+141
-56
lines changed

modules/foundational.cft.yaml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Metadata:
2626
IsOrganizational:
2727
default: Is Organizational
2828
OrganizationalUnitIDs:
29-
default: (Deprecated, use RootOUID or IncludeOUIDs instead) Organizational Unit IDs
29+
default: (TO BE DEPRECATED Please work with Sysdig to migrate and use IncludeOUIDs) Organizational Unit IDs
3030
Partition:
3131
default: AWS Partition
3232
RootOUID:
@@ -37,8 +37,6 @@ Metadata:
3737
default: Include AWS accounts
3838
ExcludeAccounts:
3939
default: Exclude AWS accounts
40-
UnusedParams: # cfn-lint ignore till we figure final solution
41-
OrganizationalUnitIDs: !Ref OrganizationalUnitIDs
4240
Parameters:
4341
NameSuffix:
4442
Type: String
@@ -61,7 +59,7 @@ Parameters:
6159
- 'false'
6260
OrganizationalUnitIDs:
6361
Type: CommaDelimitedList
64-
Description: (Deprecated, use RootOUID or IncludeOUIDs instead) Comma separated list of organizational unit IDs to deploy
62+
Description: (WARNING - TO BE DEPRECATED Please work with Sysdig to migrate your installs to use IncludeOUIDs instead) Comma separated list of organizational unit IDs to deploy
6563
Partition:
6664
Type: String
6765
Description: AWS Partition of your account or organization to create resources in
@@ -83,6 +81,17 @@ Conditions:
8381
Fn::Equals:
8482
- Ref: IsOrganizational
8583
- 'true'
84+
# First check if old param OrganizationalUnitIDs configured - support till we DEPRECATE it
85+
IsOldOuidConfigured:
86+
!And
87+
- !Condition IsOrganizational
88+
- !Not
89+
- !Equals
90+
- !Join ["", !Ref OrganizationalUnitIDs]
91+
- ''
92+
93+
# Else, check for new Inclusion and Exclusion params
94+
# INCLUSIONS
8695
OUInclusionsConfigured:
8796
!And
8897
- !Condition IsOrganizational
@@ -110,6 +119,7 @@ Conditions:
110119
- !Not
111120
- !Condition AccountInclusionsConfigured
112121

122+
# EXCLUSIONS
113123
# cannot do OU exclusions from ExcludeOUIDs since CFT templates are static and don't have a way to fetch dynamic data from AWS
114124
AccountExclusionsConfigured:
115125
!And
@@ -232,19 +242,28 @@ Resources:
232242
- DeploymentTargets:
233243
OrganizationalUnitIds:
234244
Fn::If:
235-
- AllowedInclusions
236-
- !Ref IncludeOUIDs
237-
- !Ref RootOUID
245+
- IsOldOuidConfigured
246+
- !Ref OrganizationalUnitIDs
247+
- Fn::If:
248+
- AllowedInclusions
249+
- !Ref IncludeOUIDs
250+
- !Ref RootOUID
238251
AccountFilterType:
239252
Fn::If:
240-
- AccountExclusionsConfigured
241-
- "DIFFERENCE"
242-
- "NONE"
253+
- IsOldOuidConfigured
254+
- !Ref 'AWS::NoValue'
255+
- Fn::If:
256+
- AccountExclusionsConfigured
257+
- "DIFFERENCE"
258+
- "NONE"
243259
Accounts:
244260
Fn::If:
245-
- AccountExclusionsConfigured
246-
- !Ref ExcludeAccounts
261+
- IsOldOuidConfigured
247262
- !Ref 'AWS::NoValue'
263+
- Fn::If:
264+
- AccountExclusionsConfigured
265+
- !Ref ExcludeAccounts
266+
- !Ref 'AWS::NoValue'
248267
Regions:
249268
- Ref: AWS::Region
250269
TemplateBody: |

modules/log_ingestion.events.cft.yaml

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Metadata:
4141
IsOrganizational:
4242
default: Is Organizational
4343
OrganizationalUnitIDs:
44-
default: (Deprecated, use RootOUID or IncludeOUIDs instead) Organizational Unit IDs
44+
default: (TO BE DEPRECATED Please work with Sysdig to migrate and use IncludeOUIDs) Organizational Unit IDs
4545
Partition:
4646
default: AWS Partition
4747
RootOUID:
@@ -52,8 +52,6 @@ Metadata:
5252
default: Include AWS accounts
5353
ExcludeAccounts:
5454
default: Exclude AWS accounts
55-
UnusedParams: # cfn-lint ignore till we figure final solution
56-
OrganizationalUnitIDs: !Ref OrganizationalUnitIDs
5755
Parameters:
5856
NameSuffix:
5957
Type: String
@@ -75,7 +73,7 @@ Parameters:
7573
Description: Comma separated list of regions to monitor with EventBridge
7674
OrganizationalUnitIDs:
7775
Type: CommaDelimitedList
78-
Description: (Deprecated, use RootOUID or IncludeOUIDs instead) Comma separated list of organizational unit IDs to deploy
76+
Description: (WARNING - TO BE DEPRECATED Please work with Sysdig to migrate your installs to use IncludeOUIDs instead) Comma separated list of organizational unit IDs to deploy
7977
RuleState:
8078
Type: String
8179
Description: The state of the EventBridge Rule
@@ -134,6 +132,17 @@ Conditions:
134132
Fn::Equals:
135133
- Ref: IsOrganizational
136134
- 'true'
135+
# First check if old param OrganizationalUnitIDs configured - support till we DEPRECATE it
136+
IsOldOuidConfigured:
137+
!And
138+
- !Condition IsOrganizational
139+
- !Not
140+
- !Equals
141+
- !Join ["", !Ref OrganizationalUnitIDs]
142+
- ''
143+
144+
# Else, check for new Inclusion and Exclusion params
145+
# INCLUSIONS
137146
OUInclusionsConfigured:
138147
!And
139148
- !Condition IsOrganizational
@@ -161,6 +170,7 @@ Conditions:
161170
- !Not
162171
- !Condition AccountInclusionsConfigured
163172

173+
# EXCLUSIONS
164174
# cannot do OU exclusions from ExcludeOUIDs since CFT templates are static and don't have a way to fetch dynamic data from AWS
165175
AccountExclusionsConfigured:
166176
!And
@@ -354,19 +364,28 @@ Resources:
354364
- DeploymentTargets:
355365
OrganizationalUnitIds:
356366
Fn::If:
357-
- AllowedInclusions
358-
- !Ref IncludeOUIDs
359-
- !Ref RootOUID
367+
- IsOldOuidConfigured
368+
- !Ref OrganizationalUnitIDs
369+
- Fn::If:
370+
- AllowedInclusions
371+
- !Ref IncludeOUIDs
372+
- !Ref RootOUID
360373
AccountFilterType:
361374
Fn::If:
362-
- AccountExclusionsConfigured
363-
- "DIFFERENCE"
364-
- "NONE"
375+
- IsOldOuidConfigured
376+
- !Ref 'AWS::NoValue'
377+
- Fn::If:
378+
- AccountExclusionsConfigured
379+
- "DIFFERENCE"
380+
- "NONE"
365381
Accounts:
366382
Fn::If:
367-
- AccountExclusionsConfigured
368-
- !Ref ExcludeAccounts
383+
- IsOldOuidConfigured
369384
- !Ref 'AWS::NoValue'
385+
- Fn::If:
386+
- AccountExclusionsConfigured
387+
- !Ref ExcludeAccounts
388+
- !Ref 'AWS::NoValue'
370389
Regions: [!Ref "AWS::Region"]
371390
TemplateBody: |
372391
AWSTemplateFormatVersion: "2010-09-09"
@@ -456,19 +475,28 @@ Resources:
456475
- DeploymentTargets:
457476
OrganizationalUnitIds:
458477
Fn::If:
459-
- AllowedInclusions
460-
- !Ref IncludeOUIDs
461-
- !Ref RootOUID
478+
- IsOldOuidConfigured
479+
- !Ref OrganizationalUnitIDs
480+
- Fn::If:
481+
- AllowedInclusions
482+
- !Ref IncludeOUIDs
483+
- !Ref RootOUID
462484
AccountFilterType:
463485
Fn::If:
464-
- AccountExclusionsConfigured
465-
- "DIFFERENCE"
466-
- "NONE"
486+
- IsOldOuidConfigured
487+
- !Ref 'AWS::NoValue'
488+
- Fn::If:
489+
- AccountExclusionsConfigured
490+
- "DIFFERENCE"
491+
- "NONE"
467492
Accounts:
468493
Fn::If:
469-
- AccountExclusionsConfigured
470-
- !Ref ExcludeAccounts
494+
- IsOldOuidConfigured
471495
- !Ref 'AWS::NoValue'
496+
- Fn::If:
497+
- AccountExclusionsConfigured
498+
- !Ref ExcludeAccounts
499+
- !Ref 'AWS::NoValue'
472500
Regions: !Ref Regions
473501
TemplateBody: |
474502
AWSTemplateFormatVersion: "2010-09-09"

modules/vm_workload_scanning.cft.yaml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Metadata:
2828
IsOrganizational:
2929
default: Is Organizational Deployment?
3030
OrganizationalUnitIDs:
31-
default: (Deprecated, use RootOUID or IncludeOUIDs instead) Organizational Unit IDs
31+
default: (TO BE DEPRECATED Please work with Sysdig to migrate and use IncludeOUIDs) Organizational Unit IDs
3232
RootOUID:
3333
default: Root Organization Unit ID
3434
IncludeOUIDs:
@@ -37,8 +37,6 @@ Metadata:
3737
default: Include AWS accounts
3838
ExcludeAccounts:
3939
default: Exclude AWS accounts
40-
UnusedParams: # cfn-lint ignore till we figure final solution
41-
OrganizationalUnitIDs: !Ref OrganizationalUnitIDs
4240
Parameters:
4341
NameSuffix:
4442
Type: String
@@ -68,7 +66,7 @@ Parameters:
6866
- 'false'
6967
OrganizationalUnitIDs:
7068
Type: CommaDelimitedList
71-
Description: (Deprecated, use RootOUID or IncludeOUIDs instead) Comma-separated list of organizational unit IDs to deploy (required for organizational deployments)
69+
Description: (WARNING - TO BE DEPRECATED Please work with Sysdig to migrate your installs to use IncludeOUIDs instead) Comma-separated list of organizational unit IDs to deploy (required for organizational deployments)
7270
RootOUID:
7371
Type: CommaDelimitedList
7472
Description: Root Organizational Unit ID of your AWS organization
@@ -91,6 +89,17 @@ Conditions:
9189
Fn::Equals:
9290
- Ref: LambdaScanningEnabled
9391
- 'true'
92+
# First check if old param OrganizationalUnitIDs configured - support till we DEPRECATE it
93+
IsOldOuidConfigured:
94+
!And
95+
- !Condition IsOrganizational
96+
- !Not
97+
- !Equals
98+
- !Join ["", !Ref OrganizationalUnitIDs]
99+
- ''
100+
101+
# Else, check for new Inclusion and Exclusion params
102+
# INCLUSIONS
94103
OUInclusionsConfigured:
95104
!And
96105
- !Condition IsOrganizational
@@ -118,6 +127,7 @@ Conditions:
118127
- !Not
119128
- !Condition AccountInclusionsConfigured
120129

130+
# EXCLUSIONS
121131
# cannot do OU exclusions from ExcludeOUIDs since CFT templates are static and don't have a way to fetch dynamic data from AWS
122132
AccountExclusionsConfigured:
123133
!And
@@ -223,19 +233,28 @@ Resources:
223233
- DeploymentTargets:
224234
OrganizationalUnitIds:
225235
Fn::If:
226-
- AllowedInclusions
227-
- !Ref IncludeOUIDs
228-
- !Ref RootOUID
236+
- IsOldOuidConfigured
237+
- !Ref OrganizationalUnitIDs
238+
- Fn::If:
239+
- AllowedInclusions
240+
- !Ref IncludeOUIDs
241+
- !Ref RootOUID
229242
AccountFilterType:
230243
Fn::If:
231-
- AccountExclusionsConfigured
232-
- "DIFFERENCE"
233-
- "NONE"
244+
- IsOldOuidConfigured
245+
- !Ref 'AWS::NoValue'
246+
- Fn::If:
247+
- AccountExclusionsConfigured
248+
- "DIFFERENCE"
249+
- "NONE"
234250
Accounts:
235251
Fn::If:
236-
- AccountExclusionsConfigured
237-
- !Ref ExcludeAccounts
252+
- IsOldOuidConfigured
238253
- !Ref 'AWS::NoValue'
254+
- Fn::If:
255+
- AccountExclusionsConfigured
256+
- !Ref ExcludeAccounts
257+
- !Ref 'AWS::NoValue'
239258
Regions:
240259
- Ref: AWS::Region
241260
TemplateBody: |

modules/volume_access.cft.yaml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Metadata:
3131
IsOrganizational:
3232
default: Is Organizational
3333
OrganizationalUnitIDs:
34-
default: "(Deprecated, use RootOUID or IncludeOUIDs instead) Organizational Unit IDs"
34+
default: "(TO BE DEPRECATED Please work with Sysdig to migrate and use IncludeOUIDs) Organizational Unit IDs"
3535
RootOUID:
3636
default: Root Organization Unit ID
3737
IncludeOUIDs:
@@ -40,8 +40,6 @@ Metadata:
4040
default: Include AWS accounts
4141
ExcludeAccounts:
4242
default: Exclude AWS accounts
43-
UnusedParams: # cfn-lint ignore till we figure final solution
44-
OrganizationalUnitIDs: !Ref OrganizationalUnitIDs
4543

4644
Parameters:
4745
NameSuffix:
@@ -72,7 +70,7 @@ Parameters:
7270
- 'false'
7371
OrganizationalUnitIDs:
7472
Type: CommaDelimitedList
75-
Description: (Deprecated, use RootOUID or IncludeOUIDs instead) Comma separated list of organizational unit IDs to deploy
73+
Description: (WARNING - TO BE DEPRECATED Please work with Sysdig to migrate your installs to use IncludeOUIDs instead) Comma separated list of organizational unit IDs to deploy
7674
RootOUID:
7775
Type: CommaDelimitedList
7876
Description: Root Organizational Unit ID of your AWS organization
@@ -91,6 +89,17 @@ Conditions:
9189
Fn::Equals:
9290
- Ref: IsOrganizational
9391
- 'true'
92+
# First check if old param OrganizationalUnitIDs configured - support till we DEPRECATE it
93+
IsOldOuidConfigured:
94+
!And
95+
- !Condition IsOrganizational
96+
- !Not
97+
- !Equals
98+
- !Join ["", !Ref OrganizationalUnitIDs]
99+
- ''
100+
101+
# Else, check for new Inclusion and Exclusion params
102+
# INCLUSIONS
94103
OUInclusionsConfigured:
95104
!And
96105
- !Condition IsOrganizational
@@ -118,6 +127,7 @@ Conditions:
118127
- !Not
119128
- !Condition AccountInclusionsConfigured
120129

130+
# EXCLUSIONS
121131
# cannot do OU exclusions from ExcludeOUIDs since CFT templates are static and don't have a way to fetch dynamic data from AWS
122132
AccountExclusionsConfigured:
123133
!And
@@ -390,19 +400,28 @@ Resources:
390400
- DeploymentTargets:
391401
OrganizationalUnitIds:
392402
Fn::If:
393-
- AllowedInclusions
394-
- !Ref IncludeOUIDs
395-
- !Ref RootOUID
403+
- IsOldOuidConfigured
404+
- !Ref OrganizationalUnitIDs
405+
- Fn::If:
406+
- AllowedInclusions
407+
- !Ref IncludeOUIDs
408+
- !Ref RootOUID
396409
AccountFilterType:
397410
Fn::If:
398-
- AccountExclusionsConfigured
399-
- "DIFFERENCE"
400-
- "NONE"
411+
- IsOldOuidConfigured
412+
- !Ref 'AWS::NoValue'
413+
- Fn::If:
414+
- AccountExclusionsConfigured
415+
- "DIFFERENCE"
416+
- "NONE"
401417
Accounts:
402418
Fn::If:
403-
- AccountExclusionsConfigured
404-
- !Ref ExcludeAccounts
419+
- IsOldOuidConfigured
405420
- !Ref 'AWS::NoValue'
421+
- Fn::If:
422+
- AccountExclusionsConfigured
423+
- !Ref ExcludeAccounts
424+
- !Ref 'AWS::NoValue'
406425
Regions: !Ref Regions
407426
TemplateBody: |
408427
AWSTemplateFormatVersion: "2010-09-09"

0 commit comments

Comments
 (0)