File tree Expand file tree Collapse file tree 2 files changed +2
-27
lines changed
pkg/iac/adapters/arm/compute Expand file tree Collapse file tree 2 files changed +2
-27
lines changed Original file line number Diff line number Diff line change @@ -94,22 +94,6 @@ func adaptLinuxVirtualMachine(resource azure.Resource) compute.LinuxVirtualMachi
9494
9595}
9696
97- func extractNetworkInterfaces (networkProfile azure.Value , metadata iacTypes.Metadata ) []network.NetworkInterface {
98- var networkInterfaces []network.NetworkInterface
99-
100- nicsArray := networkProfile .GetMapValue ("networkInterfaces" ).AsList ()
101- for _ , nic := range nicsArray {
102- nicID := nic .GetMapValue ("id" ).AsStringValue ("" , metadata )
103- if nicID .Value () != "" {
104- // Create a minimal NetworkInterface object with the ID information
105- // In ARM templates, we don't have direct access to subnet details like in Terraform
106- // EnableIPForwarding is not available from the VM's networkProfile, so it defaults to false
107- // Since we only have a reference to the network interface (not the full resource),
108- // we mark it as unmanaged so that Rego policies can skip it using isManaged() checks
109- networkInterfaces = append (networkInterfaces , network.NetworkInterface {
110- Metadata : iacTypes .NewUnmanagedMetadata (),
111- })
112- }
113- }
114- return networkInterfaces
97+ func extractNetworkInterfaces (_ azure.Value , _ iacTypes.Metadata ) []network.NetworkInterface {
98+ return nil
11599}
Original file line number Diff line number Diff line change 55
66 "github.com/aquasecurity/trivy/pkg/iac/adapters/arm/adaptertest"
77 "github.com/aquasecurity/trivy/pkg/iac/providers/azure/compute"
8- "github.com/aquasecurity/trivy/pkg/iac/providers/azure/network"
98 "github.com/aquasecurity/trivy/pkg/iac/types"
109)
1110
@@ -117,10 +116,6 @@ func TestAdapt(t *testing.T) {
117116 LinuxVirtualMachines : []compute.LinuxVirtualMachine {{
118117 VirtualMachine : compute.VirtualMachine {
119118 CustomData : types .StringTest ("test" ),
120- NetworkInterfaces : []network.NetworkInterface {
121- {},
122- {},
123- },
124119 },
125120 OSProfileLinuxConfig : compute.OSProfileLinuxConfig {
126121 DisablePasswordAuthentication : types .BoolTest (false ),
@@ -129,10 +124,6 @@ func TestAdapt(t *testing.T) {
129124 WindowsVirtualMachines : []compute.WindowsVirtualMachine {{
130125 VirtualMachine : compute.VirtualMachine {
131126 CustomData : types .StringTest ("test" ),
132- NetworkInterfaces : []network.NetworkInterface {
133- {},
134- {},
135- },
136127 },
137128 }},
138129 },
You can’t perform that action at this time.
0 commit comments