From 3c6b2db919d5066fc3af04d0eace06880ada43f5 Mon Sep 17 00:00:00 2001 From: Petter Solberg Date: Fri, 10 Sep 2021 14:10:09 +0200 Subject: [PATCH 01/12] fix: Fixed Docker build not working Building the docker image does currently not work because go.mod does not exist. By running: `docker build -t kubescape -f build/Dockerfile .` It fails: ``` Step 7/10 : RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w " -installsuffix cgo -o kubescape . ---> Running in 3e7d4a124446 cautils/k8sinterface/cloudvendorregistrycreds.go:14:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws (imported by github.com/armosec/kubescape/cautils/k8sinterface); to add: go get github.com/armosec/kubescape/cautils/k8sinterface cautils/k8sinterface/cloudvendorregistrycreds.go:15:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws/session (imported by github.com/armosec/kubescape/cautils/k8sinterface); to add: go get github.com/armosec/kubescape/cautils/k8sinterface ... ``` By changing mod download to go mod tidy, it creates go.sum and the docker build works. --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index d54d28a1..008bc618 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -4,7 +4,7 @@ ENV GO111MODULE=on WORKDIR /work ADD . . -RUN go mod download +RUN go mod tidy RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w " -installsuffix cgo -o kubescape . FROM alpine From d3137af3d75d89f7a3e96f2fd2faf47966f56778 Mon Sep 17 00:00:00 2001 From: David Wertenteil <64066841+dwertent@users.noreply.github.com> Date: Sun, 12 Sep 2021 17:36:23 +0300 Subject: [PATCH 02/12] skip score updating --- opaprocessor/processorhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opaprocessor/processorhandler.go b/opaprocessor/processorhandler.go index 3be0c4ca..e646667c 100644 --- a/opaprocessor/processorhandler.go +++ b/opaprocessor/processorhandler.go @@ -70,7 +70,7 @@ func (opaHandler *OPAProcessorHandler) ProcessRulesListenner() { opap.updateResults() // update score - opap.updateScore() + // opap.updateScore() // report *opaHandler.reportResults <- opaSessionObj From aad32ec965887f7ebfd3316cf8711daadc893f52 Mon Sep 17 00:00:00 2001 From: "lalafi@cyberarmor.io" Date: Sun, 12 Sep 2021 18:43:45 +0300 Subject: [PATCH 03/12] added controlID --- cautils/opapolicy/datastructures.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cautils/opapolicy/datastructures.go b/cautils/opapolicy/datastructures.go index a74163c5..594fd181 100644 --- a/cautils/opapolicy/datastructures.go +++ b/cautils/opapolicy/datastructures.go @@ -41,6 +41,7 @@ type FrameworkReport struct { } type ControlReport struct { armotypes.PortalBase `json:",inline"` + ControlID string `json:"id"` Name string `json:"name"` RuleReports []RuleReport `json:"ruleReports"` Remediation string `json:"remediation"` @@ -100,10 +101,12 @@ type PolicyRule struct { // Control represents a collection of rules which are combined together to single purpose type Control struct { armotypes.PortalBase `json:",inline"` - CreationTime string `json:"creationTime"` - Description string `json:"description"` - Remediation string `json:"remediation"` - Rules []PolicyRule `json:"rules"` + ControlID string `json:"id"` + + CreationTime string `json:"creationTime"` + Description string `json:"description"` + Remediation string `json:"remediation"` + Rules []PolicyRule `json:"rules"` // for new list of rules in POST/UPADTE requests RulesIDs *[]string `json:"rulesIDs,omitempty"` } From 2ceb5150e2472de4798f47dc54178d6fb7babe51 Mon Sep 17 00:00:00 2001 From: "lalafi@cyberarmor.io" Date: Sun, 12 Sep 2021 19:28:11 +0300 Subject: [PATCH 04/12] adding control id --- cautils/opapolicy/datastructures_mock.go | 3 ++- opaprocessor/processorhandler.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cautils/opapolicy/datastructures_mock.go b/cautils/opapolicy/datastructures_mock.go index afe9ae63..e1632531 100644 --- a/cautils/opapolicy/datastructures_mock.go +++ b/cautils/opapolicy/datastructures_mock.go @@ -33,7 +33,8 @@ func MockFrameworkReportA() *FrameworkReport { Name: AMockFrameworkName, ControlReports: []ControlReport{ { - Name: AMockControlName, + ControlID: "testctrl", + Name: AMockControlName, RuleReports: []RuleReport{ { Name: AMockRuleName, diff --git a/opaprocessor/processorhandler.go b/opaprocessor/processorhandler.go index e646667c..efa2ed6b 100644 --- a/opaprocessor/processorhandler.go +++ b/opaprocessor/processorhandler.go @@ -121,6 +121,7 @@ func (opap *OPAProcessor) processControl(control *opapolicy.Control) (*opapolicy controlReport := opapolicy.ControlReport{} controlReport.PortalBase = control.PortalBase + controlReport.ControlID = control.ControlID controlReport.Name = control.Name controlReport.Description = control.Description From 4d68ca6aa2f87889ad6a8830cba16751699e948e Mon Sep 17 00:00:00 2001 From: dwertent Date: Mon, 13 Sep 2021 10:24:24 +0300 Subject: [PATCH 05/12] update exceptions support --- README.md | 1 + cautils/getter/armoapiutils.go | 6 +++--- cmd/framework.go | 2 +- install.sh | 8 ++++---- policyhandler/handlepullpolicies.go | 3 ++- scapepkg/exceptions/exceptionprocessor.go | 7 ++++--- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e7eea53b..86c7516a 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ If you wish to scan all namespaces in your cluster, remove the `--exclude-namesp | `--use-from` | | Load local framework object from specified path. If not used will download latest | | `--use-default` | `false` | Load local framework object from default path. If not used will download latest | `true`/`false` | | `--exceptions` | | Path to an [exceptions obj](examples/exceptions.json) | +| `--results-locally` | | Kubescape sends scan results to Armosec backend to allow users to control exceptions and maintain chronological scan results. Use this flag if you do not wish to use these features | ## Usage & Examples diff --git a/cautils/getter/armoapiutils.go b/cautils/getter/armoapiutils.go index 30bbdafc..d54264fd 100644 --- a/cautils/getter/armoapiutils.go +++ b/cautils/getter/armoapiutils.go @@ -27,9 +27,9 @@ func (armoAPI *ArmoAPI) getExceptionsURL(customerGUID, clusterName string) strin q := u.Query() q.Add("customerGUID", customerGUID) - if clusterName != "" { - q.Add("clusterName", clusterName) - } + // if clusterName != "" { // TODO - fix customer name support in Armo BE + // q.Add("clusterName", clusterName) + // } u.RawQuery = q.Encode() return u.String() diff --git a/cmd/framework.go b/cmd/framework.go index 50bad405..1487e0fa 100644 --- a/cmd/framework.go +++ b/cmd/framework.go @@ -94,7 +94,7 @@ func init() { frameworkCmd.Flags().StringVarP(&scanInfo.Output, "output", "o", "", "Output file. print output to file and not stdout") frameworkCmd.Flags().BoolVarP(&scanInfo.Silent, "silent", "s", false, "Silent progress messages") frameworkCmd.Flags().Uint16VarP(&scanInfo.FailThreshold, "fail-threshold", "t", 0, "Failure threshold is the percent bellow which the command fails and returns exit code -1") - frameworkCmd.Flags().BoolVarP(&scanInfo.DoNotSendResults, "results-locally", "", false, "Kubescape sends scan results to its backend to allow users to control exceptions and maintain chronological scan results. Use –results-locally if you do not wish to use these features") + frameworkCmd.Flags().BoolVarP(&scanInfo.DoNotSendResults, "results-locally", "", false, "Kubescape sends scan results to Armosec backend to allow users to control exceptions and maintain chronological scan results. Use this flag if you do not wish to use these features") } func CliSetup() error { diff --git a/install.sh b/install.sh index c2bc2765..ff6d5d20 100755 --- a/install.sh +++ b/install.sh @@ -32,12 +32,12 @@ echo -e "\033[32m[V] Downloaded Kubescape" # Ping download counter curl --silent https://us-central1-elated-pottery-310110.cloudfunctions.net/kubescape-download-counter -o /dev/null -chmod +x $OUTPUT || sudo chmod +x $OUTPUT -rm -f /usr/local/bin/$KUBESCAPE_EXEC || sudo rm -f /usr/local/bin/$KUBESCAPE_EXEC -cp $OUTPUT /usr/local/bin || sudo cp $OUTPUT /usr/local/bin +chmod +x $OUTPUT 2>&1 || sudo chmod +x $OUTPUT +rm -f /usr/local/bin/$KUBESCAPE_EXEC 2>&1 || sudo rm -f /usr/local/bin/$KUBESCAPE_EXEC +cp $OUTPUT /usr/local/bin 2>&1 || sudo cp $OUTPUT /usr/local/bin rm -rf $OUTPUT -echo -e "[V] Finished Installation" +echo -e "[V] Finished Installation." $($KUBESCAPE_EXEC version) echo echo -e "\033[35m Usage: $ $KUBESCAPE_EXEC scan framework nsa --exclude-namespaces kube-system,kube-public" diff --git a/policyhandler/handlepullpolicies.go b/policyhandler/handlepullpolicies.go index 56afabb6..c82cbd8c 100644 --- a/policyhandler/handlepullpolicies.go +++ b/policyhandler/handlepullpolicies.go @@ -3,6 +3,7 @@ package policyhandler import ( "fmt" + "github.com/armosec/kubescape/cautils" "github.com/armosec/kubescape/cautils/armotypes" "github.com/armosec/kubescape/cautils/opapolicy" ) @@ -41,7 +42,7 @@ func (policyHandler *PolicyHandler) getFrameworkPolicies(policyName string) (*op return nil, nil, err } - receivedException, err := policyHandler.getters.ExceptionsGetter.GetExceptions("", "") + receivedException, err := policyHandler.getters.ExceptionsGetter.GetExceptions(cautils.CustomerGUID, cautils.ClusterName) if err != nil { return receivedFramework, nil, err } diff --git a/scapepkg/exceptions/exceptionprocessor.go b/scapepkg/exceptions/exceptionprocessor.go index 2c29688a..45cf7b4b 100644 --- a/scapepkg/exceptions/exceptionprocessor.go +++ b/scapepkg/exceptions/exceptionprocessor.go @@ -1,6 +1,7 @@ package exceptions import ( + "github.com/armosec/kubescape/cautils" "github.com/armosec/kubescape/cautils/k8sinterface" "github.com/armosec/kubescape/cautils/armotypes" @@ -91,9 +92,9 @@ func hasException(designator *armotypes.PortalDesignator, workload k8sinterface. return false // if designators are empty } - // if cluster != "" && cluster != ClusterName { // TODO - where do we receive cluster name from? - // return false // cluster name does not match - // } + if cluster != "" && cautils.ClusterName != "" && cluster != cautils.ClusterName { // TODO - where do we receive cluster name from? + return false // cluster name does not match + } if namespace != "" && !compareNamespace(workload, namespace) { return false // namespaces do not match From a3ce04b7e868de53453ecfe947faa8c0f17a6668 Mon Sep 17 00:00:00 2001 From: dwertent Date: Mon, 13 Sep 2021 10:47:29 +0300 Subject: [PATCH 06/12] update install script --- README.md | 4 ++-- install.sh | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 86c7516a..255acc33 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ If you wish to scan all namespaces in your cluster, remove the `--exclude-namesp | `-o`/`--output` | print to stdout | Save scan result in file | | `--use-from` | | Load local framework object from specified path. If not used will download latest | | `--use-default` | `false` | Load local framework object from default path. If not used will download latest | `true`/`false` | -| `--exceptions` | | Path to an [exceptions obj](examples/exceptions.json) | -| `--results-locally` | | Kubescape sends scan results to Armosec backend to allow users to control exceptions and maintain chronological scan results. Use this flag if you do not wish to use these features | +| `--exceptions` | | Path to an [exceptions obj](examples/exceptions.json). If not set will download exceptions from Armo management portal | +| `--results-locally` | `false` | Kubescape sends scan results to Armo management portal to allow users to control exceptions and maintain chronological scan results. Use this flag if you do not wish to use these features | `true`/`false`| ## Usage & Examples diff --git a/install.sh b/install.sh index ff6d5d20..4f630a76 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -echo "Installing Kubescape..." +echo -e "\033[0;36mInstalling Kubescape..." echo BASE_DIR=~/.kubescape @@ -27,18 +27,22 @@ mkdir -p $BASE_DIR OUTPUT=$BASE_DIR/$KUBESCAPE_EXEC curl --progress-bar -L $DOWNLOAD_URL -o $OUTPUT -echo -e "\033[32m[V] Downloaded Kubescape" # Ping download counter curl --silent https://us-central1-elated-pottery-310110.cloudfunctions.net/kubescape-download-counter -o /dev/null -chmod +x $OUTPUT 2>&1 || sudo chmod +x $OUTPUT -rm -f /usr/local/bin/$KUBESCAPE_EXEC 2>&1 || sudo rm -f /usr/local/bin/$KUBESCAPE_EXEC -cp $OUTPUT /usr/local/bin 2>&1 || sudo cp $OUTPUT /usr/local/bin +chmod +x $OUTPUT 2>/dev/null || sudo chmod +x $OUTPUT +rm -f /usr/local/bin/$KUBESCAPE_EXEC 2>/dev/null || sudo rm -f /usr/local/bin/$KUBESCAPE_EXEC +cp $OUTPUT /usr/local/bin 2>/dev/null || sudo cp $OUTPUT /usr/local/bin rm -rf $OUTPUT -echo -e "[V] Finished Installation." $($KUBESCAPE_EXEC version) +echo +echo -e "\033[32mFinished Installation." + +echo -e "\033[0m" +$KUBESCAPE_EXEC version echo -echo -e "\033[35m Usage: $ $KUBESCAPE_EXEC scan framework nsa --exclude-namespaces kube-system,kube-public" -echo +echo -e "\033[35mUsage: $ $KUBESCAPE_EXEC scan framework nsa --exclude-namespaces kube-system,kube-public" + +echo -e "\033[0m" \ No newline at end of file From 1440f20f95cbec6c6638f968044cfd23ea2a9838 Mon Sep 17 00:00:00 2001 From: dwertent Date: Mon, 13 Sep 2021 11:01:49 +0300 Subject: [PATCH 07/12] merged from master --- opaprocessor/processorhandler.go | 1 - 1 file changed, 1 deletion(-) diff --git a/opaprocessor/processorhandler.go b/opaprocessor/processorhandler.go index bcbf71be..b2546ab8 100644 --- a/opaprocessor/processorhandler.go +++ b/opaprocessor/processorhandler.go @@ -126,7 +126,6 @@ func (opap *OPAProcessor) processControl(control *opapolicy.Control) (*opapolicy controlReport.ControlID = control.ControlID controlReport.Name = control.Name - controlReport.ID = control.ID controlReport.Description = control.Description controlReport.Remediation = control.Remediation From 2b976489a221b86d01d27d9caca9b450b7943de9 Mon Sep 17 00:00:00 2001 From: dwertent Date: Mon, 13 Sep 2021 11:21:57 +0300 Subject: [PATCH 08/12] handle download framework error --- cautils/getter/downloadreleasedpolicy.go | 7 +++++-- policyhandler/handlepullpolicies.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cautils/getter/downloadreleasedpolicy.go b/cautils/getter/downloadreleasedpolicy.go index 4f9f3e8a..6853e77a 100644 --- a/cautils/getter/downloadreleasedpolicy.go +++ b/cautils/getter/downloadreleasedpolicy.go @@ -27,7 +27,9 @@ func NewDownloadReleasedPolicy() *DownloadReleasedPolicy { } func (drp *DownloadReleasedPolicy) GetFramework(name string) (*opapolicy.Framework, error) { - drp.setURL(name) + if err := drp.setURL(name); err != nil { + return nil, err + } respStr, err := HttpGetter(drp.httpClient, drp.hostURL) if err != nil { return nil, err @@ -71,12 +73,13 @@ func (drp *DownloadReleasedPolicy) setURL(frameworkName string) error { if name == frameworkName { if url, ok := asset["browser_download_url"].(string); ok { drp.hostURL = url + return nil } } } } } } - return nil + return fmt.Errorf("failed to download '%s' - not found", frameworkName) } diff --git a/policyhandler/handlepullpolicies.go b/policyhandler/handlepullpolicies.go index c82cbd8c..5d335ac2 100644 --- a/policyhandler/handlepullpolicies.go +++ b/policyhandler/handlepullpolicies.go @@ -19,7 +19,7 @@ func (policyHandler *PolicyHandler) GetPoliciesFromBackend(notification *opapoli case opapolicy.KindFramework: receivedFramework, recExceptionPolicies, err := policyHandler.getFrameworkPolicies(rule.Name) if err != nil { - errs = fmt.Errorf("%v\nKind: %v, Name: %s, error: %s", errs, rule.Kind, rule.Name, err.Error()) + return nil, nil, fmt.Errorf("kind: %v, name: %s, error: %s", rule.Kind, rule.Name, err.Error()) } if receivedFramework != nil { frameworks = append(frameworks, *receivedFramework) From 4f71fe0d55bc77b96251eae551c3fca0aeef8b1b Mon Sep 17 00:00:00 2001 From: Bezalel Brandwine Date: Mon, 13 Sep 2021 14:25:09 +0300 Subject: [PATCH 09/12] support rerun on the same cluster flows --- cautils/customerloader.go | 35 ++++++++++++++++++++++++++--------- cautils/getter/armoapi.go | 16 +++++++++++----- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/cautils/customerloader.go b/cautils/customerloader.go index cc9821a4..053217c7 100644 --- a/cautils/customerloader.go +++ b/cautils/customerloader.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "net/url" "os" + "strings" "github.com/armosec/kubescape/cautils/getter" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -21,8 +22,9 @@ const ( ) type ConfigObj struct { - CustomerGUID string `json:"customerGUID"` - Token string `json:"token"` + CustomerGUID string `json:"customerGUID"` + Token string `json:"token"` + CustomerAdminEMail string `json:"adminMail"` } func (co *ConfigObj) Json() []byte { @@ -79,6 +81,11 @@ func (c *ClusterConfig) GenerateURL() { u := url.URL{} u.Scheme = "https" u.Host = getter.ArmoFEURL + if c.configObj.CustomerAdminEMail != "" { + msgStr := fmt.Sprintf("To view all controls and get remediations ask access permissions to %s from %s", u.String(), c.configObj.CustomerAdminEMail) + InfoTextDisplay(os.Stdout, msgStr+"\n") + return + } u.Path = "account/sign-up" q := u.Query() q.Add("invitationToken", c.configObj.Token) @@ -91,30 +98,40 @@ func (c *ClusterConfig) GenerateURL() { } func (c *ClusterConfig) GetCustomerGUID() string { - return c.configObj.CustomerGUID + if c.configObj != nil { + return c.configObj.CustomerGUID + } + return "" } func (c *ClusterConfig) SetCustomerGUID() error { // get from configMap if configObj, _ := c.loadConfigFromConfigMap(); configObj != nil { c.update(configObj) - return nil } // get from file if configObj, _ := c.loadConfigFromFile(); configObj != nil { c.update(configObj) c.updateConfigMap() - return nil } - + customerGUID := c.GetCustomerGUID() // get from armoBE - if tenantResponse, err := c.armoAPI.GetCustomerGUID(); tenantResponse != nil { - c.update(&ConfigObj{CustomerGUID: tenantResponse.TenantID, Token: tenantResponse.Token}) - return c.updateConfigMap() + tenantResponse, err := c.armoAPI.GetCustomerGUID(customerGUID) + if err == nil && tenantResponse != nil { + if tenantResponse.AdminMail != "" { // this customer already belongs to some user + c.update(&ConfigObj{CustomerGUID: customerGUID, CustomerAdminEMail: tenantResponse.AdminMail}) + } else { + c.update(&ConfigObj{CustomerGUID: tenantResponse.TenantID, Token: tenantResponse.Token}) + return c.updateConfigMap() + } } else { + if err != nil && strings.Contains(err.Error(), "Invitation for tenant already exists") { + return nil + } return err } + return nil } func (c *ClusterConfig) loadConfigFromConfigMap() (*ConfigObj, error) { diff --git a/cautils/getter/armoapi.go b/cautils/getter/armoapi.go index ca60e2df..5b94fbdf 100644 --- a/cautils/getter/armoapi.go +++ b/cautils/getter/armoapi.go @@ -1,6 +1,7 @@ package getter import ( + "fmt" "net/http" "github.com/armosec/kubescape/cautils/armotypes" @@ -60,8 +61,12 @@ func (armoAPI *ArmoAPI) GetExceptions(customerGUID, clusterName string) ([]armot return exceptions, nil } -func (armoAPI *ArmoAPI) GetCustomerGUID() (*TenantResponse, error) { - respStr, err := HttpGetter(armoAPI.httpClient, armoAPI.getCustomerURL()) +func (armoAPI *ArmoAPI) GetCustomerGUID(customerGUID string) (*TenantResponse, error) { + url := armoAPI.getCustomerURL() + if customerGUID != "" { + url = fmt.Sprintf("%s?customerGUID=%s", url, customerGUID) + } + respStr, err := HttpGetter(armoAPI.httpClient, url) if err != nil { return nil, err } @@ -74,7 +79,8 @@ func (armoAPI *ArmoAPI) GetCustomerGUID() (*TenantResponse, error) { } type TenantResponse struct { - TenantID string `json:"tenantId"` - Token string `json:"token"` - Expires string `json:"expires"` + TenantID string `json:"tenantId"` + Token string `json:"token"` + Expires string `json:"expires"` + AdminMail string `json:"adminMail,omitempty"` } From ccafd78a14f282ecaf4eb9596a37280ccf26d29b Mon Sep 17 00:00:00 2001 From: Bezalel Brandwine Date: Mon, 13 Sep 2021 15:10:43 +0300 Subject: [PATCH 10/12] change URLs to production at build time --- .github/workflows/build.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d0aea435..a07c05a7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,13 @@ jobs: - name: Build env: RELEASE: v1.0.${{ github.run_number }} - run: mkdir -p build/${{ matrix.os }} && go mod tidy && go build -ldflags "-w -s -X github.com/armosec/kubescape/cmd.BuildNumber=$RELEASE" -o build/${{ matrix.os }}/kubescape # && md5sum build/${{ matrix.os }}/kubescape > build/${{ matrix.os }}/kubescape.md5 + ArmoBEServer: api.armo.cloud + ArmoERServer: report.euprod1.cyberarmorsoft.com + ArmoWebsite: portal.armo.cloud + BEServerConst: github.com/armosec/kubescape/cautils/getter.ArmoBEURL + ERServerConst: github.com/armosec/kubescape/cautils/getter.ArmoERURL + WebsiteConst: github.com/armosec/kubescape/cautils/getter.ArmoFEURL + run: mkdir -p build/${{ matrix.os }} && go mod tidy && go build -ldflags "-w -s -X github.com/armosec/kubescape/cmd.BuildNumber=$RELEASE -X $BEServerConst=$ArmoBEServer -X $ERServerConst=$ArmoERServer -X $WebsiteConst=$ArmoWebsite" -o build/${{ matrix.os }}/kubescape # && md5sum build/${{ matrix.os }}/kubescape > build/${{ matrix.os }}/kubescape.md5 - name: Upload Release binaries id: upload-release-asset From 15239737493bc7e430fceb0dcb91363fffeeb9e3 Mon Sep 17 00:00:00 2001 From: Bezalel Brandwine Date: Mon, 13 Sep 2021 15:26:29 +0300 Subject: [PATCH 11/12] change consts to var so ldflag -s will work --- cautils/getter/armoapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cautils/getter/armoapi.go b/cautils/getter/armoapi.go index 5b94fbdf..4b239e29 100644 --- a/cautils/getter/armoapi.go +++ b/cautils/getter/armoapi.go @@ -12,7 +12,7 @@ import ( // =============================================== ArmoAPI =============================================================== // ======================================================================================================================= -const ( +var ( ArmoBEURL = "eggdashbe.eudev3.cyberarmorsoft.com" ArmoERURL = "report.eudev3.cyberarmorsoft.com" ArmoFEURL = "armoui.eudev3.cyberarmorsoft.com" From 2985da6dc90587aad07b592754749c7642988020 Mon Sep 17 00:00:00 2001 From: "lalafi@cyberarmor.io" Date: Mon, 13 Sep 2021 16:33:25 +0300 Subject: [PATCH 12/12] remove redundant field --- cautils/opapolicy/datastructures.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cautils/opapolicy/datastructures.go b/cautils/opapolicy/datastructures.go index ca0b5b5e..30c031ab 100644 --- a/cautils/opapolicy/datastructures.go +++ b/cautils/opapolicy/datastructures.go @@ -43,7 +43,6 @@ type ControlReport struct { armotypes.PortalBase `json:",inline"` ControlID string `json:"id"` Name string `json:"name"` - ID string `json:"id"` RuleReports []RuleReport `json:"ruleReports"` Remediation string `json:"remediation"` Description string `json:"description"`