From c0161c9b33400bc8d04e84dae22b611ac1639f96 Mon Sep 17 00:00:00 2001 From: Viktor Farcic Date: Thu, 20 Jan 2022 19:54:57 +0100 Subject: [PATCH 1/4] Video --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1327ae0a..5bf1a38b 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Want to contribute? Want to discuss something? Have an issue? ## Tutorials * [Overview](https://youtu.be/wdBkt_0Qhbg) +* [How To Secure Kubernetes Clusters With Kubescape And Armo](https://youtu.be/ZATGiDIDBQk) * [Scanning Kubernetes YAML files](https://youtu.be/Ox6DaR7_4ZI) * [Scan Kubescape on an air-gapped environment (offline support)](https://youtu.be/IGXL9s37smM) * [Managing exceptions in the Kubescape SaaS version](https://youtu.be/OzpvxGmCR80) From aa0be474e20cf5b978004f035475b5d8815d0562 Mon Sep 17 00:00:00 2001 From: Geert Smelt Date: Fri, 21 Jan 2022 15:34:56 +0100 Subject: [PATCH 2/4] Fix typo in namespace --- resultshandling/printer/v2/controlmapping/summeryhelpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resultshandling/printer/v2/controlmapping/summeryhelpers.go b/resultshandling/printer/v2/controlmapping/summeryhelpers.go index ce74551d..cc606f8a 100644 --- a/resultshandling/printer/v2/controlmapping/summeryhelpers.go +++ b/resultshandling/printer/v2/controlmapping/summeryhelpers.go @@ -40,7 +40,7 @@ func groupByNamespaceOrKind(resources []WorkloadSummary, status func(workloadSum case workloadinterface.TypeWorkloadObject: ns := "" if resources[i].resource.GetNamespace() != "" { - ns = "Namescape " + resources[i].resource.GetNamespace() + ns = "Namespace " + resources[i].resource.GetNamespace() } if r, ok := mapResources[ns]; ok { r = append(r, resources[i]) From 5f43da94badb5b35bf4dfb7ef278ba70ef38f29e Mon Sep 17 00:00:00 2001 From: Ben Hirschberg Date: Sun, 23 Jan 2022 20:17:03 +0200 Subject: [PATCH 3/4] fixing the crash around submit rbac --- resultshandling/reporter/v1/reporteventreceiver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resultshandling/reporter/v1/reporteventreceiver.go b/resultshandling/reporter/v1/reporteventreceiver.go index fa774983..853700ef 100644 --- a/resultshandling/reporter/v1/reporteventreceiver.go +++ b/resultshandling/reporter/v1/reporteventreceiver.go @@ -38,7 +38,9 @@ func NewReportEventReceiver(tenantConfig *cautils.ConfigObj) *ReportEventReceive } func (report *ReportEventReceiver) ActionSendReport(opaSessionObj *cautils.OPASessionObj) error { - cautils.ReportV2ToV1(opaSessionObj) + if opaSessionObj.PostureReport == nil && opaSessionObj.Report != nil { + cautils.ReportV2ToV1(opaSessionObj) + } if report.customerGUID == "" { report.message = "WARNING: Failed to publish results. Reason: Unknown accout ID. Run kubescape with the '--account ' flag. Contact ARMO team for more details" From aa2f69125f05a3b3cdf2533cdd426ebc100deaf8 Mon Sep 17 00:00:00 2001 From: Ben Hirschberg Date: Mon, 24 Jan 2022 09:12:13 +0200 Subject: [PATCH 4/4] returning rbac submit code --- cautils/rbac.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/cautils/rbac.go b/cautils/rbac.go index 9b804702..a9d8bfbc 100644 --- a/cautils/rbac.go +++ b/cautils/rbac.go @@ -51,23 +51,22 @@ func (rbacObjects *RBACObjects) rbacObjectsToResources(resources *rbacutils.Rbac Should be investigated ************************************************************************************************************************ - - // wrap rbac aggregated objects in IMetadata and add to allresources - // TODO - DEPRECATE SA2WLIDmap - SA2WLIDmapIMeta, err := rbacutils.SA2WLIDmapIMetadataWrapper(resources.SA2WLIDmap) - if err != nil { - return nil, err - } - allresources[SA2WLIDmapIMeta.GetID()] = SA2WLIDmapIMeta - - SAID2WLIDmapIMeta, err := rbacutils.SAID2WLIDmapIMetadataWrapper(resources.SAID2WLIDmap) - if err != nil { - return nil, err - } - allresources[SAID2WLIDmapIMeta.GetID()] = SAID2WLIDmapIMeta - */ + // wrap rbac aggregated objects in IMetadata and add to allresources + // TODO - DEPRECATE SA2WLIDmap + SA2WLIDmapIMeta, err := rbacutils.SA2WLIDmapIMetadataWrapper(resources.SA2WLIDmap) + if err != nil { + return nil, err + } + allresources[SA2WLIDmapIMeta.GetID()] = SA2WLIDmapIMeta + + SAID2WLIDmapIMeta, err := rbacutils.SAID2WLIDmapIMetadataWrapper(resources.SAID2WLIDmap) + if err != nil { + return nil, err + } + allresources[SAID2WLIDmapIMeta.GetID()] = SAID2WLIDmapIMeta + // convert rbac k8s resources to IMetadata and add to allresources for _, cr := range resources.ClusterRoles.Items { crmap, err := convertToMap(cr)