You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Creating the Mondoo GitHub Integration via the UI offers the choice to designate whether the target is an Organization or a single Repository.
The mondoo_integration_github resource to create this integration does not have a schema property to designate whether the integration is for a GitHub Organization vs a single Repository. The created terraform resource shows up as type "Organization" in Mondoo.
When using a personal GitHub account, terraform creates the integration, but it is in an error state:
To Reproduce
Use a personal github.com account, not an organization. Generate a PAT (I used a classic one, but would expect the same issue with a fine-grained token).
Use the following terraform configuration:
variable "github_owner" {
description = "a GitHub Organization or Account"
type = string
default = ""
}
variable "github_token" {
description = "the classic or fine-grained PAT for a GitHub Organization"
type = string
sensitive = true
default = ""
}
variable "github_repositories" {
type = list(string)
description = "A list of specific repositories to scan. If blank, Mondoo will scan all repositories in the Organization or Account. Each will become a Mondoo Asset registered to the Space created by mondoo_space.demo."
default = []
}
resource "mondoo_integration_github" "demo" {
count = var.github_owner != "" && var.github_token != "" ? 1 : 0
name = var.github_owner
owner = var.github_owner
space_id = mondoo_space.demo.id
repository_allow_list = length(toset(var.github_repositories)) == 0 ? null : toset(var.github_repositories)
credentials = {
token = var.github_token
}
}
Expected behavior
A non-erroring Mondoo GitHub integration that scans all repos in the personal github.com account at URL https://www.github.com/owner (where owner is provided using var.github_owner).
If repository_allow_list is used, the integration scans only those repository names fed to the list via var.github_repositories.
Screenshots or CLI Output
Desktop (please complete the following information):
OS: macOS
OS Version: 15.2 (Sequoia)
terraform version:
Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/mondoohq/mondoo v0.19.2
The text was updated successfully, but these errors were encountered:
Describe the bug
Creating the Mondoo GitHub Integration via the UI offers the choice to designate whether the target is an Organization or a single Repository.
The mondoo_integration_github resource to create this integration does not have a schema property to designate whether the integration is for a GitHub Organization vs a single Repository. The created terraform resource shows up as type "Organization" in Mondoo.
When using a personal GitHub account, terraform creates the integration, but it is in an error state:
(see screenshot below)
To Reproduce
Use a personal github.com account, not an organization. Generate a PAT (I used a classic one, but would expect the same issue with a fine-grained token).
Use the following terraform configuration:
Expected behavior
A non-erroring Mondoo GitHub integration that scans all repos in the personal github.com account at URL https://www.github.com/owner (where owner is provided using
var.github_owner
).If
repository_allow_list
is used, the integration scans only those repository names fed to the list viavar.github_repositories
.Screenshots or CLI Output
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: