Skip to content

Commit 356c407

Browse files
dependabot[bot]nikpivkin
authored andcommitted
chore(deps): bump the common group across 1 directory with 7 updates (#454)
Bumps the common group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/aws-cloudformation/rain](https://github.com/aws-cloudformation/rain) | `1.23.0` | `1.23.1` | | [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) | `2.23.0` | `2.24.0` | | [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) | `1.5.1` | `1.6.0` | | [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) | `0.37.1-0.20250602105123-1720acdcb24e` | `0.38.0` | | [github.com/testcontainers/testcontainers-go/modules/registry](https://github.com/testcontainers/testcontainers-go) | `0.37.0` | `0.38.0` | | [golang.org/x/text](https://github.com/golang/text) | `0.26.0` | `0.27.0` | | [mvdan.cc/sh/v3](https://github.com/mvdan/sh) | `3.11.0` | `3.12.0` | Updates `github.com/aws-cloudformation/rain` from 1.23.0 to 1.23.1 - [Release notes](https://github.com/aws-cloudformation/rain/releases) - [Commits](aws-cloudformation/rain@v1.23.0...v1.23.1) Updates `github.com/hashicorp/hcl/v2` from 2.23.0 to 2.24.0 - [Release notes](https://github.com/hashicorp/hcl/releases) - [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md) - [Commits](hashicorp/hcl@v2.23.0...v2.24.0) Updates `github.com/open-policy-agent/opa` from 1.5.1 to 1.6.0 - [Release notes](https://github.com/open-policy-agent/opa/releases) - [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md) - [Commits](open-policy-agent/opa@v1.5.1...v1.6.0) Updates `github.com/testcontainers/testcontainers-go` from 0.37.1-0.20250602105123-1720acdcb24e to 0.38.0 - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/commits/v0.38.0) Updates `github.com/testcontainers/testcontainers-go/modules/registry` from 0.37.0 to 0.38.0 - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](testcontainers/testcontainers-go@v0.37.0...v0.38.0) Updates `golang.org/x/text` from 0.26.0 to 0.27.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.26.0...v0.27.0) Updates `mvdan.cc/sh/v3` from 3.11.0 to 3.12.0 - [Release notes](https://github.com/mvdan/sh/releases) - [Changelog](https://github.com/mvdan/sh/blob/master/CHANGELOG.md) - [Commits](mvdan/sh@v3.11.0...v3.12.0) --- updated-dependencies: - dependency-name: github.com/aws-cloudformation/rain dependency-version: 1.23.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: common - dependency-name: github.com/hashicorp/hcl/v2 dependency-version: 2.24.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: common - dependency-name: github.com/open-policy-agent/opa dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: common - dependency-name: github.com/testcontainers/testcontainers-go dependency-version: 0.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: common - dependency-name: github.com/testcontainers/testcontainers-go/modules/registry dependency-version: 0.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: common - dependency-name: golang.org/x/text dependency-version: 0.27.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: common - dependency-name: mvdan.cc/sh/v3 dependency-version: 3.12.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: common ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 96f2adc commit 356c407

File tree

8 files changed

+639
-532
lines changed

8 files changed

+639
-532
lines changed

.github/workflows/verify-docs.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/verify.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Verify Docs and Specs
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
7+
env:
8+
GO_VERSION: "1.24"
9+
10+
jobs:
11+
verify-docs:
12+
name: Verify Docs
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-go@v5
18+
with:
19+
go-version: ${{ env.GO_VERSION }}
20+
21+
- run: |
22+
make docs
23+
if [ -n "$(git status --porcelain)" ]; then
24+
echo "Run 'make docs' and push it"
25+
exit 1
26+
fi
27+
28+
verify-specs:
29+
name: Verify Specs
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-go@v5
35+
with:
36+
go-version: ${{ env.GO_VERSION }}
37+
38+
- name: Generate specification files
39+
run: |
40+
make genspec
41+
if [ -n "$(git status --porcelain)" ]; then
42+
echo "Run 'make genspec' and push it"
43+
exit 1
44+
fi

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ push-bundle: create-bundle
9393
$$REPO \
9494
--artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
9595
"$(BUNDLE_FILE):application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip"
96+
97+
.PHONY: genspec
98+
# Generate specification files
99+
genspec:
100+
go run ./cmd/genspec

cmd/genspec/main.go

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"log"
6+
"os"
7+
"path/filepath"
8+
"sort"
9+
"strings"
10+
11+
"gopkg.in/yaml.v3"
12+
13+
"github.com/aquasecurity/trivy-checks/pkg/rego/metadata"
14+
"github.com/aquasecurity/trivy/pkg/iac/framework"
15+
iacTypes "github.com/aquasecurity/trivy/pkg/iac/types"
16+
"github.com/samber/lo"
17+
)
18+
19+
const complianceDirPath = "pkg/compliance/"
20+
21+
var specs = map[framework.Framework]*iacTypes.Spec{
22+
framework.CIS_AWS_1_2: {
23+
ID: "aws-cis-1.2",
24+
Title: "AWS CIS Foundations v1.2",
25+
Description: "AWS CIS Foundations",
26+
Version: "1.2",
27+
Platform: "aws",
28+
Type: "cis",
29+
RelatedResources: []string{
30+
"https://www.cisecurity.org/benchmark/amazon_web_services",
31+
},
32+
},
33+
framework.CIS_AWS_1_4: {
34+
ID: "aws-cis-1.4",
35+
Title: "AWS CIS Foundations v1.4",
36+
Description: "AWS CIS Foundations",
37+
Version: "1.4",
38+
Platform: "aws",
39+
Type: "cis",
40+
RelatedResources: []string{
41+
"https://www.cisecurity.org/benchmark/amazon_web_services",
42+
},
43+
},
44+
}
45+
46+
func main() {
47+
frameworks := make([]framework.Framework, 0, len(specs))
48+
for f := range specs {
49+
frameworks = append(frameworks, f)
50+
}
51+
52+
for _, meta := range lo.Must(metadata.LoadDefaultChecksMetadata()) {
53+
for f, controlIDs := range meta.Frameworks() {
54+
if f == "default" {
55+
continue
56+
}
57+
58+
ff := framework.Framework(f)
59+
spec, exists := specs[ff]
60+
if !exists {
61+
log.Printf("Unknown framework: %s", f)
62+
continue
63+
}
64+
65+
for _, id := range controlIDs {
66+
spec.Controls = append(spec.Controls, iacTypes.Control{
67+
ID: id,
68+
Name: lo.LastOrEmpty(meta.Aliases()),
69+
Description: meta.Title,
70+
Severity: iacTypes.Severity(meta.Severity()),
71+
Checks: []iacTypes.SpecCheck{{ID: meta.ID()}},
72+
})
73+
}
74+
}
75+
}
76+
77+
for _, spec := range specs {
78+
sort.Slice(spec.Controls, func(i, j int) bool {
79+
return strings.Compare(spec.Controls[i].ID, spec.Controls[j].ID) < 0
80+
})
81+
}
82+
83+
for _, c := range specs {
84+
lo.Must0(writeCompliance(c, complianceDirPath))
85+
}
86+
}
87+
88+
func writeCompliance(spec *iacTypes.Spec, path string) error {
89+
file, err := os.Create(filepath.Join(path, fmt.Sprintf("%s.yaml", spec.ID)))
90+
if err != nil {
91+
return err
92+
}
93+
defer file.Close()
94+
encoder := yaml.NewEncoder(file)
95+
encoder.SetIndent(2)
96+
return encoder.Encode(iacTypes.ComplianceSpec{Spec: *spec})
97+
}

