From 335973a91bec69bb0db4985ef9ea47a8703c1168 Mon Sep 17 00:00:00 2001 From: seth mccombs Date: Fri, 20 Dec 2024 21:50:08 -0800 Subject: [PATCH 1/5] get goreleaser figured out --- .github/CONTRIBUTING.md | 23 +++++++++-------------- .goreleaser.yml | 29 ++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f56317cb1..2c7b08eb2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,24 +1,20 @@ -## This project is now in maintenance mode. We cannot promise to review contributions. Please feel free to fork the project to apply any changes you might want to make. +# Contributing +## Build +### Requirements +If you wish to work on the driftctl CLI source code, you'll first need to install: +- the Go compiler +- the version control system Git +- [GoReleaser](https://goreleaser.com/) - - - - - - -### Build - -If you wish to work on the driftctl CLI source code, you'll first need to install the Go compiler and the version control system Git. - -At this time the driftctl development environment is targeting only Linux Mac OS X and Windows systems. +At this time the `driftctl` development environment is targeting only Linux Mac OS X and Windows systems. Refer to the file [`.go-version`](https://github.com/cloudskiff/driftctl/blob/master/.go-version) to see which version of Go driftctl is currently built with. Other versions will often work, but if you run into any build or testing problems please try with the specific Go version indicated. You can optionally simplify the installation of multiple specific versions of Go on your system by installing [`goenv`](https://github.com/syndbg/goenv), which reads `.go-version` and automatically selects the correct Go version. -Use Git to clone this repository into a location of your choice. driftctl is using [Go Modules](https://blog.golang.org/using-go-modules), and so you should *not* clone it inside your `GOPATH`. +Use Git to clone this repository into a location of your choice. `driftctl` is using [Go Modules](https://blog.golang.org/using-go-modules), and so you should *not* clone it inside your `GOPATH`. Switch into the root directory of the cloned repository and build driftctl using GNU Make: @@ -100,4 +96,3 @@ git commit -m "go get github.com/hashicorp/terraform@13.0.0" ``` You can then make use of the new or updated dependency in code added in subsequent commits. - diff --git a/.goreleaser.yml b/.goreleaser.yml index 3db5bf584..947f52eb2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +version: 2 project_name: driftctl dist: bin release: @@ -12,7 +14,16 @@ before: signs: - signature: "${artifact}.gpg" artifacts: checksum - args: [ "--batch", "-u", "team-cloud-config+security@snyk.io", "--output", "${signature}", "--detach-sign", "${artifact}" ] + args: + [ + "--batch", + "-u", + "team-cloud-config+security@snyk.io", + "--output", + "${signature}", + "--detach-sign", + "${artifact}", + ] builds: - id: "driftctl" binary: driftctl @@ -27,18 +38,18 @@ builds: - amd64 - arm - arm64 - - 386 + - "386" ldflags: "-s -w -X github.com/snyk/driftctl/build.env={{ .Env.ENV }} -X github.com/snyk/driftctl/pkg/version.version={{ .Tag }}" archives: - name_template: '{{ .ProjectName }}_{{ .Os }}_{{- if eq .Arch "armv6" }}arm{{- else }}{{ .Arch }}{{ end }}' format: binary checksum: - name_template: '{{ .ProjectName }}_SHA256SUMS' + name_template: "{{ .ProjectName }}_SHA256SUMS" algorithm: sha256 snapshot: - name_template: "{{ .Tag }}-next" -blobs: - - provider: s3 - bucket: snyk-assets - region: us-east-1 - folder: "cli/driftctl/{{.Tag}}" + version_template: "{{ .Tag }}-next" +# blobs: +# - provider: s3 +# bucket: snyk-assets +# region: us-east-1 +# directory: "cli/driftctl/{{.Tag}}" From 0ae6b7f31b1d7f1ef4cfb825d19b3e5ecb07c60e Mon Sep 17 00:00:00 2001 From: seth mccombs Date: Fri, 20 Dec 2024 22:03:10 -0800 Subject: [PATCH 2/5] more work --- .github/CONTRIBUTING.md | 2 +- .goreleaser.yml | 8 ++++---- README.md | 9 +-------- scripts/build.sh | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2c7b08eb2..02cf94f6e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -90,7 +90,7 @@ To ensure that the upgrade has worked correctly, be sure to run the unit test su Because dependency changes affect a shared, top-level file, they are more likely than some other change types to become conflicted with other proposed changes during the code review process. For that reason, and to make dependency changes more visible in the change history, we prefer to record dependency changes as separate commits that include only the results of the above commands and the minimal set of changes to driftctl's own code for compatibility with the new version: -``` +```shell script git add go.mod go.sum git commit -m "go get github.com/hashicorp/terraform@13.0.0" ``` diff --git a/.goreleaser.yml b/.goreleaser.yml index 947f52eb2..050eb0caf 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -49,7 +49,7 @@ checksum: snapshot: version_template: "{{ .Tag }}-next" # blobs: -# - provider: s3 -# bucket: snyk-assets -# region: us-east-1 -# directory: "cli/driftctl/{{.Tag}}" +# - provider: s3 +# bucket: snyk-assets +# region: us-east-1 +# directory: "cli/driftctl/{{.Tag}}" diff --git a/README.md b/README.md index 263e4a501..193d2524f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,4 @@ -## This project is now in maintenance mode. We cannot promise to review contributions. Please feel free to fork the project to apply any changes you might want to make. - - - - +## This project is now in maintenance mode. We cannot promise to review contributions. Please feel free to fork the project to apply any changes you might want to make

