Skip to content

Commit a1ca515

Browse files
committed
Update
1 parent 48859cf commit a1ca515

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

content/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-jfrog.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ For an example {% data variables.product.prodname_actions %} workflow using the
3535

3636
For example, you can set `iss` to `https://token.actions.githubusercontent.com`, and the `repository` to something like "octo-org/octo-repo"`. This will ensure only Actions workflows from the specified repository will have access to your JFrog platform. The following is an example Claims JSON when configuring identity mappings.
3737

38-
```json copy
38+
```json
3939
{
4040
"iss": "https://token.actions.githubusercontent.com",
4141
"repository": "octo-org/octo-repo"
@@ -68,25 +68,39 @@ jobs:
6868
runs-on: ubuntu-latest
6969
steps:
7070
- name: Setup JFrog CLI with OIDC
71+
id: setup-jfrog-cli
7172
uses: jfrog/setup-jfrog-cli@v4
7273
with:
73-
oidc-provider-name: 'YOUR_PROVIDER_NAME'
74-
oidc-audience: 'YOUR_AUDIENCE'
74+
JF_URL: ${{ env.JF_URL }}
75+
oidc-provider-name: 'my-github-provider' # Replace with your configured provider name
76+
oidc-audience: 'jfrog-github' # Replace with your configured audience
7577

7678
- name: Upload artifact
7779
run: jf rt upload "dist/*.zip" my-repo/
80+
7881
```
7982

83+
> **Note**
84+
> When OIDC authentication is used, the `setup-jfrog-cli` action automatically provides short-lived credentials (`oidc-user` and `oidc-token`) as step outputs. These can be used for Docker, Helm, and other integrations that require authentication with JFrog. No additional configuration is needed to enable these outputs.
85+
86+
```yaml
87+
- name: Login to Artifactory
88+
uses: docker/login-action@v3
89+
with:
90+
registry: ${{ env.JF_URL }}
91+
username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
92+
password: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
93+
```
8094
## Security Best Practices
8195
82-
- Always use `permissions: id-token: write` in workflows that authenticate with JFrog.
83-
- Limit trust using specific claims like `repository`, `ref`, or `environment`.
84-
- Configure identity mappings in JFrog to restrict authentication to specific workflows.
96+
- Always set `permissions: id-token: write` in any workflow using OIDC.
97+
- Restrict trust using claims such as `repository`, `ref`, or `environment`.
98+
- Use identity mappings to scope access at a fine-grained level inside the JFrog Platform.
8599

86100
## Further Reading
87101

88102
- [JFrog OpenID Connect Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/openid-connect-integration)
89-
- [JFrog Platform Identify Mappings DOCS](https://jfrog.com/help/r/jfrog-platform-administration-documentation/identity-mappings)
90-
- [JFrog CLI Docs: `exchange-oidc-token` command (manual usage)](https://jfrog.com/help/r/jfrog-cli-documentation/oidc-commands#exchange-oidc-token)
91-
- [GitHub Docs: About security hardening with OpenID Connect](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
103+
- [Configure Identity Mappings](https://jfrog.com/help/r/jfrog-platform-administration-documentation/identity-mappings)
104+
- [JFrog CLI: `exchange-oidc-token` Command](https://jfrog.com/help/r/jfrog-cli-documentation/oidc-commands#exchange-oidc-token)
105+
- [GitHub Docs: About Security Hardening with OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
92106
```

0 commit comments

Comments
 (0)