go.mod

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ go 1.24.4
44

55
require (
66
github.com/aquasecurity/trivy v0.61.1-0.20250407075540-f1329c7ea1aa
7-
github.com/aws-cloudformation/rain v1.23.0
7+
github.com/aws-cloudformation/rain v1.23.1
88
github.com/docker/docker v28.2.2+incompatible
9-
github.com/hashicorp/hcl/v2 v2.23.0
10-
github.com/open-policy-agent/opa v1.5.1
9+
github.com/hashicorp/hcl/v2 v2.24.0
10+
github.com/open-policy-agent/opa v1.6.0
1111
github.com/owenrumney/squealer v1.2.11
1212
github.com/samber/lo v1.51.0
1313
github.com/stretchr/testify v1.10.0
14-
github.com/testcontainers/testcontainers-go v0.37.1-0.20250602105123-1720acdcb24e
15-
github.com/testcontainers/testcontainers-go/modules/registry v0.37.0
14+
github.com/testcontainers/testcontainers-go v0.38.0
15+
github.com/testcontainers/testcontainers-go/modules/registry v0.38.0
1616
github.com/xeipuuv/gojsonschema v1.2.0
17-
golang.org/x/text v0.26.0
17+
golang.org/x/text v0.27.0
1818
gopkg.in/yaml.v3 v3.0.1
19-
mvdan.cc/sh/v3 v3.11.0
19+
mvdan.cc/sh/v3 v3.12.0
2020
)
2121

