# Tarsana image spec v2

This is what an image spec can say. Write it in YAML or JSON: the two are read the same way. In the portal, leave `metadata.tenant` out and your tenant ID is filled in; if you keep it, it must be your tenant ID.

What each field does, the smallest spec and recipes are in the [Spec reference](/spec).

The schema itself is at [https://docs.tarsana.io/schemas/image-spec/v2.schema.json](https://docs.tarsana.io/schemas/image-spec/v2.schema.json). Tools that read schemas know it by its name, `https://schemas.tarsana.io/image-spec/v2.schema.json`.

## Fields {#fields}

| Field | Required | Value |
| --- | --- | --- |
| `schema_version` | yes | text |
| `metadata` | no | a mapping |
| `distro` | yes | one of `ubuntu`, `debian`, `almalinux` |
| `snapshot_id` | yes | text |
| `base_ref` | yes | text |
| `repos` | no | a list of mappings |
| `packages` | no | a list of mappings |
| `files` | no | a list of mappings |
| `service_accounts` | no | a list of mappings |
| `workload` | no | a mapping |
| `state` | no | a mapping |
| `hardening_profile` | no | one of `none`, `tarsana-baseline`, `cis-level1`, `cis-level2`, `stig`, `pci-dss` |
| `hardening_packages` | no | a list of text values |
| `retain_generated_key_material` | no | a mapping |
| `policy_class` | yes | text |
| `layers` | no | a list of mappings |
| `placement` | no | a mapping |
