@@ -6,17 +6,17 @@ import (
6
6
"github.com/stretchr/testify/assert"
7
7
"github.com/stretchr/testify/require"
8
8
9
- azure2 "github.com/aquasecurity/trivy/pkg/iac/scanners/azure"
9
+ "github.com/aquasecurity/trivy/pkg/iac/scanners/azure"
10
10
"github.com/aquasecurity/trivy/pkg/iac/types"
11
11
)
12
12
13
13
func Test_AdaptStorageDefaults (t * testing.T ) {
14
14
15
- input := azure2 .Deployment {
16
- Resources : []azure2 .Resource {
15
+ input := azure .Deployment {
16
+ Resources : []azure .Resource {
17
17
{
18
- Type : azure2 .NewValue ("Microsoft.Storage/storageAccounts" , types .NewTestMetadata ()),
19
- Properties : azure2 .NewValue (make (map [string ]azure2 .Value ), types .NewTestMetadata ()),
18
+ Type : azure .NewValue ("Microsoft.Storage/storageAccounts" , types .NewTestMetadata ()),
19
+ Properties : azure .NewValue (make (map [string ]azure .Value ), types .NewTestMetadata ()),
20
20
},
21
21
},
22
22
}
@@ -28,19 +28,21 @@ func Test_AdaptStorageDefaults(t *testing.T) {
28
28
account := output .Accounts [0 ]
29
29
assert .Equal (t , "" , account .MinimumTLSVersion .Value ())
30
30
assert .False (t , account .EnforceHTTPS .Value ())
31
+ assert .True (t , account .PublicNetworkAccess .Value ())
31
32
32
33
}
33
34
34
35
func Test_AdaptStorage (t * testing.T ) {
35
36
36
- input := azure2 .Deployment {
37
- Resources : []azure2 .Resource {
37
+ input := azure .Deployment {
38
+ Resources : []azure .Resource {
38
39
{
39
- Type : azure2 .NewValue ("Microsoft.Storage/storageAccounts" , types .NewTestMetadata ()),
40
- Name : azure2.Value {},
41
- Properties : azure2 .NewValue (map [string ]azure2.Value {
42
- "minimumTlsVersion" : azure2 .NewValue ("TLS1_2" , types .NewTestMetadata ()),
43
- "supportsHttpsTrafficOnly" : azure2 .NewValue (true , types .NewTestMetadata ()),
40
+ Type : azure .NewValue ("Microsoft.Storage/storageAccounts" , types .NewTestMetadata ()),
41
+ Name : azure.Value {},
42
+ Properties : azure .NewValue (map [string ]azure.Value {
43
+ "minimumTlsVersion" : azure .NewValue ("TLS1_2" , types .NewTestMetadata ()),
44
+ "supportsHttpsTrafficOnly" : azure .NewValue (true , types .NewTestMetadata ()),
45
+ "publicNetworkAccess" : azure .NewValue ("Disabled" , types .NewTestMetadata ()),
44
46
}, types .NewTestMetadata ()),
45
47
},
46
48
},
@@ -53,5 +55,6 @@ func Test_AdaptStorage(t *testing.T) {
53
55
account := output .Accounts [0 ]
54
56
assert .Equal (t , "TLS1_2" , account .MinimumTLSVersion .Value ())
55
57
assert .True (t , account .EnforceHTTPS .Value ())
58
+ assert .False (t , account .PublicNetworkAccess .Value ())
56
59
57
60
}
0 commit comments