Pub security
Dartastic Pub scores every package you publish, and it applies your organization's security policy to every package it serves, public ones included. This page explains the scores, the policies, what a refusal means and what to do about it.
The Scores tab
Each package's Scores tab on your Dartastic Pub shows two numbers. After a version is published, Dartastic Pub analyzes the latest stable and the latest prerelease version of the package in an isolated worker with no internet access.
- Pub points: pana's 160-point report, the one pub.dev shows. One line differs: the license line passes for a real license of any kind, because a commercial license is right for private code. A missing, empty or placeholder license still fails it, and the tab says the line was changed.
- Security Score: 0 to 100 with a grade, for what pana doesn't check. Each check shows what it looked at, what it found and how to fix it.
When an analysis can't finish (it ran out of memory or time, or a dependency couldn't be resolved), the tab says so and why, instead of showing a low score.
The Security Score's checks
| Check | Points | What it looks at |
|---|---|---|
| Known advisories | 30 | Known security advisories on this version and on every package it resolved to. |
| Secrets in the archive | 20 | Tokens, keys and credential files left in the archive. Anyone who can read the package sees what kind was found; only its admins see where. |
| Review verdict | 10 | A security review's verdict on this version. |
| Binaries and build hooks | 15 | Native binaries and build hooks in the archive, each recorded with its sha256. They earn these points once they are reviewed and allowed. FFI on its own doesn't cost them. |
| Publisher and provenance | 15 | Who publishes the package, and whether that changed. |
| Same uploader as the last release | 5 | Whether the person who uploaded this version also uploaded the one before. |
| Release age | 5 | Whether the release is at least 7 days old. |
- A check with nothing to go on is left out: the score is scaled over the checks that ran, and the tab lists the ones that didn't. It is never counted as a pass.
- Grades: A from 90, B from 80, C from 70, D from 60, F below 60. A and B show blue, C yellow, D and F red.
- A quarantined or denied version scores 0. An admin can set either score by hand; the tab then says so, and the computed score stays on the record.
- A score reports what was checked. It does not promise that a package is safe.
Your organization's security policy
Each organization has one policy, Standard unless an admin changes it. It decides how long new public versions wait and what happens to a version flagged in review.
| Policy | New public versions | A version flagged in review |
|---|---|---|
| MonitorFull visibility, no interruptions | Served right away | Served and counted |
| StandardBalanced protection for production teams | Wait 3 days | Served, and flagged on the package page |
| StrictMaximum control for regulated environments | Wait 7 days, and wait for a person while a review is open | Not served |
Your organization's own packages never wait and are never held for review. No policy serves a quarantined or denied version.
New public versions wait
A public version younger than your policy's limit is left out of the versions your Dartastic Pub serves, so dart pub get resolves to the newest version old enough. Nothing fails. An admin can approve a version early, or reject one.
If a lockfile already pins a version that is still waiting, dart pub get refuses it and names the date it becomes available.
Review and verdicts
Some signals send a version to review: a name one typo away from a popular package, a public package whose publisher changed, a long-dormant package that suddenly releases, or a new uploader on a package of yours. Under Strict, the version waits while its review is open.
A review ends in a verdict. allow serves the version. warn serves it, flagged on its page, except under Strict. quarantine and deny stop it for every organization.
Quality gates
An organization admin can set a quality gate: a minimum pub points, a minimum Security Score, and checks that must pass. A version below the gate is left out of the versions your organization is served, so dart pub get can't choose it.
A public package has no pub points here, so a pub points minimum doesn't hold one back. A required check must have passed, so one that didn't run fails it.
Your CI can ask whether a version passed, with the same Pub token it reads with. The answer's status is allow, warn, block or pending. Keep polling while it is pending, which means the analysis hasn't finished:
curl -sS -H "Authorization: Bearer $PUB_TOKEN" \
https://pub.dartastic.io/api/dartastic/security/quality-gate/acme_models/1.3.0{
"package": "acme_models",
"version": "1.3.0",
"status": "block",
"securityScore": 73,
"pubPoints": 140,
"reasons": ["Security Score 73 is below 80."],
"gate": { "action": "block", "minSecurityScore": 80, "minPubPoints": 120, … }
}To let one version past the gate, an organization admin exempts it, with a reason. That lifts the gate for that version only.
When dart pub get refuses a version
A refusal says why and what to do. What each one means:
| The message | What it means |
|---|---|
Your organization's security policy holds <package> <version> until <date>. | Your policy holds this public version until the date shown. Wait, depend on an older version, or ask an organization admin to approve it early. |
Your organization's security policy holds every version of <package>. | Every version of this public package is younger than your policy allows. The first becomes available on the date shown. |
An organization admin rejected <package> <version>. | An organization admin rejected this version. Depend on another one, or ask them to lift it. |
<package> <version> is quarantined while it is reviewed. | The version is under review and served to no one until the review ends. Depend on another version. |
<package> <version> was denied. | A review found this version bad. Depend on another version. |
A security review flagged <package> <version>, … | A review flagged this version, and your policy (Strict) doesn't serve flagged versions. Depend on another version, or ask an organization admin for an exemption. |
<package> <version> is waiting on a security review, … | The version has an open review, and your policy (Strict) waits for it to close. Depend on another version, or ask an organization admin to exempt it. |
<package> <version> does not meet your organization's quality gate. | The version falls below your organization's quality gate; the message lists why. Depend on another version, or ask an organization admin to exempt it. |
The security page
Organization admins manage all of this on the security page, https://pub.dartastic.io/security-admin, signed in to your Dartastic Pub. Every action there is audited with who took it and when. There an admin can:
- Approve early, or reject, a version the policy holds
- Quarantine, unquarantine or deny a version of the organization's own packages
- Set a score by hand on the organization's own packages
- Add or remove an exemption, with a reason
- Choose the organization's policy and its quality gate
- See every version under a verdict or a known advisory that the organization pulled, who pulled it, how often and when, and which of its packages depend on it