Skip to content

Commit 3487acc

Browse files
authored
chore(deps): Update defsec to v0.57.3 for improved syntax highlighting (fanal#524)
* chore(deps): Update defsec to v0.57.3 for improved syntax highlighting
1 parent c8e07a4 commit 3487acc

File tree

5 files changed

+30
-27
lines changed

5 files changed

+30
-27
lines changed

artifact/local/fs_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ func TestTerraformMisconfigurationScan(t *testing.T) {
335335
want: types.ArtifactReference{
336336
Name: "testdata/misconfig/terraform/single-failure/src",
337337
Type: types.ArtifactFilesystem,
338-
ID: "sha256:be395aa0b5e74419a562760193c97ed6ab3544192b6962016f070489f94ce2ba",
338+
ID: "sha256:a5bb7c32f4952f79ee42b72f5fe0b14927baaf232209628bfaa8fb3b1d56de98",
339339
BlobIDs: []string{
340-
"sha256:be395aa0b5e74419a562760193c97ed6ab3544192b6962016f070489f94ce2ba",
340+
"sha256:a5bb7c32f4952f79ee42b72f5fe0b14927baaf232209628bfaa8fb3b1d56de98",
341341
},
342342
},
343343
},
@@ -467,9 +467,9 @@ func TestTerraformMisconfigurationScan(t *testing.T) {
467467
want: types.ArtifactReference{
468468
Name: "testdata/misconfig/terraform/multiple-failures/src",
469469
Type: types.ArtifactFilesystem,
470-
ID: "sha256:1985b3adc6a93208e745aff2090d811b4d769d1291564e7f6e12e7d926caa626",
470+
ID: "sha256:75892dfaf8fdc29d839d3e19b58e43e683885d7e2d9b2bfb66814dbd3ea3e411",
471471
BlobIDs: []string{
472-
"sha256:1985b3adc6a93208e745aff2090d811b4d769d1291564e7f6e12e7d926caa626",
472+
"sha256:75892dfaf8fdc29d839d3e19b58e43e683885d7e2d9b2bfb66814dbd3ea3e411",
473473
},
474474
},
475475
},
@@ -679,9 +679,9 @@ func TestCloudFormationMisconfigurationScan(t *testing.T) {
679679
want: types.ArtifactReference{
680680
Name: "testdata/misconfig/cloudformation/single-failure/src",
681681
Type: types.ArtifactFilesystem,
682-
ID: "sha256:a926476fcbcc5989c38ff19c0ab5400274cc77ea8241782296188d4ce712a765",
682+
ID: "sha256:72bb6ff986b18b2cd1cd49a8a5f151c797330157894c2c095a8a480388988fe8",
683683
BlobIDs: []string{
684-
"sha256:a926476fcbcc5989c38ff19c0ab5400274cc77ea8241782296188d4ce712a765",
684+
"sha256:72bb6ff986b18b2cd1cd49a8a5f151c797330157894c2c095a8a480388988fe8",
685685
},
686686
},
687687
},
@@ -777,9 +777,9 @@ func TestCloudFormationMisconfigurationScan(t *testing.T) {
777777
want: types.ArtifactReference{
778778
Name: "testdata/misconfig/cloudformation/multiple-failures/src",
779779
Type: types.ArtifactFilesystem,
780-
ID: "sha256:1cd0f0c2eb3b28afb4b1a7d2c02dce376fdc9ab4b01d72a81929c2763680db1a",
780+
ID: "sha256:dcbe01c817a565ec46230dc50cab6e5f23b80655f3854e91750fd2db0f3f7ea1",
781781
BlobIDs: []string{
782-
"sha256:1cd0f0c2eb3b28afb4b1a7d2c02dce376fdc9ab4b01d72a81929c2763680db1a",
782+
"sha256:dcbe01c817a565ec46230dc50cab6e5f23b80655f3854e91750fd2db0f3f7ea1",
783783
},
784784
},
785785
},
@@ -990,9 +990,9 @@ func TestDockerfileMisconfigurationScan(t *testing.T) {
990990
want: types.ArtifactReference{
991991
Name: "testdata/misconfig/dockerfile/single-failure/src",
992992
Type: types.ArtifactFilesystem,
993-
ID: "sha256:cf8ea1b286fb6d11f42607aef7aa633099014cb0741d39f7ad1dfa0d5bbb2c34",
993+
ID: "sha256:68840b274aec029b2d040f947174a1380744b3086d891d4fba0433870548d019",
994994
BlobIDs: []string{
995-
"sha256:cf8ea1b286fb6d11f42607aef7aa633099014cb0741d39f7ad1dfa0d5bbb2c34",
995+
"sha256:68840b274aec029b2d040f947174a1380744b3086d891d4fba0433870548d019",
996996
},
997997
},
998998
},
@@ -1087,9 +1087,9 @@ func TestDockerfileMisconfigurationScan(t *testing.T) {
10871087
want: types.ArtifactReference{
10881088
Name: "testdata/misconfig/dockerfile/multiple-failures/src",
10891089
Type: types.ArtifactFilesystem,
1090-
ID: "sha256:73623c3a8aa1a2fc6d644ec8e73a1fad1e869bbcc83b6d2dcda37b35931be91c",
1090+
ID: "sha256:2da33c84f378438a0c6eb01020235ec8f6baee2f17e850faed2cf09f7b3ff2d6",
10911091
BlobIDs: []string{
1092-
"sha256:73623c3a8aa1a2fc6d644ec8e73a1fad1e869bbcc83b6d2dcda37b35931be91c",
1092+
"sha256:2da33c84f378438a0c6eb01020235ec8f6baee2f17e850faed2cf09f7b3ff2d6",
10931093
},
10941094
},
10951095
},
@@ -1301,9 +1301,9 @@ func TestKubernetesMisconfigurationScan(t *testing.T) {
13011301
want: types.ArtifactReference{
13021302
Name: "testdata/misconfig/kubernetes/single-failure/src",
13031303
Type: types.ArtifactFilesystem,
1304-
ID: "sha256:7276d31bde32924a09db2bfb473253b22716adf7efb263dda7739b1b89a5608d",
1304+
ID: "sha256:679b85f2260abe173a23dcceb0e66ced1484987a0a8d7817102301370ad40c84",
13051305
BlobIDs: []string{
1306-
"sha256:7276d31bde32924a09db2bfb473253b22716adf7efb263dda7739b1b89a5608d",
1306+
"sha256:679b85f2260abe173a23dcceb0e66ced1484987a0a8d7817102301370ad40c84",
13071307
},
13081308
},
13091309
},
@@ -1398,9 +1398,9 @@ func TestKubernetesMisconfigurationScan(t *testing.T) {
13981398
want: types.ArtifactReference{
13991399
Name: "testdata/misconfig/kubernetes/multiple-failures/src",
14001400
Type: types.ArtifactFilesystem,
1401-
ID: "sha256:7a524d401bb724e277ace6ac10dd94cbde5490511af280605ba886d54ae4d079",
1401+
ID: "sha256:6418f0d0629b65d819e9c7c8e97efe0d8dd1ff4b09e21b835c735227e12d3660",
14021402
BlobIDs: []string{
1403-
"sha256:7a524d401bb724e277ace6ac10dd94cbde5490511af280605ba886d54ae4d079",
1403+
"sha256:6418f0d0629b65d819e9c7c8e97efe0d8dd1ff4b09e21b835c735227e12d3660",
14041404
},
14051405
},
14061406
},

external/config_scan_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ func TestConfigScanner_Scan(t *testing.T) {
5959
{
6060
Number: 1,
6161
Content: "FROM alpine:3.10",
62+
Highlighted: "\x1b\x1b[38;5;64mFROM\x1b\x1b[0m\x1b\x1b[38;5;37m alpine:3.10\x1b",
6263
IsCause: true,
6364
Annotation: "",
6465
Truncated: false,
65-
Highlighted: "FROM alpine:3.10",
66-
FirstCause: false,
66+
FirstCause: true,
6767
LastCause: false,
6868
},
6969
{
7070
Number: 2,
7171
Content: "",
72+
Highlighted: "\x1b[0m",
7273
IsCause: true,
7374
Annotation: "",
7475
Truncated: false,
75-
Highlighted: "",
7676
FirstCause: false,
77-
LastCause: false,
77+
LastCause: true,
7878
},
7979
},
8080
},

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/BurntSushi/toml v1.1.0 // indirect
1111
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible
1212
github.com/alicebob/miniredis/v2 v2.18.0
13-
github.com/aquasecurity/defsec v0.56.2
13+
github.com/aquasecurity/defsec v0.57.3
1414
github.com/aws/aws-sdk-go v1.44.5
1515
github.com/docker/docker v20.10.14+incompatible
1616
github.com/docker/go-connections v0.4.0
@@ -68,6 +68,7 @@ require (
6868
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
6969
github.com/acomagu/bufpipe v1.0.3 // indirect
7070
github.com/agext/levenshtein v1.2.3 // indirect
71+
github.com/alecthomas/chroma v0.10.0 // indirect
7172
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
7273
github.com/apparentlymart/go-cidr v1.1.0 // indirect
7374
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@@ -82,6 +83,7 @@ require (
8283
github.com/davecgh/go-spew v1.1.1 // indirect
8384
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
8485
github.com/dimchansky/utfbom v1.1.1 // indirect
86+
github.com/dlclark/regexp2 v1.4.0 // indirect
8587
github.com/docker/cli v20.10.13+incompatible // indirect
8688
github.com/docker/distribution v2.8.0+incompatible // indirect
8789
github.com/docker/docker-credential-helpers v0.6.4 // indirect
@@ -116,7 +118,6 @@ require (
116118
github.com/klauspost/compress v1.15.1 // indirect
117119
github.com/liamg/iamgo v0.0.6 // indirect
118120
github.com/liamg/jfather v0.0.7 // indirect
119-
github.com/liamg/tml v0.6.0 // indirect
120121
github.com/magiconair/properties v1.8.5 // indirect
121122
github.com/mattn/go-isatty v0.0.14 // indirect
122123
github.com/mattn/go-runewidth v0.0.12 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ
143143
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
144144
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
145145
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
146+
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
147+
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
146148
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
147149
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
148150
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -163,8 +165,8 @@ github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:o
163165
github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
164166
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
165167
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
166-
github.com/aquasecurity/defsec v0.56.2 h1:23yspUaFBI0nUfHWwVLkOqISdhI+ZfRWk4bXLW/wr4Q=
167-
github.com/aquasecurity/defsec v0.56.2/go.mod h1:erYNqVU+guUDnM06O2rEl3IKKYNtMN82T36BSR/GbTo=
168+
github.com/aquasecurity/defsec v0.57.3 h1:oiATfUTxOAcxAuXSH31RdgjtXJdQznlVzMJWdVYGmXY=
169+
github.com/aquasecurity/defsec v0.57.3/go.mod h1:42FxKif2itz+MHFlJ3TJjdroL9Jzj3THoexlueBTU5w=
168170
github.com/aquasecurity/go-dep-parser v0.0.0-20220503151658-d316f5cc2cff h1:YNlzRYB0n4mZtfuWx6AWaGEjnLVNekchyoFDlYFZegs=
169171
github.com/aquasecurity/go-dep-parser v0.0.0-20220503151658-d316f5cc2cff/go.mod h1:7EOQWQmyavVPY3fScbbPdd3dB/b0Q4ZbJ/NZCvNKrLs=
170172
github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492 h1:rcEG5HI490FF0a7zuvxOxen52ddygCfNVjP0XOCMl+M=
@@ -410,6 +412,8 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8
410412
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
411413
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
412414
github.com/distribution/distribution/v3 v3.0.0-20211118083504-a29a3c99a684/go.mod h1:UfCu3YXJJCI+IdnqGgYP82dk2+Joxmv+mUTVBES6wac=
415+
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
416+
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
413417
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
414418
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
415419
github.com/docker/cli v20.10.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
@@ -811,8 +815,6 @@ github.com/liamg/jfather v0.0.7 h1:Xf78zS263yfT+xr2VSo6+kyAy4ROlCacRqJG7s5jt4k=
811815
github.com/liamg/jfather v0.0.7/go.mod h1:xXBGiBoiZ6tmHhfy5Jzw8sugzajwYdi6VosIpB3/cPM=
812816
github.com/liamg/memoryfs v1.4.1 h1:Kuq+1seUuy0wXL5N+bKHbFXilukRNnPqPU+Ld2RDHgc=
813817
github.com/liamg/memoryfs v1.4.1/go.mod h1:z7mfqXFQS8eSeBBsFjYLlxYRMRyiPktytvYCYTb3BSk=
814-
github.com/liamg/tml v0.6.0 h1:yOC/Q9p9Io3J11U9LdYVIwpRTnTE1GPMNFLrygkmE2Y=
815-
github.com/liamg/tml v0.6.0/go.mod h1:0h4EAV/zBOsqI91EWONedjRpO8O0itjGJVd+wG5eC+E=
816818
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
817819
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
818820
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=

types/misconf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewCauseWithCode(underlying scan.Result) CauseMetadata {
4848
StartLine: flat.Location.StartLine,
4949
EndLine: flat.Location.EndLine,
5050
}
51-
if code, err := underlying.GetCode(true); err == nil {
51+
if code, err := underlying.GetCode(); err == nil {
5252
cause.Code = *code
5353
}
5454
return cause

0 commit comments

Comments
 (0)