SSH login approvals using Jira
This guide will talk through how to setup Teleport with Jira. Teleport's Jira integration allows you to treat Teleport access and permission requests using Jira tickets.
This guide assumes that you have:
- A running Teleport Cluster
- Admin privileges with access to
- Jira Server or Jira Cloud installation with an owner privileges, specifically to setup webhooks, issue types, and workflows
Teleport Cloud requires that plugins connect through the Proxy Service (
mytenant.teleport.sh:443). Open Source and Enterprise installations can connect to the Auth Service (
Using an existing Teleport cluster, create the following
role resources with the command below, replacing
YAML_PATH with the path to each resource spec.
$ tctl create -f YAML_PATH.yaml
Create a non-interactive bot user and role called
kind: user metadata: name: access-plugin spec: roles: ['access-plugin'] version: v2 kind: role version: v4 metadata: name: access-plugin spec: allow: rules: - resources: ['access_request'] verbs: ['list', 'read'] - resources: ['access_plugin_data'] verbs: ['update']
If you're using other plugins, you might want to create different users and roles for different plugins
Teleport's plugins use the
access-plugin role and user to approve access requests. We export the identity files to this plugin using
tctl auth sign.
tctl auth sign --format=tls --user=access-plugin --out=auth --ttl=2190h
The above sequence should result in three PEM encoded files being generated:
auth.cas (certificate, private key, and CA certs respectively).
tctl auth sign --user=access-plugin --out=auth.pem --ttl=2190h
The above sequence should result in one PEM encoded file:
tctl auth sign produces certificates with a relatively short lifetime. For production deployments, the
--ttl flag can be used to ensure a more practical certificate lifetime.
--ttl=8760h exports a 1 year token
We'll reference these files later when configuring the plugins.
All new permission requests are going to show up in a project you choose. We recommend that you create a separate project for permissions management, and a new board in said project.
You'll need the project Jira key to configure the plugin.
Create a new board for tasks in the permission management project. The board has to have at least these three columns:
Teleport's Jira plugin will create a new issue for each new permission request in the first available column on the board. When you drag the request task to the Approved column in Jira, the request will be approved. If you drag the request task to the Denied column in Jira, the request will be denied.
The Teleport Jira plugin requires a custom issue field to be created.
Go to your Jira Project settings → Issue Types → Select type
Task → add a new Short Text field named
Teleport uses this field to reference its internal request ID. If anyone changes this field on Jira, or tries to forge the permission request, Teleport will validate it and ignore it.
If you're using Jira Cloud, navigate to Account Settings → Security → API Tokens and create a new app specific API token in your Jira installation. You'll need this token later to configure the plugin.
For Jira Server, the URL of the API tokens page will be different depending on your installation.
Go to Settings → General → System → Webhooks and create a new webhook for Jira to tell the Teleport plugin about updates.
For the webhook URL, use the URL that you'll run the plugin on. It needs to be a publicly accessible URL (we will show you how to set this up later). Jira requires the webhook listener to run over HTTPS.
The webhook needs to be notified only about new issues being created, issues being updated, or deleted. You can leave all the other boxes empty.
Jira will send updates about any issues in any projects in your Jira installation to the webhook. We suggest that you use JQL filters to limit which issues are being sent to the plugin.
The plugin's web server will run with TLS, but you can disable it with
--insecure-no-tls to test things out in a dev environment.
In the webhook settings page, make sure that the webhook will only send Issue Updated updates. It's not critical if anything else gets sent, since the plugin will just ignore everything else.
We recommend installing Teleport plugins alongside the Teleport Proxy. This is an ideal location as plugins have a low memory footprint, and will require both public internet access and Teleport Auth Service access.
curl -L -O https://get.gravitational.com/teleport-access-jira-v9.3.7-linux-amd64-bin.tar.gztar -xzf teleport-access-jira-v9.3.7-linux-amd64-bin.tar.gzcd teleport-access-jira./install
To install from source you need
go installed. If you do not have Go installed, visit the Go downloads page.
Checkout teleport-pluginsgit clone https://github.com/gravitational/teleport-plugins.gitcd teleport-plugins/access/jiramake
teleport-jira or place the executable in
/usr/local/bin on the server installation.
docker pull quay.io/gravitational/teleport-plugin-jira:9.3.7
The Teleport Jira plugin uses a config file in TOML format. Generate a boilerplate config by running the following command:
teleport-jira configure > teleport-jira.tomlsudo mv teleport-jira.toml /etc
By default, the Jira Teleport plugin will use a config in
/etc/teleport-jira.toml, and you can override it with
-c config/file/path.toml flag.
# example jira plugin configuration TOML file [teleport] auth_server = "example.com:3025" # Teleport Auth Server GRPC API address client_key = "/var/lib/teleport/plugins/jira/auth.key" # Teleport GRPC client secret key client_crt = "/var/lib/teleport/plugins/jira/auth.crt" # Teleport GRPC client certificate root_cas = "/var/lib/teleport/plugins/jira/auth.cas" # Teleport cluster CA certs [jira] url = "https://example.com/jira" # JIRA URL. For JIRA Cloud, https://[my-jira].atlassian.net username = "[email protected]" # JIRA username api_token = "token" # JIRA API Basic Auth token project = "MYPROJ" # JIRA Project key [http] # listen_addr = ":8081" # Network address in format [addr]:port on which webhook server listens, e.g. 0.0.0.0:443 # public_addr = "example.com" # URL on which webhook server is accessible externally, e.g. [https://]teleport-jira.example.com https_key_file = "/var/lib/teleport/plugins/jira/server.key" # TLS private key https_cert_file = "/var/lib/teleport/plugins/jira/server.crt" # TLS certificate [log] output = "stderr" # Logger output. Could be "stdout", "stderr" or "/var/lib/teleport/jira.log" severity = "INFO" # Logger severity. Could be "INFO", "ERROR", "DEBUG" or "WARN".
# example jira plugin configuration TOML file [teleport] auth_server = "myinstance.teleport.sh:443" # Teleport Cloud proxy HTTPS address identity = "/var/lib/teleport/plugins/jira/auth.pem" # Teleport identity file location [jira] url = "https://example.com/jira" # JIRA URL. For JIRA Cloud, https://[my-jira].atlassian.net username = "[email protected]" # JIRA username api_token = "token" # JIRA API Basic Auth token project = "MYPROJ" # JIRA Project key [http] # listen_addr = ":8081" # Network address in format [addr]:port on which webhook server listens, e.g. 0.0.0.0:443 # public_addr = "example.com" # URL on which webhook server is accessible externally, e.g. [https://]teleport-jira.example.com https_key_file = "/var/lib/teleport/plugins/jira/server.key" # TLS private key https_cert_file = "/var/lib/teleport/plugins/jira/server.crt" # TLS certificate [log] output = "stderr" # Logger output. Could be "stdout", "stderr" or "/var/lib/teleport/jira.log" severity = "INFO" # Logger severity. Could be "INFO", "ERROR", "DEBUG" or "WARN".
[teleport] section describes where the teleport service running, and what keys should the plugin use to authenticate itself. Use the keys that you've generated.
[jira] section requires a few things:
- Your Jira Cloud or Jira Server URL. For Jira Cloud, it looks something like
- Your username on Jira, i.e. [email protected]
- Your Jira API token that you've created above.
- A Jira Project key, available in Project settings.
[http] setting block describes how the plugin's HTTP server works. The HTTP server is responsible for listening for updates from Jira, and processing updates, like when someone drags a task from Inbox to Approved column.
You must provide an address the server should listen on, and a certificate to use. It's possible to run the Jira plugin on the same server as the Teleport Proxy, so you can use the same TLS certificate.
You should be able to run the Teleport plugin now!
The log output should look familiar to what Teleport service logs. You should see that it connected to Teleport, and is listening for new Teleport requests and Jira webhooks.
Go ahead and test it:
tsh login --request-roles=admin
That should create a new permission request on Teleport (you can test if it did with
tctl request ls), and you should see a new task on your Jira project board.
In production, we recommend starting the Teleport plugin daemon via an init system like systemd. Here's the recommended Teleport plugin service unit file for systemd:
[Unit] Description=Teleport Jira Plugin After=network.target [Service] Type=simple Restart=on-failure ExecStart=/usr/local/bin/teleport-jira start --config=/etc/teleport-jira.toml ExecReload=/bin/kill -HUP $MAINPID PIDFile=/run/teleport-jira.pid [Install] WantedBy=multi-user.target
Save this as
teleport-jira.service. Make sure the
teleport-jira start command includes a
--config flag that refers to the configuration file you created earlier.
The plugin will let anyone with access to the Jira board approve/deny requests so it's important to review Teleport's audit log.
If you have any issues with this plugin please create an issue here.