From 7946c278d10580d1c9c2c03dee49a9eef10b76d6 Mon Sep 17 00:00:00 2001 From: Mahan Zendedel DH Date: Fri, 10 Jan 2025 14:55:12 +0400 Subject: [PATCH] move to plugin (#2407) * feat: change routes to core * feat: update core * feat: update core * feat: update core * fix: bugs in controls * fix: cards * feat: update core * fix: fix nil pointer exception * fix: update views and queries structure * fix: update views and queries structure * fix: fix migrator * feat: update database images * fix: add logs to enqueue describe jobs * Update LICENSE.md * Update LICENSE.md * Update LICENSE.md * fix: update max concurrent calls for describers * fix: fix getting job report * fix: increase compliance quick job timeout time * fix: get policy ref * fix: get policy parameters * Create license/faq.md * faet: update footer * fix: footer text * fix: reduce queued jobs limit * Update LICENSE.md * Update LICENSE.md * Update LICENSE.md * Update LICENSE.md * Update LICENSE.md * fix: fix platform plugin * fix: use control id in defining query params * fix: resolve control_id conflict in setting query parameter * feat: fix bugs related to parameters change * feat: add control id to query parameters * fix: control id in set function query parameters * fix: add description to integration file handling * fix: reduce queued jobs limit * fix: add keyRegex to get parameters * feat: add regex to parameters * fix: add googleworkspace steampipe plugin * fix: add default global values to policy parameters * fix: fix views * fix: integrations list in framework run history * fix: add more details to api responses * fix: add list and get policies * fix: remove importing query parameters from file * fix: update core db backup * fix: fix list query params api * fix: parse dfault parameters values * feat: refactor into modular * feat: refactor for service call instead of direct code call * fix: docker file * fix: config --------- Co-authored-by: Mohamad Choupan Co-authored-by: Mohamad Choupan <58650941+mohamadch91@users.noreply.github.com> Co-authored-by: artaasadi Co-authored-by: arta asadi <52131111+artaasadi@users.noreply.github.com> Co-authored-by: Anil Chandra <120965339+acx1729@users.noreply.github.com> --- jobs/compliance-quick-run-job/service.go | 4 ++-- jobs/compliance-runner-job/service.go | 4 ++-- jobs/query-runner-job/service.go | 4 ++-- jobs/query-validator-job/service.go | 5 ++--- services/scheduler/config/config.go | 2 +- services/scheduler/scheduler.go | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/jobs/compliance-quick-run-job/service.go b/jobs/compliance-quick-run-job/service.go index 99a6e5d82..23f1df9ce 100644 --- a/jobs/compliance-quick-run-job/service.go +++ b/jobs/compliance-quick-run-job/service.go @@ -28,7 +28,7 @@ type Config struct { NATS config.NATS Compliance config.OpenGovernanceService Core config.OpenGovernanceService - Onboard config.OpenGovernanceService + Integration config.OpenGovernanceService EsSink config.OpenGovernanceService Steampipe config.Postgres } @@ -54,7 +54,7 @@ func NewWorker( logger *zap.Logger, ctx context.Context, ) (*Worker, error) { - integrationClient := client.NewIntegrationServiceClient(config.Onboard.BaseURL) + integrationClient := client.NewIntegrationServiceClient(config.Integration.BaseURL) httpCtx := httpclient.Context{Ctx: ctx, UserRole: authApi.ViewerRole} diff --git a/jobs/compliance-runner-job/service.go b/jobs/compliance-runner-job/service.go index 4a9f5e35e..e754353b8 100644 --- a/jobs/compliance-runner-job/service.go +++ b/jobs/compliance-runner-job/service.go @@ -27,7 +27,7 @@ type Config struct { ElasticSearch config.ElasticSearch NATS config.NATS Compliance config.OpenGovernanceService - Onboard config.OpenGovernanceService + Integration config.OpenGovernanceService Inventory config.OpenGovernanceService Core config.OpenGovernanceService EsSink config.OpenGovernanceService @@ -61,7 +61,7 @@ func NewWorker( prometheusPushAddress string, ctx context.Context, ) (*Worker, error) { - integrationClient := client.NewIntegrationServiceClient(config.Onboard.BaseURL) + integrationClient := client.NewIntegrationServiceClient(config.Integration.BaseURL) httpCtx := httpclient.Context{Ctx: ctx, UserRole: api.ViewerRole} diff --git a/jobs/query-runner-job/service.go b/jobs/query-runner-job/service.go index 0bd74c0bc..67a2e02e6 100644 --- a/jobs/query-runner-job/service.go +++ b/jobs/query-runner-job/service.go @@ -27,7 +27,7 @@ type Config struct { ElasticSearch config.ElasticSearch NATS config.NATS Compliance config.OpenGovernanceService - Onboard config.OpenGovernanceService + Integration config.OpenGovernanceService Core config.OpenGovernanceService EsSink config.OpenGovernanceService Steampipe config.Postgres @@ -54,7 +54,7 @@ func NewWorker( prometheusPushAddress string, ctx context.Context, ) (*Worker, error) { - integrationClient := client.NewIntegrationServiceClient(config.Onboard.BaseURL) + integrationClient := client.NewIntegrationServiceClient(config.Integration.BaseURL) httpCtx := httpclient.Context{Ctx: ctx, UserRole: api.ViewerRole} diff --git a/jobs/query-validator-job/service.go b/jobs/query-validator-job/service.go index 36c19f6bf..d400873b0 100644 --- a/jobs/query-validator-job/service.go +++ b/jobs/query-validator-job/service.go @@ -22,7 +22,7 @@ type Config struct { ElasticSearch config.ElasticSearch NATS config.NATS Compliance config.OpenGovernanceService - Onboard config.OpenGovernanceService + Integration config.OpenGovernanceService Inventory config.OpenGovernanceService Core config.OpenGovernanceService EsSink config.OpenGovernanceService @@ -44,8 +44,7 @@ func NewWorker( logger *zap.Logger, ctx context.Context, ) (*Worker, error) { - - integrationClient := client.NewIntegrationServiceClient(config.Onboard.BaseURL) + integrationClient := client.NewIntegrationServiceClient(config.Integration.BaseURL) httpCtx := httpclient.Context{Ctx: ctx, UserRole: authApi.ViewerRole} diff --git a/services/scheduler/config/config.go b/services/scheduler/config/config.go index 499c791ee..fd309b222 100644 --- a/services/scheduler/config/config.go +++ b/services/scheduler/config/config.go @@ -19,7 +19,7 @@ type SchedulerConfig struct { ComplianceIntervalHours int `yaml:"compliance_interval_hours"` ServerlessProvider string `yaml:"serverless_provider"` ElasticSearch config.ElasticSearch - Onboard config.OpenGovernanceService + Integration config.OpenGovernanceService NATS config.NATS Vault vault.Config `yaml:"vault" koanf:"vault"` QueryValidatorEnabled string `yaml:"query_validator_enabled" koanf:"query_validator_enabled"` diff --git a/services/scheduler/scheduler.go b/services/scheduler/scheduler.go index 1ada679bb..d18124412 100644 --- a/services/scheduler/scheduler.go +++ b/services/scheduler/scheduler.go @@ -170,6 +170,7 @@ func InitializeScheduler( } s.conf = conf + s.integrationClient = integrationClient.NewIntegrationServiceClient(IntegrationBaseURL) cfg := postgres.Config{ Host: postgresHost, @@ -259,7 +260,6 @@ func InitializeScheduler( s.coreClient = coreClient.NewCoreServiceClient(CoreBaseURL) s.complianceClient = client.NewComplianceClient(ComplianceBaseURL) - s.integrationClient = integrationClient.NewIntegrationServiceClient(IntegrationBaseURL) s.sinkClient = esSinkClient.NewEsSinkServiceClient(s.logger, EsSinkBaseURL) authGRPCConn, err := grpc.NewClient(AuthGRPCURI, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true}))) if err != nil {