Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e6ac68

Browse files
author
Lukas Goodfellow
authored
ABAC for Git Contexts (#336)
1 parent6c61df3 commit8e6ac68

File tree

2 files changed

+83
-63
lines changed

2 files changed

+83
-63
lines changed

‎_docs/integrations/git-providers.md‎

Lines changed: 82 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Currently Codefresh supports:
2929

3030
Atlassian Stash/Bitbucket server as well as the on-premises version of GitLab and GitHub are only available to Codefresh enterprise customers.
3131

32-
3332
##Adding more Git providers to your Codefresh Account
3433

3534
By default, you have direct access to Git repositories that exist in the Git provider that you used while signing up for Codefresh. You can easily create Codefresh projects that checkout code from that Git provider without any extra configurations.
@@ -40,16 +39,16 @@ To add additional Git providers, go to your Account Configuration, by clicking o
4039

4140
You can add a new Git provider using the*Add Git provider* drop-down.
4241

43-
{% include image.html
44-
lightbox="true"
45-
file="/images/integrations/git/git-provider-menu.png"
42+
{% include image.html
43+
lightbox="true"
44+
file="/images/integrations/git/git-provider-menu.png"
4645
url="/images/integrations/git/git-provider-menu.png"
4746
max-width="60%"
4847
caption="Add Git provider"
4948
alt="Add Git provider"
5049
%}
5150

52-
For each Git provider you need to setup authentication, so Codefresh can get access to the public and private repositories of the respective platform.
51+
For each Git provider you need to setup authentication, so Codefresh can get access to the public and private repositories of the respective platform.
5352

5453
The easiest way to setup authentication is with OAuth2 if supported by the Git provider. You only need to name your integration
5554
and Codefresh will automatically set it up once you accept the permissions required. If you have problems with OAuth2
@@ -61,9 +60,9 @@ In the case of an on-premises GIT provider you also need to fill in the URL wher
6160

6261
You have the ability to specify whether you want to clone via HTTPS or SSH. Under the*General* menu, simply toggle to your desired option.
6362

64-
{% include image.html
65-
lightbox="true"
66-
file="/images/integrations/git/github-ssh.png"
63+
{% include image.html
64+
lightbox="true"
65+
file="/images/integrations/git/github-ssh.png"
6766
url="/images/integrations/git/github-ssh.png"
6867
max-width="40%"
6968
caption="Git SSH Options"
@@ -73,18 +72,17 @@ alt="Git SSH Options"
7372
For SSH, paste your**raw**, private key into the SSH Key text box and click save.
7473

7574
For more information on generating SSH keys and adding your public key to your VCS provider, see its official documentation:
76-
77-
-[GitHub documentation](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
78-
-[GitLab documentation](https://docs.gitlab.com/ee/ssh/#generating-a-new-ssh-key-pair)
79-
-[Bitbucket documentation](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html)
80-
-[Azure documentation](https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops&tabs=current-page)
75+
76+
*[GitHub documentation](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
77+
*[GitLab documentation](https://docs.gitlab.com/ee/ssh/#generating-a-new-ssh-key-pair)
78+
*[Bitbucket documentation](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html)
79+
*[Azure documentation](https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops&tabs=current-page)
8180

8281
##GitHub
8382

8483
For the**OAuth2 method** you only need to decide on public/private repository access, enter a name for your connection and click*Save*. Then accept the permissions dialog. This is the easiest and recommended way to integrate GitHub. Notice that if
8584
you used GitHub when you[created your Codefresh account]({{site.baseurl}}/docs/getting-started/create-a-codefresh-account/), this integration is already setup for you.
8685

87-
8886
For the**Access Token** method you need
8987

9088
* A friendly name for the Git context (it can be anything you want)
@@ -100,12 +98,13 @@ The "token description" you enter in your GitHub account in order to create the
10098
now save the Git integration.
10199

102100
The minimum permissions for the token are:
103-
-`repo.*`
104-
-`admin:repo_hook.*`
105101

106-
{% include image.html
107-
lightbox="true"
108-
file="/images/integrations/git/github-required-scopes.png"
102+
*`repo.*`
103+
*`admin:repo_hook.*`
104+
105+
{% include image.html
106+
lightbox="true"
107+
file="/images/integrations/git/github-required-scopes.png"
109108
url="/images/integrations/git/github-required-scopes.png"
110109
max-width="40%"
111110
caption="GitHub permissions"
@@ -114,8 +113,7 @@ alt="GitHub permissions"
114113

115114
For GitHub on-premises you also need to provide the URL of the GitHub server in your organization. If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
116115

117-
118-
###Using External Secrets for the Token
116+
###Using External Secrets for GitHub Token
119117

120118
If your GitHub installation is behind your firewall, you can also
121119
use any[external secrets that you have defined]({{site.baseurl}}/docs/integrations/secret-storage/) (such as Kubernetes secrets) as values by entering a secrets value
@@ -124,7 +122,9 @@ with the same syntax [shown in pipelines]({{site.baseurl}}/docs/configure-ci-cd-
124122
For example if you already have a`token` on a resource call`git-credentials` you can put in the token field the expression {% raw %}`${{secrets.git-credentials.token}}`{% endraw %}.
125123

126124
###Level of Access
125+
127126
When the admin clicks off "Allow access to all users" another toggle appears; “Allow these credentials to be shared within a pipeline for cloning a repository“
127+
128128
1. When its turned on, the user that runs a pipeline will be able to clone the repo.
129129
2. When its turned off, the user that runs a pipeline cannot use this integration.
130130
In both cases, the user cannot decrypt the token used in Git integration with CLI or API.
@@ -151,20 +151,19 @@ An alternative way to authenticate with Github is via the App mechanism.
151151

152152
**Step 5** - Click*Test connection* to verify your integration and apply your changes with the*Save* button.
153153

154-
155154
###Manual Creation
156155

157156
**Step 1** - Log in your Github account and visit[https://github.com/settings/apps](https://github.com/settings/apps). Click the*New GitHub App* button.
158157

159158
**Step 2** - On the New app screen
160-
161-
1. Give an arbitrary name to your app (e.g. codefresh-integration)
162-
1. Fill*Homepage URL* with`http://www.codefresh.io`
163-
1. Uncheck the*Active* checkbox under the Webhook section
164-
1. In the*Repository permissions* section give*Read/Write* access to*Contents*,*Webhooks* and*Issues*
165-
1. Click the*Create GitHub app* button.
166159

167-
**Step 3** - In the next screen
160+
1. Give an arbitrary name to your app (e.g. codefresh-integration)
161+
1. Fill*Homepage URL* with`http://www.codefresh.io`
162+
1. Uncheck the*Active* checkbox under the Webhook section
163+
1. In the*Repository permissions* section give*Read/Write* access to*Contents*,*Webhooks* and*Issues*
164+
1. Click the*Create GitHub app* button.
165+
166+
**Step 3** - In the next screen
168167

169168
1. Note down the*App ID* number under the*About* section
170169
1. Click the*Generate a private key* button and save the file locally
@@ -185,7 +184,6 @@ For the required fields use:
185184

186185
Click*Test connection* to verify your integration and apply your changes with the*Save* button. If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
187186

188-
189187
##GitLab
190188

191189
For the**OAuth2 method** you only need to enable private repository access, enter a name for your connection and click*Save*. Then accept the permissions dialog. This is the easiest and recommended way to integrate GitLab. Notice that if
@@ -196,7 +194,6 @@ For the **Access Key** method you need:
196194
* A friendly name for the Git context (it can be anything you want.)
197195
* An access token/key
198196

199-
200197
To create an access token, go to your GitLab*settings* and select the*Access tokens* options.
201198
For more information see the[GitLab Documentation page](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html){:target="_blank"}
202199

@@ -207,7 +204,7 @@ now save the Git integration.
207204

208205
For GitLab on-premises you also need to provide the URL of the GitLab server in your organization. If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
209206

210-
###Usingexternal secrets forthe token
207+
###UsingExternal Secrets forGitLab Token
211208

212209
If your GitLab installation is behind your firewall, you can also
213210
use any[external secrets that you have defined]({{site.baseurl}}/docs/integrations/secret-storage/) (such as Kubernetes secrets) as values by entering a secrets value
@@ -231,45 +228,43 @@ Click the button to create one. For more information see the [Bitbucket Document
231228

232229
The minimum permissions needed by Codefresh are shown below.
233230

234-
{% include image.html
235-
lightbox="true"
236-
file="/images/integrations/git/bitbucket-permissions.png"
231+
{% include image.html
232+
lightbox="true"
233+
file="/images/integrations/git/bitbucket-permissions.png"
237234
url="/images/integrations/git/bitbucket-permissions.png"
238235
max-width="40%"
239236
caption="Bitbucket permissions"
240237
alt="Bitbucket permissions"
241238
%}
242239

243240
The "label" you enter in your Bitbucket account in order to create the application password is completely arbitrary (use "Codefresh" for an example). Once you have the token, paste it in the Codefresh UI and click*Test connection*. If everything is OK you can
244-
now save the Git integration.
241+
now save the Git integration.
245242

246243
If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
247244

248245
##Azure DevOps
249246

250247
For Azure you need to create a[personal access token](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/pats?view=azure-devops). Sign in your Azure DevOps account and click on your profile icon on the top right corner. Then select*Security*:
251248

252-
253-
{% include image.html
254-
lightbox="true"
255-
file="/images/integrations/git/azure-devops-security.png"
249+
{% include image.html
250+
lightbox="true"
251+
file="/images/integrations/git/azure-devops-security.png"
256252
url="/images/integrations/git/azure-devops-security.png"
257253
max-width="60%"
258254
caption="Azure DevOps Security"
259255
alt="Azure DevOps Security"
260256
%}
261257

262-
263258
On the screen that will appear click the*New token* Button. Enter an arbitrary name for the token and select the correct
264259
**Organization** from the drop-down menu. Remember your organization name as you will use it later in the Codefresh side.
265260
Select an expiration date for your token
266261

267262
>At the time of writing Azure DevOps does not have the option to create a token that is valid for ever. Choose a large
268263
time period and make sure that you have a policy in place for renewing your tokens so that Codefresh can continue to read your Git repo.
269264

270-
{% include image.html
271-
lightbox="true"
272-
file="/images/integrations/git/azure-devops-token.png"
265+
{% include image.html
266+
lightbox="true"
267+
file="/images/integrations/git/azure-devops-token.png"
273268
url="/images/integrations/git/azure-devops-token.png"
274269
max-width="60%"
275270
caption="Azure DevOps Token"
@@ -288,9 +283,9 @@ Finally click the *Create* button and copy your token (it will never be shown ag
288283

289284
Then at the Codefresh configuration enter your organization name and your token.
290285

291-
{% include image.html
292-
lightbox="true"
293-
file="/images/integrations/git/azure-devops-verify.png"
286+
{% include image.html
287+
lightbox="true"
288+
file="/images/integrations/git/azure-devops-verify.png"
294289
url="/images/integrations/git/azure-devops-verify.png"
295290
max-width="40%"
296291
caption="Codefresh integration with Azure Devops"
@@ -300,9 +295,9 @@ alt="Codefresh integration with Azure Devops"
300295
Click on*Test connection* to verify your settings and finally click save. Now you can[create pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/)
301296
that use Azure DevOps Git repos.
302297

303-
{% include image.html
304-
lightbox="true"
305-
file="/images/integrations/git/azure-devops-connected.png"
298+
{% include image.html
299+
lightbox="true"
300+
file="/images/integrations/git/azure-devops-connected.png"
306301
url="/images/integrations/git/azure-devops-connected.png"
307302
max-width="40%"
308303
caption="Codefresh integration with Azure Devops"
@@ -313,57 +308,81 @@ Your Azure DevOps repositories will be available when [creating a new project in
313308

314309
If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
315310

316-
##Atlassian Stash
311+
##Atlassian Stash
317312

318313
Atlassian stash is only available for an on-premises connection. Follow the same instructions as Bitbucket.
319314
You also need to provide the URL of the Stash server in your organization.
320315

321316
This option is only for Atlassian stash until version 3.10 which is the old version. It was then renamed
322317
to Bitbucket server.
323318

324-
325319
##Bitbucket Server
326320

327321
Bitbucket server is the new and current name of Atlassian Stash. Again, it is only available for an on-premises
328322
installation.
329323

330324
Codefresh supports Bitbucket server versions 5.4.0+ since those expose the API used by the integration.
331325

332-
###Usingexternal secrets forthe token
326+
###UsingExternal Secrets forBitBucket Token
333327

334328
If your Bitbucket Server installation is behind your firewall, you can also
335329
use any[external secrets that you have defined]({{site.baseurl}}/docs/integrations/secret-storage/) (such as Kubernetes secrets) as values by entering a secrets value
336330
with the same syntax[shown in pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/secrets-store/).
337331

338332
For example if you already have a`token` on a resource call`git-credentials` you can put in the token field the expression {% raw %}`${{secrets.git-credentials@token}}`{% endraw %}.
339333

340-
341334
##Using your Git provider
342335

343336
Once your provider is active, you can add a new project into Codefresh and then during the[repository selection screen]({{site.baseurl}}/docs/getting-started/create-a-basic-pipeline/) you will have access to the additional Git providers.
344337

345-
{% include image.html
346-
lightbox="true"
347-
file="/images/integrations/git/select-git.png"
338+
{% include image.html
339+
lightbox="true"
340+
file="/images/integrations/git/select-git.png"
348341
url="/images/integrations/git/select-git.png"
349342
max-width="60%"
350343
caption="Select Git provider"
351344
alt="Select Git provider"
352345
%}
353346

354347
>Notice that for all supported Git providers Codefresh will automatically create all the webhooks needed for
355-
triggering pipelines when a commit (or another event) happens.
348+
triggering pipelines when a commit (or another event) happens.
356349

357350
After adding the repository Codefresh will behave exactly the same, regardless of the selected Git provider.
358351
You will be able to[create pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/) for different Git providers in exactly the same manner.
359352

360-
##What to read next
353+
##ABAC for Git Contexts
354+
355+
**Account Level:** Pro and above
356+
357+
>At this time, you will need to reach out to support to enable ABAC for Git Context and[Pipeline Execution Context]({{site.baseurl}}/docs/administration/pipeline-execution-context/).
361358
362-
-[Creating pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/)
363-
-[Git triggers]({{site.baseurl}}/docs/configure-ci-cd-pipeline/triggers/git-triggers/)
364-
-[Git clone step]({{site.baseurl}}/docs/codefresh-yaml/steps/git-clone/)
365-
-[Checking out source code]({{site.baseurl}}/docs/yaml-examples/examples/git-checkout/)
359+
ABAC for Git Context gives the ability to restrict using and handling of Git Contexts. We use tags on the git context to limit Teams and Execution Contexts for access control. There are four actions controlled by ABAC: Creating, Updating, Deleting, and Using Git Contexts.
366360

361+
The Using means the following use cases:
367362

363+
* Creating trigger
364+
* Getting YAML from a repository
365+
* Using the Git Context in a pipeline (git clone step etc.) via Execution Context.
368366

367+
You will get an error of Permission Denied or Forbidden to a Git Context that you do not have the correct permissions for that action.
368+
369+
###Tagging the Git Context
370+
371+
1. Navigate to Account Settings > Integrations > Configure for Git.
372+
1. Hovering over the integration name (Git Context), you will see "Edit Tags" just before the edit symbol.
373+
1. Select "Edit Tags," and you can add and remove tags.
374+
1. Click Save when done.
375+
376+
###Setting the Permissions
377+
378+
1. Navigate to Account Settings > Permissions > Teams or Execution Context.
379+
1. Scroll to Git Contexts.
380+
1. Here, you can set[permissions]({{site.baseurl}}/docs/administration/access-control/#creating-a-security-policy) similar to other ABAC rules for Teams or Execution Context to Create or Use, Update, and Delete actions.
381+
1. Click Add Rule when done.
382+
383+
##What to read next
369384

385+
*[Creating pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/)
386+
*[Git triggers]({{site.baseurl}}/docs/configure-ci-cd-pipeline/triggers/git-triggers/)
387+
*[Git clone step]({{site.baseurl}}/docs/codefresh-yaml/steps/git-clone/)
388+
*[Checking out source code]({{site.baseurl}}/docs/yaml-examples/examples/git-checkout/)

‎_docs/whats-new/whats-new.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ toc: true
1212
###October 2021
1313

1414
- Monorepo triggers for Azure DevOps repositories -[documentation]({{site.baseurl}}/docs/configure-ci-cd-pipeline/triggers/git-triggers/#monorepo-support-modified-files)
15+
- ABAC for Git Contexts -[documentation]({{site.baseurl}}/docs/integrations/git-providers/#abac-for-git-contexts)
1516

1617
###September 2021
1718

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp