Skip to content

Commit

Permalink
Jira integration (mondoohq#168)
Browse files Browse the repository at this point in the history
fixes mondoohq#160

---------

Signed-off-by: Matthias Theuermann <[email protected]>
  • Loading branch information
mati007thm authored Dec 13, 2024
1 parent 0496f60 commit 75b5a1c
Show file tree
Hide file tree
Showing 8 changed files with 509 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Hmj
JFB
JFUz
Jhb
jira
KBp
ljq
LQV
Expand Down
68 changes: 68 additions & 0 deletions docs/resources/integration_jira.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "mondoo_integration_jira Resource - terraform-provider-mondoo"
subcategory: ""
description: |-
Integrate the Ticketing System Jira with Mondoo to automatically create and close issues based on Mondoo findings.
---

# mondoo_integration_jira (Resource)

Integrate the Ticketing System Jira with Mondoo to automatically create and close issues based on Mondoo findings.

## Example Usage

```terraform
variable "jira_token" {
description = "The Jira API Token"
type = string
sensitive = true
}
provider "mondoo" {
space = "hungry-poet-123456"
}
# Setup the Jira integration
resource "mondoo_integration_jira" "jira_integration" {
name = "My Jira Integration"
host = "https://your-instance.atlassian.net"
email = "[email protected]"
# default_project = "MONDOO"
auto_create = true
auto_close = true
credentials = {
token = var.jira_token
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `credentials` (Attributes) (see [below for nested schema](#nestedatt--credentials))
- `email` (String) Jira user email.
- `host` (String) Jira host URL.
- `name` (String) Name of the integration.

### Optional

- `auto_close` (Boolean) Automatically close Jira issues for resolved Mondoo findings
- `auto_create` (Boolean) Automatically create Jira issues for Mondoo findings.
- `default_project` (String) Default Jira project (is represented by the project key e.g. `MONDOO`).
- `space_id` (String) Mondoo Space Identifier. If it is not provided, the provider space is used.

### Read-Only

- `mrn` (String) Integration identifier.

<a id="nestedatt--credentials"></a>
### Nested Schema for `credentials`

Required:

- `token` (String, Sensitive) Jira API token.
8 changes: 8 additions & 0 deletions examples/resources/mondoo_integration_jira/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
mondoo = {
source = "mondoohq/mondoo"
version = ">= 0.19"
}
}
}
24 changes: 24 additions & 0 deletions examples/resources/mondoo_integration_jira/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "jira_token" {
description = "The Jira API Token"
type = string
sensitive = true
}

provider "mondoo" {
space = "hungry-poet-123456"
}

# Setup the Jira integration
resource "mondoo_integration_jira" "jira_integration" {
name = "My Jira Integration"
host = "https://your-instance.atlassian.net"
email = "[email protected]"
# default_project = "MONDOO"

auto_create = true
auto_close = true

credentials = {
token = var.jira_token
}
}
9 changes: 9 additions & 0 deletions internal/provider/gql.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,14 @@ type ShodanConfigurationOptions struct {
Targets []string
}

type JiraConfigurationOptions struct {
Host string
Email string
DefaultProject string
AutoCloseTickets bool
AutoCreateCases bool
}

type EmailConfigurationOptions struct {
Recipients []EmailRecipient
AutoCreateTickets bool
Expand All @@ -639,6 +647,7 @@ type ClientIntegrationConfigurationOptions struct {
GithubConfigurationOptions GithubConfigurationOptions `graphql:"... on GithubConfigurationOptions"`
HostedAwsConfigurationOptions HostedAwsConfigurationOptions `graphql:"... on HostedAwsConfigurationOptions"`
ShodanConfigurationOptions ShodanConfigurationOptions `graphql:"... on ShodanConfigurationOptions"`
JiraConfigurationOptions JiraConfigurationOptions `graphql:"... on JiraConfigurationOptions"`
EmailConfigurationOptions EmailConfigurationOptions `graphql:"... on EmailConfigurationOptions"`
GitlabConfigurationOptions GitlabConfigurationOptions `graphql:"... on GitlabConfigurationOptions"`
// Add other configuration options here
Expand Down
Loading

0 comments on commit 75b5a1c

Please sign in to comment.