diff --git a/_examples/1818/main.tf b/_examples/1818/main.tf new file mode 100644 index 0000000000..e1708eadf4 --- /dev/null +++ b/_examples/1818/main.tf @@ -0,0 +1,16 @@ +locals { + bucket_id = aws_s3_bucket.test[0].id +} + +resource "aws_s3_bucket" "test" { + count = 1 + bucket_prefix = "test_" +} + +resource "aws_s3_bucket_public_access_block" "deny_public_access" { + bucket = local.bucket_id + + block_public_acls = true + block_public_policy = true + restrict_public_buckets = true +} \ No newline at end of file diff --git a/go.mod b/go.mod index 0d035f4cc0..8bc0fc7ec4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/AlecAivazis/survey/v2 v2.3.5 github.com/Masterminds/semver v1.5.0 - github.com/aquasecurity/defsec v0.68.2 + github.com/aquasecurity/defsec v0.68.7-0.20220706123503-b135e75ee122 github.com/google/uuid v1.3.0 github.com/hashicorp/go-version v1.5.0 github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf @@ -47,7 +47,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/googleapis/gax-go/v2 v2.1.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.6.1 // indirect + github.com/hashicorp/go-getter v1.6.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/hcl/v2 v2.12.0 // indirect diff --git a/go.sum b/go.sum index 47199bf515..71587e1252 100644 --- a/go.sum +++ b/go.sum @@ -142,8 +142,8 @@ github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:o github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/aquasecurity/defsec v0.68.2 h1:ooD2JqaovHGq7s0bDmJdMGMrRIQcyCtQVEvtPLbRVIw= -github.com/aquasecurity/defsec v0.68.2/go.mod h1:xUmN8mHLF2RCITp9v6HH+vkqfnfAX6BsIC5pbCwzg9k= +github.com/aquasecurity/defsec v0.68.7-0.20220706123503-b135e75ee122 h1:hSs7CWPr3nzv2zahAWq+YLewrhEvViwcIWSpHrj7Fmw= +github.com/aquasecurity/defsec v0.68.7-0.20220706123503-b135e75ee122/go.mod h1:m59o8MPMXFbMgulxFOvFRW8tVg4gcnqZ9Gi3uvd/6zg= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -631,8 +631,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.6.1 h1:NASsgP4q6tL94WH6nJxKWj8As2H/2kop/bB1d8JMyRY= -github.com/hashicorp/go-getter v1.6.1/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= +github.com/hashicorp/go-getter v1.6.2 h1:7jX7xcB+uVCliddZgeKyNxv0xoT7qL5KDtH7rU4IqIk= +github.com/hashicorp/go-getter v1.6.2/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= diff --git a/internal/app/tfsec/cmd/root.go b/internal/app/tfsec/cmd/root.go index e3fc2c7cc9..f82f224bc6 100644 --- a/internal/app/tfsec/cmd/root.go +++ b/internal/app/tfsec/cmd/root.go @@ -94,8 +94,7 @@ func Root() *cobra.Command { for _, result := range results { statistics = executor.AddStatisticsCount(statistics, result) } - statistics.PrintStatisticsTable(cmd.ErrOrStderr()) - return nil + return statistics.PrintStatisticsTable("lovely", cmd.ErrOrStderr()) } exitCode := getDetailedExitCode(metrics)