- In the console: each project’s Code security tab shows the scans, the records and the runs, and the settings pages choose how a scan runs. See Code security scans of a repository.
- Through the API: read the records and runs, set your team’s decisions, start a scan and change the settings. See Code security API.
What it is, and what it isn’t
Code security and code review read the same repositories through the same connection, but they do different jobs:
Code security posts nothing on a pull request or merge request: no comment, no check, no pipeline status, no build status. It doesn’t start from a push and doesn’t scan other branches. It never changes the repository: a record’s fix is shown for you to apply. The code it runs stays in its sandbox, so it never reaches your deployments or any other live service. To test a running app, use verification.
Where it runs
Code security scans repositories on every Git host IronBee connects to:
It works the same on each host. A scan clones the repository through the connection IronBee already has, reads only the code, and writes nothing to the host. On a registered tenant, server or instance, the clone comes from IronBee’s one address, like every other call IronBee makes there.
Scans run on IronBee’s infrastructure:
- Each scan runs on a machine of its own.
- The code it runs has no network access. With Execution on, only the dependency install reaches the public package registries.
- The scan is given no secrets: none of the project’s secrets, variables or environments, and the code it runs can’t reach the token used for the clone or any IronBee credential.
Turn it on
Code security is turned on one repository at a time. An owner or an admin does one of these:- clicks Turn on on the project’s Code security tab. See Turn it on.
- turns on Scan this repository in the project’s Settings > Code security. See Repository settings.
- sets
enabledtotruethrough the API. See Change a repository’s settings.
What a scan does
A scan reads the default branch and writes a record for each problem it finds. Three settings shape it, at the account and for each repository:- Profile: how far a scan follows what it finds. Auto (the default) picks Standard for smaller repositories and Quick for larger ones, and never Deep. See Profile.
- Execution: whether a scan may run the repository’s code to prove what it finds. Off by default. See Running your code.
- Scheduled scan: how often a scan comes: Daily, Weekly (the default), Every two weeks or Monthly.
Records, verdicts and decisions
A record is one problem a scan found. A later scan that sees the same problem again updates its record instead of adding another. Every record has a verdict:- Confirmed: the scan reproduced the problem by running the code. Only a confirmed finding has a severity: Critical, High, Medium, Low or Informational.
- Lead to validate: the scan couldn’t prove it yet. The record says what blocks a verdict and how to validate it yourself. With Execution off, everything a scan finds stays a lead.
- Rejected: a scan found that it doesn’t hold.
Credits
Code security uses the team’s credits, as code review and verification do. A scan is priced when it starts, before it reads anything, by the repository’s size outside the paths to ignore, the profile and whether Execution is on. It’s charged when it finishes. What uses credits:- a full scan: the first scan, one you ask for with Run full scan or through the API, and the next scan after Paths to ignore changed
- a scheduled or API scan of a period in which the default branch moved
- Execution, which makes a scan cost more
- a follow-up run, which finishes a scan already paid for
- a period in which the default branch didn’t move, or changed only in ignored paths
- a scan that fails, or that’s refused before it reads the code, such as when the credits left don’t cover it
- reading records and runs, setting decisions and changing settings, in the console or through the API
Who can see it
Only owners and admins see code security: the Code security tab, its records and runs, and its settings at both levels. Only they turn it on, start a scan, set a decision and change the settings. Members and billing admins don’t see the tab or the settings pages. See Roles and permissions. Through the API, the account API key acts as an owner, and a personal OAuth token acts with its user’s role, so it works for owners and admins only. See Authentication.What’s next?
How a scan works
What a scan reads, when it runs, follow-up runs, and what running your code means.
Code security API
Read records and runs, set decisions, start a scan and change the settings.
Code security in the console
The project’s tab: where a scan stands, the scan summary and Run full scan.
Security records and runs
Read a record, decide on it, and see every scan that ran.
Code security settings
Choose the profile, the schedule, execution and the paths a scan leaves out.
Code review
Reviews of every pull request and merge request, before they merge.