Skip to content

Commit

Permalink
fix: Treat numbers in string attributes as numbers if required (#1820)
Browse files Browse the repository at this point in the history
* fix: Treat numbers in string attributes as numbers if required

Resolves #1818

Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
  • Loading branch information
Owen Rumney committed Jul 6, 2022
1 parent 0bd1e69 commit 377240c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
16 changes: 16 additions & 0 deletions _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
}
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
3 changes: 1 addition & 2 deletions internal/app/tfsec/cmd/root.go
Expand Up @@ -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)
Expand Down

0 comments on commit 377240c

Please sign in to comment.