Security
Baselines
A baseline is what one repository, workflow or job was seen connecting to: each destination, with the ports and protocols it used, and how many connections and runs it appeared in. CargoWall builds baselines from your runs, in audit or enforce, so you can see what a workflow needs before you write its policy, and convert what it learned into one.
How Baselines Work
CargoWall creates baselines on its own the first time a job that runs the CargoWall step reports, at three levels:
| Scope | Learns from | Named |
|---|---|---|
| Repository | Every workflow in the repository | [auto] repo:<repository> |
| Workflow | Every job in one workflow file | [auto] workflow:<repository>/<path> |
| Workflow Job | One job in a workflow | [auto] job:<repository>/<path>/<job> |
A new baseline is Learning: each run adds the destinations it saw. It becomes Stable once it has seen its target number of runs, 25 for the baselines CargoWall creates, and everything it learns from has run at least once:
- A repository baseline waits for every default-branch workflow that reported CargoWall traffic within your plan's CargoWall history.
- A workflow baseline waits for every such job in the workflow.
- A job baseline needs only its target.
So a baseline can show 25/25 and still be learning, until a workflow or job that rarely runs comes round. CargoWall checks every 15 minutes. A run only counts if the job made at least one connection.
A stable baseline stops learning. When a workflow's needs change, recompute its baseline.
Notifications
Baselines ready to enforce tells you when repository baselines reach their target, and Stalled baselines when a repository baseline still learning has had no run for 14 days. Workflow and job baselines don't notify. See Notifications.
The Baselines Tab
The Baselines tab lists your organization's baselines with their scope, status and progress: how many of its target runs a learning baseline has seen, or how many runs a stable one learned from. A repository's or workflow's CargoWall tab lists just its own, and the Policy Manager's Chain view shows them at each level.
Expand a baseline to see what it learned: each destination with its port and protocol, and its connection and run counts. In the Policy Manager's Chain view, Allow on an entry adds it to a policy with the same port and protocol. See Allow a Destination.
Anyone in the organization can see baselines for the repositories they can read. Only an organization admin can create, rename, recompute, convert or delete one.
Create a Baseline
To learn from a different number of runs, or start from runs that already happened:
- Open a repository's or workflow's CargoWall tab and switch to Baselines.
- Click Create baseline.
- Enter a Name, the Learning Run Target, and, to start from history, Seed from Last Runs with how many recent runs to learn from.
- Click Submit.
When a repository or workflow has no baselines, anyone but an organization admin is told to ask one to create a baseline.
Baseline Actions
Each baseline's options menu (⋯) has:
| Action | What it does |
|---|---|
| Rename | Changes the baseline's name |
| Recompute | Relearns the baseline from recent runs |
| Convert to Policy | Creates a policy from what the baseline learned. Only for Stable baselines |
| Delete | Removes the baseline, after you confirm |
Recompute a Baseline
Recompute clears what the baseline learned and relearns it from the most recent runs of its repository, workflow or job. Enter the Run Count to learn from, then click Submit. The baseline goes back to Learning, and becomes Stable straight away when the count reaches its target and everything it learns from has run.
Convert a Baseline to a Policy
- Open a stable baseline's options menu (⋯) and choose Convert to Policy.
- Enter a Policy Name. It starts as the baseline's name followed by "Policy".
- Click Submit. Each destination the baseline learned becomes an allow rule, with its ports. An IP address becomes a
/32CIDR block. A destination the baseline saw only as a DNS lookup gets a rule with no ports, which allows every port, and auto-allowed hosts are included. - Assign the new policy where it should apply. Converting doesn't assign it.
Review the rules before you enforce. A baseline allows exactly what it saw, including anything a compromised dependency reached while it was learning.
AI Policy Advisor
The AI Policy Advisor writes a minimal policy from a workflow's or job's baseline. It needs a plan that includes AI features.
- Expand a workflow or job baseline. The AI Policy Advisor card is at the top.
- Click Generate. An AI chat opens in the sidebar. The advisor reads the baseline and the workflow file, and proposes an allow list, using wildcards sparingly, whether to turn on sudo lockdown, and why.
- Refine the proposal in the chat. Mention other workflows or jobs with @ to cover them too.
- Review it in the Policy Manager: select the workflow or job and open Proposed, or follow Review in Policy Manager from the card. For a job baseline, that link opens the Policy Manager with nothing selected, so select the job under Entities. Each proposal has Dismiss and Apply. To reopen its conversation, click the thread name after From thread:. A proposal from another member's conversation reads Proposed by and their name. At the foot of the Entities tab, Dismiss All and Apply All act on every waiting proposal, for every workflow and job.
Apply replaces every rule in the workflow's or job's default policy with the proposal, and sets its sudo lockdown when the proposal includes it. Assigned and inherited policies aren't changed. Applying needs the same access as changing that default policy.
