@@ -178,26 +178,26 @@ func TestResourceAquasecComplexContainerRuntimePolicyCreate(t *testing.T) {
178178func TestResourceAquasecFullContainerRuntimePolicyCreate (t * testing.T ) {
179179 t .Parallel ()
180180 var fullRuntimePolicy = client.RuntimePolicy {
181- Name : acctest .RandomWithPrefix ("test-full-container-runtime-policy" ),
182- Description : "This is a test description of full container runtime policy" ,
183- RuntimeType : "container" ,
184- RuntimeMode : 0 ,
185- Enabled : true ,
186- Enforce : false ,
187- EnforceAfterDays : 0 ,
188- IsAutoGenerated : false ,
189- IsOOTBPolicy : false ,
190- BlockFilelessExec : true ,
181+ Name : acctest .RandomWithPrefix ("test-full-container-runtime-policy" ),
182+ Description : "This is a test description of full container runtime policy" ,
183+ RuntimeType : "container" ,
184+ RuntimeMode : 0 ,
185+ Enabled : true ,
186+ Enforce : false ,
187+ EnforceAfterDays : 0 ,
188+ IsAutoGenerated : false ,
189+ IsOOTBPolicy : false ,
190+ BlockFilelessExec : true ,
191191 BlockNonCompliantWorkloads : true ,
192- BlockNonK8sContainers : true ,
193- EnableForkGuard : true ,
194- ForkGuardProcessLimit : 0 ,
195- EnableIPReputation : true ,
196- EnableCryptoMiningDns : true ,
197- EnablePortScanProtection : true ,
198- OnlyRegisteredImages : true ,
199- BlockDisallowedImages : true ,
200- NoNewPrivileges : false ,
192+ BlockNonK8sContainers : true ,
193+ EnableForkGuard : true ,
194+ ForkGuardProcessLimit : 0 ,
195+ EnableIPReputation : true ,
196+ EnableCryptoMiningDns : true ,
197+ EnablePortScanProtection : true ,
198+ OnlyRegisteredImages : true ,
199+ BlockDisallowedImages : true ,
200+ NoNewPrivileges : false ,
201201 }
202202
203203 rootRef := containerRuntimePolicyRef ("full" )
@@ -221,19 +221,19 @@ func TestResourceAquasecFullContainerRuntimePolicyCreate(t *testing.T) {
221221 resource .TestCheckResourceAttr (rootRef , "enforce" , fmt .Sprintf ("%v" , fullRuntimePolicy .Enforce )),
222222 resource .TestCheckResourceAttr (rootRef , "enforce_after_days" , fmt .Sprintf ("%v" , fullRuntimePolicy .EnforceAfterDays )),
223223 resource .TestCheckResourceAttr (rootRef , "is_ootb_policy" , fmt .Sprintf ("%v" , fullRuntimePolicy .IsOOTBPolicy )),
224-
224+
225225 // Container Exec
226226 resource .TestCheckResourceAttr (rootRef , "container_exec.0.enabled" , "true" ),
227227 resource .TestCheckResourceAttr (rootRef , "container_exec.0.block_container_exec" , "true" ),
228228 resource .TestCheckResourceAttr (rootRef , "container_exec.0.container_exec_proc_white_list.#" , "3" ),
229229 resource .TestCheckResourceAttr (rootRef , "container_exec.0.reverse_shell_ip_white_list.#" , "0" ),
230-
230+
231231 // Reverse Shell
232232 resource .TestCheckResourceAttr (rootRef , "reverse_shell.0.enabled" , "true" ),
233233 resource .TestCheckResourceAttr (rootRef , "reverse_shell.0.block_reverse_shell" , "true" ),
234234 resource .TestCheckResourceAttr (rootRef , "reverse_shell.0.reverse_shell_ip_white_list.#" , "0" ),
235235 resource .TestCheckResourceAttr (rootRef , "reverse_shell.0.reverse_shell_proc_white_list.#" , "0" ),
236-
236+
237237 // Block settings
238238 resource .TestCheckResourceAttr (rootRef , "block_fileless_exec" , "true" ),
239239 resource .TestCheckResourceAttr (rootRef , "block_non_compliant_workloads" , "true" ),
@@ -244,30 +244,30 @@ func TestResourceAquasecFullContainerRuntimePolicyCreate(t *testing.T) {
244244 resource .TestCheckResourceAttr (rootRef , "blocked_packages.#" , "2" ),
245245 resource .TestCheckResourceAttr (rootRef , "blocked_packages.0" , "netcat" ),
246246 resource .TestCheckResourceAttr (rootRef , "blocked_packages.1" , "telnet" ),
247-
247+
248248 // Executable Blacklist
249249 resource .TestCheckResourceAttr (rootRef , "executable_blacklist.0.enabled" , "true" ),
250250 resource .TestCheckResourceAttr (rootRef , "executable_blacklist.0.executables.#" , "0" ),
251-
251+
252252 // Allowed Executables
253253 resource .TestCheckResourceAttr (rootRef , "allowed_executables.0.enabled" , "true" ),
254254 resource .TestCheckResourceAttr (rootRef , "allowed_executables.0.allow_executables.#" , "2" ),
255255 resource .TestCheckResourceAttr (rootRef , "allowed_executables.0.allow_root_executables.#" , "2" ),
256-
256+
257257 // Allowed Registries
258258 resource .TestCheckResourceAttr (rootRef , "allowed_registries.0.allowed_registries.#" , "1" ),
259259 resource .TestCheckResourceAttr (rootRef , "allowed_registries.0.allowed_registries.0" , "Docker Hub" ),
260260 resource .TestCheckResourceAttr (rootRef , "allowed_registries.0.enabled" , "true" ),
261-
261+
262262 // Drift Prevention
263263 resource .TestCheckResourceAttr (rootRef , "drift_prevention.0.enabled" , "true" ),
264264 resource .TestCheckResourceAttr (rootRef , "drift_prevention.0.exec_lockdown" , "true" ),
265265 resource .TestCheckResourceAttr (rootRef , "drift_prevention.0.image_lockdown" , "false" ),
266266 resource .TestCheckResourceAttr (rootRef , "drift_prevention.0.exec_lockdown_white_list.#" , "2" ),
267-
267+
268268 // Limit Container Privileges
269269 resource .TestCheckResourceAttr (rootRef , "limit_container_privileges.0.enabled" , "true" ),
270-
270+
271271 // File Block
272272 resource .TestCheckResourceAttr (rootRef , "file_block.0.enabled" , "true" ),
273273 resource .TestCheckResourceAttr (rootRef , "file_block.0.filename_block_list.#" , "2" ),
@@ -276,7 +276,7 @@ func TestResourceAquasecFullContainerRuntimePolicyCreate(t *testing.T) {
276276 resource .TestCheckResourceAttr (rootRef , "file_block.0.block_files_processes.#" , "2" ),
277277 resource .TestCheckResourceAttr (rootRef , "file_block.0.exceptional_block_files_users.#" , "1" ),
278278 resource .TestCheckResourceAttr (rootRef , "file_block.0.exceptional_block_files_processes.#" , "1" ),
279-
279+
280280 // Package Block
281281 resource .TestCheckResourceAttr (rootRef , "package_block.0.enabled" , "true" ),
282282 resource .TestCheckResourceAttr (rootRef , "package_block.0.packages_black_list.#" , "2" ),
@@ -285,14 +285,14 @@ func TestResourceAquasecFullContainerRuntimePolicyCreate(t *testing.T) {
285285 resource .TestCheckResourceAttr (rootRef , "package_block.0.block_packages_processes.#" , "1" ),
286286 resource .TestCheckResourceAttr (rootRef , "package_block.0.exceptional_block_packages_users.#" , "1" ),
287287 resource .TestCheckResourceAttr (rootRef , "package_block.0.exceptional_block_packages_processes.#" , "1" ),
288-
288+
289289 // Port Block
290290 resource .TestCheckResourceAttr (rootRef , "port_block.0.enabled" , "true" ),
291291 resource .TestCheckResourceAttr (rootRef , "port_block.0.block_inbound_ports.#" , "1" ),
292292 resource .TestCheckResourceAttr (rootRef , "port_block.0.block_outbound_ports.#" , "1" ),
293293 resource .TestCheckResourceAttr (rootRef , "port_block.0.block_inbound_ports.0" , "1-11" ),
294294 resource .TestCheckResourceAttr (rootRef , "port_block.0.block_outbound_ports.0" , "1-11" ),
295-
295+
296296 // Readonly Files
297297 resource .TestCheckResourceAttr (rootRef , "readonly_files.0.enabled" , "true" ),
298298 resource .TestCheckResourceAttr (rootRef , "readonly_files.0.readonly_files.#" , "2" ),
@@ -306,6 +306,11 @@ func TestResourceAquasecFullContainerRuntimePolicyCreate(t *testing.T) {
306306 resource .TestCheckResourceAttr (rootRef , "allowed_registries.0.allowed_registries.0" , "Docker Hub" ),
307307 resource .TestCheckResourceAttr (rootRef , "allowed_registries.0.enabled" , "true" ),
308308
309+ // Malware scan options
310+ resource .TestCheckResourceAttr (rootRef , "malware_scan_options.0.enabled" , "true" ),
311+ resource .TestCheckResourceAttr (rootRef , "malware_scan_options.0.action" , "alert" ),
312+ resource .TestCheckResourceAttr (rootRef , "malware_scan_options.0.file_forensic_collection" , "false" ),
313+
309314 //todo: bring back after we upgrade the testing env
310315 //resource.TestCheckResourceAttr(rootRef, "monitor_system_time_changes", "true"),
311316 resource .TestCheckResourceAttr (rootRef , "restricted_volumes.0.enabled" , "true" ),
0 commit comments