Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds e2e tests for validating webhook #772

Merged
merged 9 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:

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

- name: install kind
run: make install-kind

- name: Run e2e tests
run: make e2e-tests
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ unit-tests:
e2e-tests: build
./scripts/run-e2e.sh

# run e2e validating webhook
e2e-validating-webhook: build
patilpankaj212 marked this conversation as resolved.
Show resolved Hide resolved
./scripts/e2e-validating-webhook.sh

# install kind
install-kind:
./scripts/install-kind.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this script accomodating for multiple OS types? This script currently only cover linux amd64 as of now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not, then we should not include it in makefile atleast

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installing kind is a required step of the validate job in our github pipeline.
also, all are scripts are for linux.


# build terrascan docker image
docker-build:
./scripts/docker-build.sh
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ require (
github.com/spf13/cobra v1.1.1
github.com/zclconf/go-cty v1.7.1
go.uber.org/zap v1.16.0
golang.org/x/mod v0.4.2 // indirect
golang.org/x/sys v0.0.0-20210415045647-66c3f260301c
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744
golang.org/x/tools v0.1.1 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
helm.sh/helm/v3 v3.4.0
honnef.co/go/tools v0.1.3 // indirect
honnef.co/go/tools v0.1.4 // indirect
k8s.io/api v0.19.2
k8s.io/apimachinery v0.19.2
k8s.io/client-go v10.0.0+incompatible
sigs.k8s.io/kustomize/api v0.8.5
)
20 changes: 14 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
Expand Down Expand Up @@ -1065,8 +1066,9 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand All @@ -1083,6 +1085,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1141,10 +1144,14 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210415045647-66c3f260301c h1:6L+uOeS3OQt/f4eFHXZcTxeZrGCuz+CLElgEBjbcTA4=
golang.org/x/sys v0.0.0-20210415045647-66c3f260301c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q=
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -1216,8 +1223,9 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -1374,8 +1382,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
honnef.co/go/tools v0.1.4 h1:SadWOkti5uVN1FAMgxn165+Mw00fuQKyk4Gyn/inxNQ=
honnef.co/go/tools v0.1.4/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
k8s.io/api v0.19.0 h1:XyrFIJqTYZJ2DU7FBE/bSPz7b1HvbVBuBf07oeo6eTc=
k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
k8s.io/apiextensions-apiserver v0.19.2 h1:oG84UwiDsVDu7dlsGQs5GySmQHCzMhknfhFExJMz9tA=
Expand Down
1 change: 1 addition & 0 deletions pkg/http-server/file-scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (

// scanFile accepts uploaded file and runs scan on it
func (g *APIHandler) scanFile(w http.ResponseWriter, r *http.Request) {
zap.S().Info("handle: file scan request")
patilpankaj212 marked this conversation as resolved.
Show resolved Hide resolved

// get url params
params := mux.Vars(r)
Expand Down
3 changes: 3 additions & 0 deletions pkg/http-server/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ package httpserver

import (
"net/http"

"go.uber.org/zap"
)

// Health returns the health of the http server
func (g *APIHandler) Health(w http.ResponseWriter, r *http.Request) {
zap.S().Info("handle: health check request")
w.WriteHeader(http.StatusOK)
}
1 change: 1 addition & 0 deletions pkg/http-server/remote-repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type scanRemoteRepoReq struct {
// scanRemoteRepo downloads the remote Iac repository and scans it for
// violations
func (g *APIHandler) scanRemoteRepo(w http.ResponseWriter, r *http.Request) {
zap.S().Info("handle: remote repository scan request")

// get url params
params := mux.Vars(r)
Expand Down
2 changes: 2 additions & 0 deletions pkg/http-server/webhook-scan-logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type webhookDisplayedShowLog struct {
}

func (g *APIHandler) getLogs(w http.ResponseWriter, r *http.Request) {
zap.S().Info("handle: validating webhook's get logs request")

if !config.GetK8sAdmissionControl().Dashboard {
apiErrorResponse(w, ErrDashboardDisabled.Error(), http.StatusBadRequest)
Expand Down Expand Up @@ -134,6 +135,7 @@ func (g *APIHandler) getLogs(w http.ResponseWriter, r *http.Request) {
}

func (g *APIHandler) getLogByUID(w http.ResponseWriter, r *http.Request) {
zap.S().Info("handle: validating webhook's get log by uid request")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to make this Debug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zap.S().Info("handle: validating webhook's get log by uid request")
zap.S().Debug("handle: validating webhook's get log by uid request")


if !config.GetK8sAdmissionControl().Dashboard {
apiErrorResponse(w, ErrDashboardDisabled.Error(), http.StatusBadRequest)
Expand Down
1 change: 1 addition & 0 deletions pkg/http-server/webhook-scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

// validateK8SWebhook handles the incoming validating admission webhook from kubernetes API server
func (g *APIHandler) validateK8SWebhook(w http.ResponseWriter, r *http.Request) {
zap.S().Info("handle: validating webhook request")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly feel this should be logged in debug mode level and not in info

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, for logging in the incoming requests, we should work on #784

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is an informational log and hence to be logged in info.
Also, I had a discussion with @kanchwala-yusuf that we should handle it in separate PR. And, any other logging related changes can be taken up with #784.


var (
params = mux.Vars(r)
Expand Down
9 changes: 9 additions & 0 deletions scripts/e2e-validating-webhook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

export TERRASCAN_BIN_PATH=${PWD}/bin/terrascan

go test -p 1 -v ./test/e2e/validatingwebhook/...
7 changes: 7 additions & 0 deletions scripts/install-kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# install kind
sudo curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-amd64
sudo chmod 755 ./kind
sudo mv ./kind /usr/local/bin
sudo chown -R $USER /usr/local/bin/kind
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Scan Summary -
File/Folder : /Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation
IaC Type : k8s
Scanned At : 2021-03-02 15:51:59.060974 +0000 UTC
Policies Validated : 7
Policies Validated : 8
Violated Policies : 1
Low : 0
Medium : 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Scan Summary -
File/Folder : /Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation
IaC Type : k8s
Scanned At : 2021-03-02 15:52:18.820415 +0000 UTC
Policies Validated : 7
Policies Validated : 8
Violated Policies : 1
Low : 0
Medium : 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation",
"iac_type": "k8s",
"scanned_at": "2021-03-02 15:52:42.748543 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 1,
"low": 0,
"medium": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<testsuites tests="7" name="TERRASCAN_POLICY_SUITES" failures="1" time="0">
<testsuite tests="7" failures="1" time="0" name="TERRASCAN_POLICY_SUITE" package="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation">
<testsuites tests="8" name="TERRASCAN_POLICY_SUITES" failures="1" time="0">
<testsuite tests="8" failures="1" time="0" name="TERRASCAN_POLICY_SUITE" package="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation">
<properties>
<property name="Terrascan Version" value="v1.3.3"></property>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<violation rule_name="noHttps" description="TLS disabled can affect the confidentiality of the data in transit" rule_id="AC-K8-NS-IN-H-0020" severity="HIGH" category="Network Security" resource_name="ingress-demo-disallowed" resource_type="kubernetes_ingress" file="config.yaml" line="1"></violation>
</violations>
<skipped_violations></skipped_violations>
<scan_summary file_folder="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation" iac_type="k8s" scanned_at="2021-03-02 15:53:11.130276 +0000 UTC" policies_validated="7" violated_policies="1" low="0" medium="0" high="1"></scan_summary>
<scan_summary file_folder="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation" iac_type="k8s" scanned_at="2021-03-02 15:53:11.130276 +0000 UTC" policies_validated="8" violated_policies="1" low="0" medium="0" high="1"></scan_summary>
</results>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ results:
file/folder: /Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/k8s/kubernetes_ingress_violation
iac_type: k8s
scanned_at: 2021-03-02 15:53:30.996294 +0000 UTC
policies_validated: 7
policies_validated: 8
violated_policies: 1
low: 0
medium: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/resource_skipping/kubernetes",
"iac_type": "k8s",
"scanned_at": "2021-03-02 16:01:16.973652 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 0,
"low": 0,
"medium": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/resource_skipping/terraform",
"iac_type": "terraform",
"scanned_at": "2021-03-02 16:00:46.95002 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 11,
"low": 0,
"medium": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_db_instance_violation",
"iac_type": "terraform",
"scanned_at": "2021-03-02 15:59:24.626711 +0000 UTC",
"policies_validated": 4,
"policies_validated": 5,
"violated_policies": 1,
"low": 0,
"medium": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_db_instance_violation",
"iac_type": "terraform",
"scanned_at": "2021-03-02 13:53:14.255721 +0000 UTC",
"policies_validated": 6,
"policies_validated": 7,
"violated_policies": 8,
"low": 0,
"medium": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Scan Summary -
File/Folder : /Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation
IaC Type : terraform
Scanned At : 2021-03-02 15:45:17.636568 +0000 UTC
Policies Validated : 7
Policies Validated : 8
Violated Policies : 1
Low : 0
Medium : 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Scan Summary -
File/Folder : /Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation
IaC Type : terraform
Scanned At : 2021-03-02 15:45:36.980596 +0000 UTC
Policies Validated : 7
Policies Validated : 8
Violated Policies : 1
Low : 0
Medium : 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation",
"iac_type": "terraform",
"scanned_at": "2021-03-02 15:45:55.603722 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 1,
"low": 0,
"medium": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation",
"iac_type": "all",
"scanned_at": "2021-03-02 15:45:55.603722 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 1,
"low": 0,
"medium": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"file/folder": "/Users/pankajpatil/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/terraform_recursive",
"iac_type": "terraform",
"scanned_at": "2021-04-18 12:45:51.597994 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 1,
"low": 0,
"medium": 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<testsuites tests="7" name="TERRASCAN_POLICY_SUITES" failures="1" time="0">
<testsuite tests="7" failures="1" time="0" name="TERRASCAN_POLICY_SUITE" package="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation">
<testsuites tests="8" name="TERRASCAN_POLICY_SUITES" failures="1" time="0">
<testsuite tests="8" failures="1" time="0" name="TERRASCAN_POLICY_SUITE" package="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation">
<properties>
<property name="Terrascan Version" value="v1.3.3"></property>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<violation rule_name="amiNotEncrypted" description="Enable AWS AMI Encryption" rule_id="AWS.EC2.Encryption&amp;KeyManagement.Medium.0688" severity="MEDIUM" category="Encryption &amp; KeyManagement" resource_name="awsAmiEncrypted" resource_type="aws_ami" file="main.tf" plan_root="./" line="5"></violation>
</violations>
<skipped_violations></skipped_violations>
<scan_summary file_folder="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation" iac_type="terraform" scanned_at="2021-03-02 15:46:23.06028 +0000 UTC" policies_validated="7" violated_policies="1" low="0" medium="1" high="0"></scan_summary>
<scan_summary file_folder="/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation" iac_type="terraform" scanned_at="2021-03-02 15:46:23.06028 +0000 UTC" policies_validated="8" violated_policies="1" low="0" medium="1" high="0"></scan_summary>
</results>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ results:
file/folder: /Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_ami_violation
iac_type: terraform
scanned_at: 2021-03-02 15:46:38.259501 +0000 UTC
policies_validated: 7
policies_validated: 8
violated_policies: 1
low: 0
medium: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/aws/aws_db_instance_violation",
"iac_type": "terraform",
"scanned_at": "2021-03-02 15:48:06.923537 +0000 UTC",
"policies_validated": 7,
"policies_validated": 8,
"violated_policies": 14,
"low": 0,
"medium": 0,
Expand Down