Skip to content

Commit

Permalink
feat(logs): added debug log messages (#5192)
Browse files Browse the repository at this point in the history
* added debug log messages

* removing space

* requested changes

* updated doc

* requested changes

* added more log infos

* requested changes
  • Loading branch information
rafaela-soares authored Apr 18, 2022
1 parent 812f3fd commit ccb2f00
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 59 deletions.
76 changes: 38 additions & 38 deletions docs/bom.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,43 +190,43 @@ Results will be found in the [JSON](results.md) output and placed separately und
{
// etc...
"bill_of_materials": [
{
"query_name": "BOM - AWS S3 Buckets",
"query_id": "b5d6a2e0-8f15-4664-bd5b-68ec5c9bab83",
"query_url": "https://kics.io",
"severity": "TRACE",
"platform": "CloudFormation",
"cloud_provider": "AWS",
"category": "Bill Of Materials",
"description": "A list of S3 resources found. Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
"description_id": "a46851fb",
"files": [
{
"file_name": "positive2.json",
"similarity_id": "a307e0f377932f42880de350fc69f83084aa8451a2e1e2a37cc97fc4eae7cf94",
"line": 5,
"issue_type": "BillOfMaterials",
"search_key": "Resources.JenkinsArtifacts03",
"search_line": 0,
"search_value": "",
"expected_value": "",
"actual_value": "",
"value": "{\"acl\":\"BucketOwnerFullControl\",\"resource_accessibility\":\"BucketOwnerFullControl\",\"resource_category\":\"Storage\",\"resource_encryption\":\"unencrypted\",\"resource_name\":\"jenkins-artifacts\",\"resource_type\":\"AWS::S3::Bucket\",\"resource_vendor\":\"AWS\"}"
},
{
"file_name": "positive1.yaml",
"similarity_id": "24a0036d2e94676f33c505c5cfd6686ef414072a14e576b08283e9a77596f7eb",
"line": 4,
"issue_type": "BillOfMaterials",
"search_key": "Resources.MyBucket",
"search_line": 0,
"search_value": "",
"expected_value": "",
"actual_value": "",
"value": "{\"acl\":\"BucketOwnerFullControl\",\"policy\":{\"Statement\":[{\"Action\":[\"s3:GetObject\"],\"Condition\":{\"StringLike\":{\"aws:Referer\":[\"http://www.example.com/*\",\"http://example.net/*\"]}},\"Effect\":\"Allow\",\"Principal\":\"*\",\"Resource\":[\"\",{\"playbooks\":[\"arn:aws:s3:::\",\"DOC-EXAMPLE-BUCKET\",\"/*\"]}]}],\"Version\":\"2012-10-17\"},\"resource_accessibility\":\"hasPolicy\",\"resource_category\":\"Storage\",\"resource_encryption\":\"encrypted\",\"resource_name\":\"jenkins-artifacts\",\"resource_type\":\"AWS::S3::Bucket\",\"resource_vendor\":\"AWS\"}"
}
]
}
]
{
"query_name": "BOM - AWS S3 Buckets",
"query_id": "b5d6a2e0-8f15-4664-bd5b-68ec5c9bab83",
"query_url": "https://kics.io",
"severity": "TRACE",
"platform": "CloudFormation",
"cloud_provider": "AWS",
"category": "Bill Of Materials",
"description": "A list of S3 resources found. Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
"description_id": "a46851fb",
"files": [
{
"file_name": "positive2.json",
"similarity_id": "a307e0f377932f42880de350fc69f83084aa8451a2e1e2a37cc97fc4eae7cf94",
"line": 5,
"issue_type": "BillOfMaterials",
"search_key": "Resources.JenkinsArtifacts03",
"search_line": 0,
"search_value": "",
"expected_value": "",
"actual_value": "",
"value": "{\"acl\":\"BucketOwnerFullControl\",\"resource_accessibility\":\"unknown\",\"resource_category\":\"Storage\",\"resource_encryption\":\"unencrypted\",\"resource_name\":\"jenkins-artifacts\",\"resource_type\":\"AWS::S3::Bucket\",\"resource_vendor\":\"AWS\"}"
},
{
"file_name": "positive1.yaml",
"similarity_id": "24a0036d2e94676f33c505c5cfd6686ef414072a14e576b08283e9a77596f7eb",
"line": 4,
"issue_type": "BillOfMaterials",
"search_key": "Resources.MyBucket",
"search_line": 0,
"search_value": "",
"expected_value": "",
"actual_value": "",
"value": "{\"acl\":\"BucketOwnerFullControl\",\"policy\":{\"Statement\":[{\"Action\":[\"s3:GetObject\"],\"Condition\":{\"StringLike\":{\"aws:Referer\":[\"http://www.example.com/*\",\"http://example.net/*\"]}},\"Effect\":\"Allow\",\"Principal\":\"*\",\"Resource\":[\"\",{\"playbooks\":[\"arn:aws:s3:::\",\"DOC-EXAMPLE-BUCKET\",\"/*\"]}]}],\"Version\":\"2012-10-17\"},\"resource_accessibility\":\"hasPolicy\",\"resource_category\":\"Storage\",\"resource_encryption\":\"encrypted\",\"resource_name\":\"jenkins-artifacts\",\"resource_type\":\"AWS::S3::Bucket\",\"resource_vendor\":\"AWS\"}"
}
]
}
]
}
```
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.16
require (
cloud.google.com/go/iam v0.3.0 // indirect
cloud.google.com/go/monitoring v1.2.0 // indirect
code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5
github.com/BurntSushi/toml v1.1.0
github.com/GoogleCloudPlatform/terraformer v0.8.18
github.com/agnivade/levenshtein v1.1.1
Expand All @@ -24,10 +25,12 @@ require (
github.com/hashicorp/hcl/v2 v2.11.1
github.com/hashicorp/terraform-json v0.13.0
github.com/johnfercher/maroto v0.36.1
github.com/mackerelio/go-osstat v0.2.2
github.com/mailru/easyjson v0.7.7
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/buildkit v0.10.1
github.com/open-policy-agent/opa v0.39.0
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.26.1
github.com/sosedoff/ansible-vault-go v0.1.1
Expand Down
Loading

0 comments on commit ccb2f00

Please sign in to comment.