Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mondoohq/cnquery
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9fb5b28551c7f083d8aeaf82d81925b2e3b46244
Choose a base ref
..
head repository: mondoohq/cnquery
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9f4ddbb13d9cb771b646f0c6f1d3e7cc8693ebcb
Choose a head ref
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -103,3 +103,4 @@ vulnmgmt
wil
xssmatchstatement
optionalfeature
Committers
2 changes: 1 addition & 1 deletion providers/ansible/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "ansible",
ID: "go.mondoo.com/cnquery/v11/providers/ansible",
Version: "11.0.8",
Version: "11.0.9",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/arista/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "arista",
ID: "go.mondoo.com/cnquery/v9/providers/arista",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/atlassian/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "atlassian",
ID: "go.mondoo.com/cnquery/v9/providers/atlassian",
Version: "11.0.22",
Version: "11.0.23",
ConnectionTypes: []string{
provider.DefaultConnectionType,
"jira",
2 changes: 1 addition & 1 deletion providers/cloudformation/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "cloudformation",
ID: "go.mondoo.com/cnquery/v11/providers/cloudformation",
Version: "11.0.13",
Version: "11.0.14",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/equinix/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "equinix",
ID: "go.mondoo.com/cnquery/v9/providers/equinix",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/gcp/config/config.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import (
var Config = plugin.Provider{
Name: "gcp",
ID: "go.mondoo.com/cnquery/v9/providers/gcp",
Version: "11.0.27",
Version: "11.0.28",
ConnectionTypes: []string{
provider.ConnectionType,
string(gcpinstancesnapshot.SnapshotConnectionType),
2 changes: 1 addition & 1 deletion providers/github/config/config.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
var Config = plugin.Provider{
Name: "github",
ID: "go.mondoo.com/cnquery/v9/providers/github",
Version: "11.3.11",
Version: "11.3.12",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/gitlab/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "gitlab",
ID: "go.mondoo.com/cnquery/v9/providers/gitlab",
Version: "11.1.10",
Version: "11.1.11",
ConnectionTypes: []string{
provider.ConnectionType,
provider.GitlabGroupConnection,
27 changes: 27 additions & 0 deletions providers/gitlab/resources/gitlab.go
Original file line number Diff line number Diff line change
@@ -122,6 +122,33 @@ func initGitlabProject(runtime *plugin.Runtime, args map[string]*llx.RawData) (m
return args, nil, nil
}

// New function to fetch project approval settings
func (p *mqlGitlabProject) approvalSettings() (*mqlGitlabProjectApprovalSettings, error) {
conn := p.MqlRuntime.Connection.(*connection.GitLabConnection)

projectID := int(p.Id.Data)
approvalConfig, _, err := conn.Client().Projects.GetApprovalConfiguration(projectID)
if err != nil {
return nil, err
}

approvalSettings := map[string]*llx.RawData{
"approvalsBeforeMerge": llx.IntData(int64(approvalConfig.ApprovalsBeforeMerge)),
"resetApprovalsOnPush": llx.BoolData(approvalConfig.ResetApprovalsOnPush),
"disableOverridingApproversPerMergeRequest": llx.BoolData(approvalConfig.DisableOverridingApproversPerMergeRequest),
"mergeRequestsAuthorApproval": llx.BoolData(approvalConfig.MergeRequestsAuthorApproval),
"mergeRequestsDisableCommittersApproval": llx.BoolData(approvalConfig.MergeRequestsDisableCommittersApproval),
"requirePasswordToApprove": llx.BoolData(approvalConfig.RequirePasswordToApprove),
}

mqlApprovalSettings, err := CreateResource(p.MqlRuntime, "gitlab.project.approvalSettings", approvalSettings)
if err != nil {
return nil, err
}

return mqlApprovalSettings.(*mqlGitlabProjectApprovalSettings), nil
}

// New function to fetch project approval rules
func (p *mqlGitlabProject) approvalRules() ([]interface{}, error) {
conn := p.MqlRuntime.Connection.(*connection.GitLabConnection)
18 changes: 18 additions & 0 deletions providers/gitlab/resources/gitlab.lr
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@ gitlab.project @defaults("fullName visibility webURL") {
requirementsEnabled bool
// Approval rules for the project
approvalRules() []gitlab.project.approvalRule
// Approval settings for the project
approvalSettings() gitlab.project.approvalSettings
}


@@ -96,3 +98,19 @@ gitlab.project.approvalRule @defaults("id name approvalsRequired") {
// Number of approvals required
approvalsRequired int
}

// GitLab project approval settings
gitlab.project.approvalSettings @defaults("approvalsBeforeMerge requirePasswordToApprove") {
// Number of approvals before merge
approvalsBeforeMerge int
// Whether all approvals are removed when new commits are pushed
resetApprovalsOnPush bool
// Disable overriding approvers per merge request
disableOverridingApproversPerMergeRequest bool
// Whether author of merge request can approve
mergeRequestsAuthorApproval bool
// Disable committer's approval for merge request
mergeRequestsDisableCommittersApproval bool
// Require password to approve
requirePasswordToApprove bool
}
2 changes: 1 addition & 1 deletion providers/google-workspace/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "google-workspace",
ID: "go.mondoo.com/cnquery/v9/providers/google-workspace",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/ipmi/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "ipmi",
ID: "go.mondoo.com/cnquery/v9/providers/ipmi",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/ms365/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "ms365",
ID: "go.mondoo.com/cnquery/v9/providers/ms365",
Version: "11.0.24",
Version: "11.0.25",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/network/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "network",
ID: "go.mondoo.com/cnquery/v9/providers/network",
Version: "11.0.16",
Version: "11.0.17",
ConnectionTypes: []string{provider.HostConnectionType},
CrossProviderTypes: []string{
"go.mondoo.com/cnquery/providers/os",
2 changes: 1 addition & 1 deletion providers/oci/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "oci",
ID: "go.mondoo.com/cnquery/v9/providers/oci",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/okta/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "okta",
ID: "go.mondoo.com/cnquery/v9/providers/okta",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/opcua/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "opcua",
ID: "go.mondoo.com/cnquery/v9/providers/opcua",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/os/config/config.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
var Config = plugin.Provider{
Name: "os",
ID: "go.mondoo.com/cnquery/v9/providers/os",
Version: "11.2.17",
Version: "11.2.18",
ConnectionTypes: []string{
shared.Type_Local.String(),
shared.Type_SSH.String(),
2 changes: 1 addition & 1 deletion providers/shodan/config/config.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import (
var Config = plugin.Provider{
Name: "shodan",
ID: "go.mondoo.com/cnquery/v11/providers/shodan",
Version: "11.0.9",
Version: "11.0.10",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/slack/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "slack",
ID: "go.mondoo.com/cnquery/v9/providers/slack",
Version: "11.0.23",
Version: "11.0.24",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/snowflake/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "snowflake",
ID: "go.mondoo.com/cnquery/v11/providers/snowflake",
Version: "11.0.7",
Version: "11.0.8",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/terraform/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "terraform",
ID: "go.mondoo.com/cnquery/v9/providers/terraform",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{
provider.StateConnectionType,
provider.PlanConnectionType,
2 changes: 1 addition & 1 deletion providers/vcd/config/config.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
var Config = plugin.Provider{
Name: "vcd",
ID: "go.mondoo.com/cnquery/v9/providers/vcd",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
2 changes: 1 addition & 1 deletion providers/vsphere/config/config.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
var Config = plugin.Provider{
Name: "vsphere",
ID: "go.mondoo.com/cnquery/v9/providers/vsphere",
Version: "11.0.21",
Version: "11.0.22",
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{