Skip to content

Add Items From the Library

An approved item of the organization library can be placed in a model, as a new revision, or in a draft you are working on with the assistant. It goes in at its latest version, linked to the library and pinned at that version. Authors, administrators and the central team can add items to the models they may see.

  1. On the model’s page, open the Library tab. The model needs a valid current revision first.
  2. In Elements From the Library, choose Add From Library. The dialog goes step by step: Item, Where It Goes, Tab and Note, then Review.
  3. Item: type a name, key or kind in Search the Library to narrow the list, then choose the item. Each shows its kind, its key and its latest version. Only approved items are offered: a deprecated item is not, and neither is a dependency, which describes the environment and is never placed in a model.
  4. Where It Goes: what the item’s kind asks for. See What each kind asks for.
  5. Tab and Note: Tab (Optional), the diagram to add it to, when the model has tabs; left empty, it goes on the first. Note (Optional), the note of the new revision; left empty, it names the item and its version.
  6. Review: check what will be added. Change beside a part goes back to its step.
  7. Choose Add the Item.

A message in the corner says the item was added as a new revision. The element appears under Elements From the Library, with its Pinned Version.

Kind What You Give
Service Zone (optional): the zone of the model it goes in. Left empty, it goes in the item’s own zone.
Appliance Zone (optional): the zone whose edge it sits on. Left empty, it uses the item’s own zone.
Zone Parent Zone (optional): the zone of the model to put it inside. Left empty, it goes at the top.
Threat Applies To: at least one element of the model the threat applies to.
Control Implemented On (optional): the elements of the model the control is implemented on.

For Applies To and Implemented On, choose Add an Element for each one, pick its kind (Service, Component, Appliance, Flow or Zone) and type its name as it is in the model. The bin icon beside a row removes it.

A service or appliance stencil can carry enterprise controls. When you add it, each of its controls is added too, implemented on the new element and linked to the library, in the same revision. You do not add them one by one.

Before anything is saved, the engine checks the model with the new item in it. If it finds errors, nothing is saved: the dialog says “The engine found errors in the model with this change, so nothing was saved.” and lists them under What the Engine Found, each with where in the model it is. Your choices stay in the dialog: change them on their steps and choose Add the Item again, or Cancel.

If the engine finds no errors, the model with the item becomes the next revision, the same as any revision. See Add a revision.

If someone else added a revision after you opened the model, nothing is added: the dialog says “Someone else added revision {number} after you opened this model.” and keeps your choices. Look at their revision on the model behind the dialog, then choose Add the Item again to add the item to it. See When someone else saved first.

On a draft’s page, choose Add From Library. It can be chosen once the assistant has made a first model in the draft.

The dialog is the same, without a note: its third step is Tab. The item goes into the draft’s model at its latest version, and the engine looks at the draft again. A message in the corner says whether the draft is still valid, or how many errors the engine finds in it now. A draft may hold errors while you work, so nothing is refused here.

Nothing is linked yet. When you save the draft as a revision, each item you added becomes a link of the model, pinned at the version it was added at. An item you took out of the draft again before saving is not linked. See Build a model with the assistant.

A model file can say which of its elements came from your organization’s library. When the engine writes library items into a model, each element carries a library field which names, among other things, the item’s key and the version it holds:

{
"library": {
"source": "organization",
"item": "std-waf",
"version": "2",
"altered": false
}
}

Whenever a revision is saved with such fields, by upload, import, a draft or the library itself, every element that names an item of your library, at a version the item has, is linked at that version if it is not linked already. An element marked "altered": true is linked as altered, with its altered_reason if it has one. A key the library does not have, or a version it never published, makes no link. A zone carries no such field, so a zone is linked only when it is added from the library.

When an element that came from the library is taken out of the model, its link goes with it, in the revision that takes it out.

These events are recorded in the activity log, about the model, so only people who can see the model see them:

  • Library item added: an item was placed in the model, or a draft holding it was saved. A stencil’s enterprise controls are each recorded too.
  • Library link found: a saved revision named an item in its library fields, and a link was made.
  • Library link removed: an element that came from the library left the model.