# Using the BastionZero app for Slack

{% hint style="danger" %}

### <mark style="color:red;">**The BastionZero product is maintained for existing BastionZero customers only.**</mark>&#x20;

Moving forward, we are natively rebuilding BastionZero’s technology as Cloudflare’s [Access for Infrastructure](https://developers.cloudflare.com/cloudflare-one/applications/non-http/infrastructure-apps/) service.
{% endhint %}

Looking for something specific? Here are the topics covered below:

* [How to set up the BastionZero app](#setting-up-just-in-time-with-bastionzero-app-for-slack)
* [How to request JIT access using the BastionZero app](#requesting-just-in-time-access)
* [How to connect to your JIT target](#connecting-to-your-just-in-time-target)
* [How to grant JIT access using the BastionZero app](#granting-just-in-time-access)
* [How to uninstall the BastionZero app](#uninstalling-the-bastionzero-app-for-slack)
* [Good to knows](#good-to-knows)
* [Getting support](#getting-support)

## Setting up just-in-time with BastionZero app for Slack

{% hint style="warning" %}
To enable just-in-time with your BastionZero organization, ensure you are both a BastionZero administrator **and** an administrator in the Slack workspace where you'd like to install the BastionZero app.
{% endhint %}

1. **Enable the Slack integration from** [<mark style="color:purple;">**cloud.bastionzero.com**</mark>](https://cloud.bastionzero.com)**.** Log in to the web app and navigate to the integrations page by following the settings gear in the top righthand corner -> platform settings -> app integrations. Select the "Slack" tab and click "Integrate with Slack."\ <br>

   <figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FT8GJjGPPDOoroobABFiM%2Fslack%20integration.png?alt=media&#x26;token=feba8943-7b62-4467-9cc6-1a6d77c8719e" alt=""><figcaption></figcaption></figure>
2. **Authorize the BastionZero app via Slack.** Once you click "Integrate with Slack," you will be redirected to the Slack OAuth page. It will detail the permissions needed by the BastionZero app. <mark style="background-color:purple;">**Before proceeding, make sure that the upper righthand corner displays the Slack workspace you wish to install the BastionZero app in.**</mark><br>

   <div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>It is critical that you are an administrator in the Slack workspace you are installing the BastionZero app in <strong>and</strong> that you use the same SSO organization for both your Slack workspace and BastionZero. Otherwise, this integration will not succeed.</p></div>

   <figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FPCWli9KsMVwOQ1EccqHG%2Foauth%20from%20slack.png?alt=media&#x26;token=bf155232-d56f-4092-9d60-de57c04bead0" alt=""><figcaption></figcaption></figure>
3. **Add BastionZero to your Slack workspace.** From your Slack workspace, navigate to "Apps." This could be from the top menu bar: Go -> Apps or at the bottom of your navigation menu on the lefthand side of your Slack window. Search for and select BastionZero to add it to your workspace.
4. **Congratulations!** Your organization can now manage just-in-time access through Slack!&#x20;

<mark style="background-color:purple;">**Up next:**</mark> If you don't have any JIT policies set up yet, continue reading [<mark style="color:purple;">**here**</mark>](https://docs.bastionzero.com/docs/admin-guide/authorization#just-in-time) to learn more about how to create and manage your just-in-time policies.

## Requesting just-in-time access

#### To request JIT access, try `/bz-list-targets` from any window in your Slack workspace

When you use this command, BastionZero will return all the targets available to you for just-in-time access.

<figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FGL0r6Psj59V9BsOGvOBK%2FScreenshot%202023-02-17%20at%2011.31.56.png?alt=media&#x26;token=83d04aa1-8229-41e0-bb6f-f8ceeba71847" alt=""><figcaption><p>Example output from using <code>bz-list-targets</code></p></figcaption></figure>

To request access to a specific target, click the "Request Access" button to the right of the target name. Next, complete the form with the `target user` (and if needed for Kubernetes clusters, the `target group`), the policy action, and the request reason for why you need access to the target. Note that request reason is *<mark style="color:purple;">**required**</mark>*.

<figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FTEdQHz9SHexWHmr9RH3h%2FScreenshot%202023-02-17%20at%2012.19.58.png?alt=media&#x26;token=7c2b0f5c-21cd-4af4-bf62-6b06fcbf8410" alt=""><figcaption><p>Example of a just-in-time request to the <code>bzero-cluster</code></p></figcaption></figure>

Once you've filled in the details, click "Request."  &#x20;

<figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FGbF4tw4VB7mP3mU12mo5%2FScreenshot%202023-02-17%20at%2012.53.57.png?alt=media&#x26;token=7f1f1bbc-f82d-4bf0-91ff-94367bd86a33" alt=""><figcaption><p>Example of a submitted just-in-time request</p></figcaption></figure>

If the JIT policy governing that target allows automatic approval, you will see a message from BastionZero confirming your access immediately. If the target requires explicit approval from a BastionZero admin, you'll get a notification from BastionZero when your request is approved.

<figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2Fw7IvYHvX6bRB2SvHSwOj%2FScreenshot%202023-02-17%20at%2012.57.50.png?alt=media&#x26;token=3b95ee41-a384-44d2-b76d-531e1dab8bf9" alt=""><figcaption><p>Example of a just-in-time request decision</p></figcaption></figure>

{% hint style="info" %}
For additional guidance within the BastionZero app, try `/bz-list-targets help`
{% endhint %}

{% hint style="warning" %}
If you require additional access to the target beyond what your initial JIT request allows, you must wait until the initial request expires. Only then will you be able to submit another access request.
{% endhint %}

## Connecting to your just-in-time target

Once you've received approval to access your just-in-time target, it becomes like any other target in BastionZero. Use the `zli` to connect to your target. For help, see our guide to [connecting to your targets](https://docs.bastionzero.com/docs/user-guide/connecting-to-your-resources).&#x20;

## Granting just-in-time access

For BastionZero administrators who are on the approving end of a just-in-time request, the experience with the BastionZero app will look slightly different.

When a user requests access to a target, you'll receive a notification from the BastionZero app. This notification will be sent to all BastionZero administrators.&#x20;

<figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FX3f2Gtm70pGE5zoJVpQF%2Fmanual%20approval.png?alt=media&#x26;token=609f5180-d602-44b0-8523-055370555026" alt=""><figcaption><p>An example of what a just-in-time access request looks like from the administrator's perspective</p></figcaption></figure>

Any access request, whether accepted or denied, will be logged in the `bzero-jit-log` channel.

{% hint style="info" %}
A full audit trail of just-in-time access decisions is available in the private `bzero-jit-log` channel that is created when BastionZero is installed to your Slack workspace. This channel automatically adds all BastionZero administrators in your organization. It is at the admins' discretion whether or not to include additional members.
{% endhint %}

<figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2F1FsZZcc9Ga7uXWCq9jjv%2Fjit%20log.png?alt=media&#x26;token=e8a2a9e0-b94a-40d9-978e-12433df38e19" alt=""><figcaption><p>Example entries from the BastionZero JIT audit log</p></figcaption></figure>

## Uninstalling the BastionZero app for Slack

1. **Disable** **the Slack integration from** [<mark style="color:purple;">**cloud.bastionzero.com**</mark>](https://cloud.bastionzero.com)**.** Log in to the web app and navigate to the integrations page by following the settings gear in the top righthand corner -> platform settings -> app integrations. Select the "Slack" tab and click "Remove Integration."<br>

   <figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FQu3XRY2W4DqAqftsrbY3%2Fintegration%20removal.png?alt=media&#x26;token=e404a54e-c501-48ec-ade2-237f53efd4cc" alt=""><figcaption></figcaption></figure>
2. **Remove the BastionZero app from your Slack workspace.** Select the BastionZero app from your Slack workspace. Go to "About" -> "Configuration." This will take you to the BastionZero Slack app's webpage. Scroll to the bottom of the page and click "Remove App" to remove the BastionZero app from your workspace.<br>

   <figure><img src="https://2296692744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB1x0ofz14evTHlwIRKaW%2Fuploads%2FYjGpg8LsHX5KbfPoy4nH%2Fremove%20slack%20app.webp?alt=media&#x26;token=7efc740c-1c33-48ea-8f70-577c4bc98301" alt=""><figcaption></figcaption></figure>

We're sorry to see you go! If you're willing to share why you chose not to use our app for Slack, please reach out to <product@bastionzero.com>.

## Good to knows

For convenience, we've brought together the few "good to knows" from the BastionZero app for Slack and the just-in-time feature documentation.

1. To author just-in-time policy, you must first enable the BastionZero app for Slack from Settings -> App Integrations -> Slack.
2. If you require additional access to the target beyond your initial JIT request, you must wait until the initial request's time expires. Only then will you be able to submit another access request.
3. A full audit trail of just-in-time access decisions is available in the private `bzero-jit-log` channel that is created when BastionZero is installed to your Slack workspace. This channel automatically adds all BastionZero administrators in your organization. It is at the admins' discretion whether or not to include additional members.

## Getting support

For additional assistance, please reach out to <support@bastionzero.com>.