driftctl @@ -44,7 +40,6 @@ You can't efficiently improve what you don't track. We track coverage for unit t Spot discrepancies as they happen: driftctl is a free and open-source CLI that warns of infrastructure drifts and fills in the missing piece in your DevSecOps toolbox. - ## Features - **Scan** cloud provider and map resources with IaC code @@ -58,8 +53,6 @@ Spot discrepancies as they happen: driftctl is a free and open-source CLI that w **[Installation](https://docs.driftctl.com/installation)** -**[Discord](https://discord.gg/7zHQ8r2PgP)** - ## Contribute To learn more about compiling driftctl and contributing, please refer to the [contribution guidelines](.github/CONTRIBUTING.md) and the [contributing guide](docs/README.md) for technical details. diff --git a/scripts/build.sh b/scripts/build.sh index 4d8e8b731..35673b661 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,7 +17,7 @@ SINGLE_TARGET="${SINGLE_TARGET:-false}" goreleaser check FLAGS="" -FLAGS+="--rm-dist " +FLAGS+="--clean " FLAGS+="--parallelism 2 " CMD="release" From c67c5736acd35d2d182d136875d5eb04c976a746 Mon Sep 17 00:00:00 2001 From: seth mccombs Date: Fri, 20 Dec 2024 22:10:23 -0800 Subject: [PATCH 3/5] more updates to README --- README.md | 60 +++++++++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 193d2524f..b283c74bd 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,34 @@ -## This project is now in maintenance mode. We cannot promise to review contributions. Please feel free to fork the project to apply any changes you might want to make - -

- driftctl -

- -

- - - - - - - - - - - -

- -

- Measures infrastructure as code coverage, and tracks infrastructure drift.
- IaC: Terraform. Cloud providers: AWS, GitHub, Azure, GCP.
- :warning: This tool is still in beta state and will evolve in the future with potential breaking changes :warning: -

- -
- Packaging status - - Packaging status - -
- -## Why driftctl ? +# `driftctl` (fork) + +## This project was forked from `snyk/driftctl` which is now in maintenance mode + +## I ([seth](https://github.com/seth-acuitymd)) am going to see if I can get this project moving again, at least for my own use + +## What is `driftctl`? + +`driftctl` is a tool that measures infrastructure as code coverage, and tracks infrastructure drift from your Terraform code. + +Supports: + +- IaC Providers: + - Terraform +- Cloud Providers: + - AWS + - Azure + - GCP + +_some_ GitHub Support? + +:warning: - No guarantees on this project, I'm just doing this for my own use and hoping it'll pick up steam + +## Why `driftctl` ? Infrastructure drift is a blind spot and a source of potential security issues. Drift can have multiple causes: from team members creating or updating infrastructure through the web console without backporting changes to Terraform, to unexpected actions from authenticated apps and services. You can't efficiently improve what you don't track. We track coverage for unit tests, why not infrastructure as code coverage? -Spot discrepancies as they happen: driftctl is a free and open-source CLI that warns of infrastructure drifts and fills in the missing piece in your DevSecOps toolbox. +Spot discrepancies as they happen: `driftctl` is a free and open-source CLI that warns of infrastructure drifts and fills in the missing piece in your DevSecOps toolbox. ## Features From dfa8786f7cc6a8787f6066f4965e2b2e362abb78 Mon Sep 17 00:00:00 2001 From: seth mccombs Date: Fri, 20 Dec 2024 22:11:15 -0800 Subject: [PATCH 4/5] more updates to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b283c74bd..eaf31f69b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ _some_ GitHub Support? :warning: - No guarantees on this project, I'm just doing this for my own use and hoping it'll pick up steam +--- + +# Legacy README + +## Contents below this are from the original `snyk/driftctl` project and may not be accurate, current, and may be removed at some point + ## Why `driftctl` ? Infrastructure drift is a blind spot and a source of potential security issues. From b0f9f997acd6b1ec956d2373d1a665be984af419 Mon Sep 17 00:00:00 2001 From: seth mccombs Date: Thu, 26 Dec 2024 14:48:31 -0800 Subject: [PATCH 5/5] more README --- .github/CONTRIBUTING.md | 4 ++-- README.md | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 02cf94f6e..1e00c9fed 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -10,9 +10,9 @@ If you wish to work on the driftctl CLI source code, you'll first need to instal - the version control system Git - [GoReleaser](https://goreleaser.com/) -At this time the `driftctl` development environment is targeting only Linux Mac OS X and Windows systems. +At this time the `driftctl` development environment is targeting Linux MacOS, and Windows systems. -Refer to the file [`.go-version`](https://github.com/cloudskiff/driftctl/blob/master/.go-version) to see which version of Go driftctl is currently built with. Other versions will often work, but if you run into any build or testing problems please try with the specific Go version indicated. You can optionally simplify the installation of multiple specific versions of Go on your system by installing [`goenv`](https://github.com/syndbg/goenv), which reads `.go-version` and automatically selects the correct Go version. +Refer to the file [`.go-version`](https://github.com/seth-acuitymd/driftctl/blob/master/.go-version) to see which version of Go driftctl is currently built with. Other versions will often work, but if you run into any build or testing problems please try with the specific Go version indicated. You can optionally simplify the installation of multiple specific versions of Go on your system by installing [`goenv`](https://github.com/syndbg/goenv), which reads `.go-version` and automatically selects the correct Go version. Use Git to clone this repository into a location of your choice. `driftctl` is using [Go Modules](https://blog.golang.org/using-go-modules), and so you should *not* clone it inside your `GOPATH`. diff --git a/README.md b/README.md index eaf31f69b..cd3f82c27 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,11 @@ ## This project was forked from `snyk/driftctl` which is now in maintenance mode -## I ([seth](https://github.com/seth-acuitymd)) am going to see if I can get this project moving again, at least for my own use +I ([seth](https://github.com/seth-acuitymd)) am going to see if I can get this project moving again, at least for my own use + +I have also forked the `driftctl-action`, which is here: [seth-acuitymd/driftctl-action](https://github.com/seth-acuitymd/driftctl-action) + +--- ## What is `driftctl`?