Skip to content

Commit

Permalink
update libraries (#1385)
Browse files Browse the repository at this point in the history
* update goformation library

* go version update

* formatting fix

* update deps, replace deprecated methods

* update golint install step

* add helper functions to resolve pointers

* nil pointer resolution

* update generic function nil pointer check

* methodsetting fix

* nil pointer check update

* validation and deps fix

* goformation parsing is more strict now

* expected parsing error
  • Loading branch information
gaurav-gogia authored Sep 14, 2022
1 parent 752d2a0 commit af10a24
Show file tree
Hide file tree
Showing 159 changed files with 1,133 additions and 940 deletions.
88 changes: 44 additions & 44 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,48 @@ jobs:
GO111MODULE: on
GOPATH: /home/runner/work/terrascan
GOBIN: /home/runner/work/terrascan/bin
GO_VERSION: 1.17
GO_VERSION: 1.19
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_TEST }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST }}
AWS_REGION: ${{ secrets.AWS_REGION_TEST }}
AZURE_AUTH_TEST_SECRET: ${{ secrets.AZURE_AUTH_TEST_KEY }}
GOOGLE_APPLICATION_CREDENTIALS_TEST_SECRET: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_TEST_KEY }}
AZURE_AUTH_TEST_SECRET: ${{ secrets.AZURE_AUTH_TEST_KEY }}
GOOGLE_APPLICATION_CREDENTIALS_TEST_SECRET: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_TEST_KEY }}
steps:
- name: Checkout Terrascan
uses: actions/checkout@v2
- name: Checkout Terrascan
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}

- name: Install golint
run: go get -u golang.org/x/lint/golint
- name: Install golint
run: go install golang.org/x/lint/golint@latest

- name: Build Terrascan docker image
run: make docker-build
- name: Build Terrascan docker image
run: make docker-build

- name: Go validations
run: make validate
- name: Go validations
run: make validate

- name: Build Terrascan
run: make build
- name: Build Terrascan
run: make build

- name: Run unit tests
run: make unit-tests
- name: Run unit tests
run: make unit-tests

- name: install kind
run: make install-kind
- name: install kind
run: make install-kind

- name: Run e2e tests
run: make e2e-tests
- name: Run e2e tests
run: make e2e-tests

- name: Run e2e vulnerability tests
if: ${{ (github.event_name == 'push'|| github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }}
run: make e2e-vulnerability-tests
- name: Run e2e vulnerability tests
if: ${{ (github.event_name == 'push'|| github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }}
run: make e2e-vulnerability-tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

# push image to Docker Hub
push:
Expand All @@ -63,19 +63,19 @@ jobs:
if: github.event_name == 'push'

steps:
- name: Checkout Terrascan
uses: actions/checkout@v2

- name: Build Terrascan docker image
run: make docker-build

- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Terrascan latest docker image
if: ${{ github.ref == 'refs/heads/master' }}
run: make docker-push-latest
- name: Checkout Terrascan
uses: actions/checkout@v2

- name: Build Terrascan docker image
run: make docker-build

- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Terrascan latest docker image
if: ${{ github.ref == 'refs/heads/master' }}
run: make docker-push-latest
43 changes: 20 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@ name: release
on:
push:
tags:
- '*'
- "*"

jobs:
release:
runs-on: ubuntu-latest
env:
GO111MODULE: on
GO_VERSION: 1.17
GO_VERSION: 1.19
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
Expand All @@ -36,23 +33,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout Terrascan
uses: actions/checkout@v2
- name: Checkout Terrascan
uses: actions/checkout@v2

- name: Build Terrascan docker image
run: make docker-build
- name: Build Terrascan docker image
run: make docker-build

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Terrascan latest tag docker image
run: make docker-push-latest-tag
- name: Push Terrascan latest tag docker image
run: make docker-push-latest-tag

- name: Build terrascan_atlantis docker image
run: make atlantis-docker-build
- name: Build terrascan_atlantis docker image
run: make atlantis-docker-build

- name: Push terrascan_atlantis latest tag docker image
run: make atlantis-docker-push-latest-tag
- name: Push terrascan_atlantis latest tag docker image
run: make atlantis-docker-push-latest-tag
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Terrascan's default output is a list of violations present in the scanned IaC. A
![Screenshot 2021-01-19 at 10 52 47 PM](https://user-images.githubusercontent.com/74685902/105115731-32d2ff80-5a7e-11eb-93b0-2f0620eb1295.png)

## Building Terrascan
Terrascan can be built locally. This is helpful if you want to be on the latest version or when developing Terrascan. [gcc](https://gcc.gnu.org/install/) and [Go](https://go.dev/doc/install) 1.17 or above are required.
Terrascan can be built locally. This is helpful if you want to be on the latest version or when developing Terrascan. [gcc](https://gcc.gnu.org/install/) and [Go](https://go.dev/doc/install) 1.19 or above are required.

```sh
$ git clone [email protected]:tenable/terrascan.git
Expand Down
29 changes: 15 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tenable/terrascan

go 1.17
go 1.19

replace (
github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible => github.com/tencentcloud/tencentcloud-sdk-go v1.0.191
Expand All @@ -22,7 +22,6 @@ require (
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.3.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.11.1
github.com/aws/smithy-go v1.6.0
github.com/awslabs/goformation/v5 v5.4.5
github.com/ghodss/yaml v1.0.0
github.com/go-errors/errors v1.0.1
github.com/google/go-containerregistry v0.1.2
Expand All @@ -44,7 +43,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/moby/buildkit v0.8.3
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.12.0
github.com/onsi/gomega v1.20.2
github.com/open-policy-agent/opa v0.22.0
github.com/owenrumney/go-sarif v1.0.12
github.com/pelletier/go-toml v1.9.3
Expand All @@ -54,14 +53,14 @@ require (
github.com/stretchr/testify v1.7.0
github.com/zclconf/go-cty v1.9.1
go.uber.org/zap v1.16.0
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
golang.org/x/tools v0.1.12 // indirect
google.golang.org/api v0.34.0
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.6.1
honnef.co/go/tools v0.3.1 // indirect
honnef.co/go/tools v0.3.3 // indirect
k8s.io/api v0.21.0
k8s.io/apimachinery v0.21.0
k8s.io/client-go v10.0.0+incompatible
Expand All @@ -70,6 +69,8 @@ require (
sigs.k8s.io/kustomize/kyaml v0.11.0
)

require github.com/awslabs/goformation/v6 v6.10.0

require (
cloud.google.com/go/storage v1.10.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
Expand Down Expand Up @@ -122,7 +123,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
Expand Down Expand Up @@ -176,18 +177,18 @@ require (
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/grpc v1.31.1 // indirect
google.golang.org/protobuf v1.26.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
Loading

0 comments on commit af10a24

Please sign in to comment.