Connect a repository

The connection model across GitHub, GitLab, and Bitbucket, and how to revoke it.

7 sections3 min read

Cefense reads your code through your provider, using a credential you grant and can withdraw. There is nothing to install into your infrastructure and no key for you to paste anywhere.

How connections work

A connection has two levels. First you connect the account, which is what lets Cefense see a list of repositories at all. Then you connect individual repositories from that list, and only those are ever scanned.

Connecting a repository queues its first scan straight away. Once connected, a repository behaves the same regardless of which provider it came from: the same scans, findings, branches, commits, and fixes.

How many you can connect

The plan sets it: 2 repositories on Free, 10 on Plus, unlimited on Pro and Max. The count is checked when you connect a new one, and a connection past the limit is refused with repository_limit rather than accepted and left half working.

The three providers

From the terminal

The CLI connects repositories from all three hosts. cf provider list says which accounts are connected, and cf repo connect --provider <host> lists that host's repositories and connects the ones you choose.

All three, from the terminalbash
cf provider list
cf repo connect --provider gitlab
cf repo connect acme/api
cf repo disconnect --account --provider bitbucket

What access is used for

AccessWhy it is neededWhen it is used
Read repository contentsTo fetch the commit being scannedEvery scan
Read repository metadataTo list branches and commitscf branches, cf commits, the workspace
Write repository contentsTo create the branch and commit a patchOnly when you publish a fix
Read and write pull requestsTo open a pull request and merge itOnly when you publish or merge

Disconnecting

One repository, or the whole accountbash
cf repo list
cf repo disconnect acme/api
cf repo disconnect --account --provider github
cf provider disconnect gitlab

Disconnecting one repository stops it being scanned and removes it from the workspace. Disconnecting the account removes the connection itself, so no repository from that account can be scanned until you connect it again.

You can also revoke access from the provider's own settings at any time, without going through Cefense. That is the stronger action, and it takes effect immediately.

Deleting everything

Deleting your Cefense account revokes the provider grants, removes the app installation, and deletes your repositories, scans, findings, and fixes. See Security and data handling.

Have a correction or need help?

Email the docs team