2222
require (
@@ -34,6 +34,7 @@ require (
3434
github.com/beorn7/perks v1.0.1 // indirect
3535
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 // indirect
3636
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
37+
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
3738
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3839
github.com/chzyer/readline v1.5.1 // indirect
3940
github.com/cloudflare/circl v1.6.1 // indirect
@@ -53,7 +54,7 @@ require (
5354
github.com/docker/go-connections v0.5.0 // indirect
5455
github.com/docker/go-units v0.5.0 // indirect
5556
github.com/dustin/go-humanize v1.0.1 // indirect
56-
github.com/ebitengine/purego v0.8.2 // indirect
57+
github.com/ebitengine/purego v0.8.4 // indirect
5758
github.com/emirpasic/gods v1.18.1 // indirect
5859
github.com/fatih/color v1.18.0 // indirect
5960
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -70,13 +71,11 @@ require (
7071
github.com/gobwas/glob v0.2.3 // indirect
7172
github.com/gogo/protobuf v1.3.2 // indirect
7273
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
73-
github.com/golang/protobuf v1.5.4 // indirect
7474
github.com/google/flatbuffers v25.2.10+incompatible // indirect
7575
github.com/google/go-cmp v0.7.0 // indirect
7676
github.com/google/uuid v1.6.0 // indirect
7777
github.com/gookit/color v1.5.4 // indirect
78-
github.com/gorilla/mux v1.8.1 // indirect
79-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect
78+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
8079
github.com/hashicorp/errwrap v1.1.0 // indirect
8180
github.com/hashicorp/go-multierror v1.1.1 // indirect
8281
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -120,7 +119,7 @@ require (
120119
github.com/rivo/uniseg v0.4.7 // indirect
121120
github.com/sagikazarmark/locafero v0.7.0 // indirect
122121
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
123-
github.com/shirou/gopsutil/v4 v4.25.4 // indirect
122+
github.com/shirou/gopsutil/v4 v4.25.5 // indirect
124123
github.com/sirupsen/logrus v1.9.3 // indirect
125124
github.com/skeema/knownhosts v1.3.1 // indirect
126125
github.com/sourcegraph/conc v0.3.0 // indirect
@@ -133,7 +132,7 @@ require (
133132
github.com/tchap/go-patricia/v2 v2.3.2 // indirect
134133
github.com/tklauser/go-sysconf v0.3.13 // indirect
135134
github.com/tklauser/numcpus v0.7.0 // indirect
136-
github.com/vektah/gqlparser/v2 v2.5.26 // indirect
135+
github.com/vektah/gqlparser/v2 v2.5.28 // indirect
137136
github.com/xanzy/ssh-agent v0.3.3 // indirect
138137
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
139138
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
@@ -144,26 +143,26 @@ require (
144143
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
145144
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
146145
go.opentelemetry.io/otel v1.36.0 // indirect
147-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
148-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
149-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 // indirect
146+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect
147+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect
148+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect
150149
go.opentelemetry.io/otel/metric v1.36.0 // indirect
151150
go.opentelemetry.io/otel/sdk v1.36.0 // indirect
152151
go.opentelemetry.io/otel/trace v1.36.0 // indirect
153-
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
152+
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
154153
go.uber.org/automaxprocs v1.6.0 // indirect
155154
go.uber.org/multierr v1.11.0 // indirect
156155
golang.org/x/crypto v0.39.0 // indirect
157156
golang.org/x/mod v0.25.0 // indirect
158157
golang.org/x/net v0.41.0 // indirect
159-
golang.org/x/sync v0.15.0 // indirect
158+
golang.org/x/sync v0.16.0 // indirect
160159
golang.org/x/sys v0.33.0 // indirect
161160
golang.org/x/term v0.32.0 // indirect
162161
golang.org/x/time v0.11.0 // indirect
163162
golang.org/x/tools v0.34.0 // indirect
164163
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
165-
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
166-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect
164+
google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect
165+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect
167166
google.golang.org/grpc v1.72.2 // indirect
168167
google.golang.org/protobuf v1.36.6 // indirect
169168
gopkg.in/warnings.v0 v0.1.2 // indirect

0 commit comments

Comments
 (0)