Skip to content

Commit 1e23324

Browse files
subatoizentronCopilot
authored
Adds OIDC Octopus Deploy guide (#59340)
Co-authored-by: Rob E <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent d10604c commit 1e23324

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

content/actions/how-tos/secure-your-work/security-harden-deployments/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ children:
1616
- /oidc-in-google-cloud-platform
1717
- /oidc-in-hashicorp-vault
1818
- /oidc-in-jfrog
19+
- /oidc-in-octopus-deploy
1920
- /oidc-in-pypi
2021
- /oidc-in-cloud-providers
2122
- /oidc-with-reusable-workflows
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: Configuring OpenID Connect in Octopus Deploy
3+
shortTitle: OIDC in Octopus Deploy
4+
intro: Use OpenID Connect within your workflows to authenticate with Octopus Deploy.
5+
versions:
6+
fpt: '*'
7+
ghec: '*'
8+
type: tutorial
9+
topics:
10+
- Security
11+
- Actions
12+
---
13+
14+
## Overview
15+
16+
OpenID Connect (OIDC) allows your {% data variables.product.prodname_actions %} workflows to authenticate with [Octopus Deploy](https://octopus.com/) to push packages, create releases or trigger deployments without storing Octopus Deploy passwords or API keys as long-lived {% data variables.product.prodname_dotcom %} secrets.
17+
18+
This guide provides an overview of how to configure Octopus Deploy to trust {% data variables.product.prodname_dotcom %}'s OIDC as a federated identity, and includes a workflow example for the [`octopusdeploy/login`](https://github.com/OctopusDeploy/login) action that uses tokens to authenticate to your Octopus Deploy instance.
19+
20+
## Prerequisites
21+
22+
{% data reusables.actions.oidc-link-to-intro %}
23+
24+
{% data reusables.actions.oidc-security-notice %}
25+
26+
{% data reusables.actions.oidc-on-ghecom %}
27+
28+
## Adding the identity provider to Octopus Deploy
29+
30+
To use OIDC with Octopus Deploy, first establish a trust relationship between {% data variables.product.prodname_actions %} and your Octopus Deploy instance. For more information about this process, see [Using OpenID Connect with the Octopus API](https://octopus.com/docs/octopus-rest-api/openid-connect) in the Octopus Deploy documentation.
31+
32+
1. Sign in to your Octopus Deploy instance.
33+
1. Create or open the Service Account that will be granted access via the token request.
34+
1. Configure a new OIDC Identity, defining the relevant subject that the {% data variables.product.prodname_actions %} workflow token request will be validated against.
35+
36+
## Updating your {% data variables.product.prodname_actions %} workflow
37+
38+
To update your workflows for OIDC, you will need to make two changes to your YAML:
39+
1. Add permissions settings for the token.
40+
1. Use the [`OctopusDeploy/login`](https://github.com/OctopusDeploy/login) action to exchange the OIDC token (JWT) for a cloud access token.
41+
42+
{% data reusables.actions.oidc-deployment-protection-rules %}
43+
44+
### Adding permissions settings
45+
46+
{% data reusables.actions.oidc-permissions-token %}
47+
48+
### Requesting the access token
49+
50+
The [`OctopusDeploy/login`](https://github.com/OctopusDeploy/login) action receives a JWT from the {% data variables.product.prodname_dotcom %} OIDC provider, and then requests an access token from your Octopus Server instance. For more information, see the [`OctopusDeploy/login`](https://github.com/OctopusDeploy/login) documentation.
51+
52+
The following example exchanges an OIDC ID token with your Octopus Deploy instance to receive an access token, which can then be used to access your Octopus Deploy resources. Be sure to replace the `server` and `service_account_id` details appropriately for your scenario.
53+
54+
```yaml copy
55+
{% data reusables.actions.actions-not-certified-by-github-comment %}
56+
57+
jobs:
58+
create_release_in_octopus:
59+
runs-on: ubuntu-latest
60+
name: Create a release in Octopus
61+
permissions:
62+
# You might need to add other permissions here like `contents: read` depending on what else your job needs to do
63+
id-token: write # This is required to obtain an ID token from GitHub Actions for the job
64+
steps:
65+
- name: Login to Octopus
66+
uses: OctopusDeploy/login@34b6dcc1e86fa373c14e6a28c5507d221e4de629 #v1.0.2
67+
with:
68+
server: https://my.octopus.app
69+
service_account_id: 5be4ac10-2679-4041-a8b0-7b05b445e19e
70+
71+
- name: Create a release in Octopus
72+
uses: OctopusDeploy/create-release-action@fe13cc69c1c037cb7bb085981b152f5e35257e1f #v3.2.2
73+
with:
74+
space: Default
75+
project: My Octopus Project
76+
```
77+
78+
## Further reading
79+
80+
{% data reusables.actions.oidc-further-reading %}

0 commit comments

Comments
 (0)