-
Notifications
You must be signed in to change notification settings - Fork 2
Specs M2 Assets Site
context.models.site.Site
Physical location covered by the ISMS (head office, datacenter, office, factory, warehouse, remote site). Serves as a geographic container for support assets and suppliers, and enables the "assets / suppliers per site" mapping.
Sites were initially modelable both as standalone entities and through the site type of SupportAsset (with its subcategories datacenter / office / remote_site / cloud_region / other_site). This dual modeling was removed (issue #30, migrations context.0028 + assets.0029). Decision: a site is not a support asset, it is a container of support assets. The distinction is now:
| Model | Used to... |
|---|---|
Site |
describe a physical location (address, hierarchy, attached scopes) |
SupportAsset |
describe a technical or human asset (with owner, CIA levels, lifecycle, etc.) |
SiteAssetDependency |
attach a support asset to its hosting site |
SiteSupplierDependency |
attach a supplier to a site it serves |
The site type of SupportAsset no longer exists. Existing rows were automatically converted to Site at migration time; the support assets that hosted those sites must be re-attached via SiteAssetDependency.
| Field | Type | Constraints | Description |
|---|---|---|---|
id |
UUID | PK, auto-generated | Unique identifier |
reference |
string | auto-generated SITE-N, unique |
Business reference |
scopes |
relation | M2M -> Scope | Attached ISMS scopes (RG-01). A site can cover several scopes (case of multiple subsidiaries sharing the same datacenter). |
name |
string | required, max 255 | Name of the site (e.g. "Lyon Part-Dieu head office", "Bron datacenter") |
type |
enum | required, default other
|
headquarters, office, factory, warehouse, datacenter, remote, other
|
address |
text | optional | Postal address, map, access directions |
description |
text | optional | Free-text description |
parent_site |
relation | FK -> Site, optional | Site hierarchy (group -> subsidiary -> site). Cycles rejected by clean(). |
workflow_state |
enum | required, default draft
|
Standardised site lifecycle (core.lifecycle): draft, commissioning, operational, review, decommissioned, archived. See the Lifecycle section and governance/workflow.md. |
tags |
relation | M2M -> Tag | Free-text labels |
version |
int | auto-incremented | Bumped on each major change |
created_by |
relation | FK -> User | Creator |
created_at |
datetime | auto | Creation date |
updated_at |
datetime | auto | Last modification date |
-
headquarters: head office -
office: office / administrative premises -
factory: factory / production site -
warehouse: warehouse / logistics center -
datacenter: datacenter (owned or colocation). Now also includes the formercloud_regionvalues of support assets, which are folded into this category by theassets.0029migration for lack of a dedicated entry. -
remote: remote site, organized teleworking, secondary site -
other: other case
The displayed labels are localized via the i18n layer (.po). The former French values (siege, bureau, usine, entrepot, site_distant, autre) were renamed to English by the context.0027 migration (issue #31).
parent_site makes it possible to model a tree: Group -> Subsidiary -> Site -> Building. The clean() rule detects and rejects cycles. There is no depth constraint nor consistency constraint between the scopes of a parent and its children: a child site can belong to a scope that its parent does not have (case of multiple subsidiaries sharing a site).
The site runs the standardised lifecycle engine (core.lifecycle, defined in context/lifecycles.py as the site lifecycle, layout="graph"), rendered with the directed-graph stepper on the detail page. It models the operational life of a physical location:
| Step | Code | Authoritative? | Meaning |
|---|---|---|---|
| Draft | draft |
no (deletable) | Initial stub, just created. |
| Commissioning | commissioning |
no | Being brought online (built, fitted out, connected). |
| Operational | operational |
yes (counts in reports, linkable) | In service. |
| Under review | review |
yes (counts in reports, linkable) | Periodic re-examination of an in-service site; loops back to Operational. |
| Decommissioned | decommissioned |
no | Taken out of service for good; kept for traceability. |
| Archived | archived |
no | From-any exit; can be restored to Draft. |
Transitions: draft -> commissioning -> operational; operational <-> review (periodic loop); operational -> decommissioned; any -> archived; archived -> draft (restore). Only the operational and review steps count in reports and are linkable, mirroring the governance the legacy default workflow expressed (only the validated-equivalent state counted / linked). The web detail page (transitions via the generic stepper), the REST .../transition/ action and the MCP transition_site / site_allowed_transitions tools all route through the lifecycle service, which records a LifecycleEvent for every move.
The detail page itself uses the standardised 2-column layout (hero overview with an address map, sub-sites, hosted-asset and supplier dependencies, an audit-metadata card, and a sticky KPI rail).
assets.models.site_dependency.SiteAssetDependency
A support asset (server, network equipment, etc.) is hosted or located at a site. The relation carries its own reference (SADP-N), a dependency type, a criticality and an is_single_point_of_failure flag computed automatically.
| Field | Type | Constraints | Description |
|---|---|---|---|
id |
UUID | PK | |
reference |
string | auto-generated SADP-N, unique |
|
site |
FK -> Site | required | Site that hosts the asset |
support_asset |
FK -> SupportAsset | required | Hosted support asset |
dependency_type |
enum | required |
located_at, hosted_at, deployed_at, other
|
criticality |
enum | required |
low, medium, high, critical
|
description |
text | optional | |
is_single_point_of_failure |
boolean | read-only | Computed by the SPOF detection service (M2 §3.3 RS-07) |
redundancy_level |
enum | optional |
none, partial, full
|
assets.models.site_dependency.SiteSupplierDependency
A supplier serves / operates / maintains a site.
| Field | Type | Constraints | Description |
|---|---|---|---|
id |
UUID | PK | |
reference |
string | auto-generated SSDP-N, unique |
|
site |
FK -> Site | required | Served site |
supplier |
FK -> Supplier | required | Supplier operating on the site |
dependency_type |
enum | required |
provides, hosts, manages, develops, supports, licenses, maintains, other
|
criticality |
enum | required |
low, medium, high, critical
|
description |
text | optional | |
is_single_point_of_failure |
boolean | read-only | Computed by the SPOF detection service |
redundancy_level |
enum | optional |
none, partial, full
|
| ID | Rule |
|---|---|
| RG-SITE-01 | A site can be attached to one or more Scope. A site without a scope is valid (cross-cutting site). |
| RG-SITE-02 | The parent_site hierarchy does not tolerate cycles. Detected at clean(). |
| RG-SITE-03 | The lifecycle step (workflow_state) is unconstrained across sites: any number of sites can be operational at once (the single-active rule of the Context module was removed because of the multi-scope hierarchy). |
| RG-SITE-04 |
is_single_point_of_failure on site dependencies is computed by the assets.services.spof_detection service. The value provided on write is ignored. |
-
GET /api/v1/context/sites/: list with filterstype,workflow_state,parent_site_id POST /api/v1/context/sites/GET /api/v1/context/sites/<uuid>/PUT/PATCH /api/v1/context/sites/<uuid>/DELETE /api/v1/context/sites/<uuid>/-
GET/POST /api/v1/context/sites/<uuid>/transition/: list the caller's allowed lifecycle transitions (GET) or perform one (POSTtarget_state, optionalcomment) - The
SiteAssetDependencyandSiteSupplierDependencyhave their own routes under/api/v1/assets/site-asset-dependencies/and/api/v1/assets/site-supplier-dependencies/.
-
list_sites/get_site/create_site/update_site/delete_site/batch_create_sites -
transition_site/site_allowed_transitions(lifecycle transitions, route through the lifecycle service) -
list_site_asset_dependencys/create_site_asset_dependency/ ... -
list_site_supplier_dependencys/create_site_supplier_dependency/ ...
| Codename | Description |
|---|---|
context.site.read |
Read sites |
context.site.create |
Create a site |
context.site.update |
Modify a site |
context.site.delete |
Delete a site |
The historical SupportAsset[type=site] rows were converted to Site by the assets.0029 migration. The mapping applied:
Former SupportAsset.category
|
New Site.type
|
|---|---|
datacenter |
datacenter |
office |
office |
remote_site |
remote |
cloud_region |
datacenter |
other_site |
other |
The other fields of the support asset (owner, CIA, lifecycle dates, etc.) are not transferred to Site, which does not model them. The AssetDependency records that pointed to those support assets were deleted by cascade: they must be recreated as SiteAssetDependency on the Site side if the relation makes sense.
- SupportAsset, AssetDependency, Supplier (supplier, spec to come, issue #35)
- Migrations:
context.0027(rename FR -> EN),context.0028(scopes M2M),assets.0029(drop site type + conversion),context.0034(migrate onto the standardisedsitelifecycle) - Issues: #30 (this spec), #31 (rename FR -> EN)
Built from docs/ at v0.36.0. Edits made here are overwritten by the next release : open a pull request against the source instead.
- Administration
- Ask Cairn
- Assets and suppliers
- Compliance
- The dashboard
- Finding your way
- Getting started
- Incidents
- How records move
- Organisational context
- Reports and management review
- Risks
- Trust Center
- Architecture
- Configuration
- Contributing
- The documentation system
- Installation
- Internationalisation
- Operations
- Release process
- Security
- Testing
- Adding an assistant provider
- Adding a dashboard widget
- Adding a domain entity
- Declaring a lifecycle
- Adding an MCP tool
- Adding a REST endpoint
- Adding a report
- Interface conventions
- Dashboard widgets
- Lifecycles
- MCP tools
- MCP tool parameters : Assets
- MCP tool parameters : Compliance
- MCP tool parameters : Governance and context
- MCP tool parameters : General
- MCP tool parameters : Incidents
- MCP tool parameters : Reports and management review
- MCP tool parameters : Risks
- MCP tool parameters : System and administration
- MCP tool parameters : Trust Center
- Management commands
- Models
- Permissions
- REST endpoints
- Environment variables
- MCP server
- REST API
- Assistant module (Ask Cairn)
- Module 0: User Management and Access Control
- Module 1: Context and Organization
- Module 2: Asset Management
- Module 3: Compliance
- Module 4: Risk Management
- Module 4 bis - EBIOS Risk Manager
- Module 5 : Trust Center
- Module 6 : Security Incident Management
- Management review : ISO 27001:2022 compliance (clause 9.3)