Skip to content

Commit 03c280f

Browse files
Merge pull request #222 from CycloneDX/v1.5-dev-formulation
Added formulation support and test cases
2 parents 9861a7a + db442bd commit 03c280f

File tree

6 files changed

+3469
-36
lines changed

6 files changed

+3469
-36
lines changed

schema/bom-1.5.proto

Lines changed: 325 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ message Bom {
3737
repeated Annotation annotations = 11;
3838
// Specifies optional, custom, properties
3939
repeated Property properties = 12;
40+
// Describes how a component or service was manufactured or deployed. This is achieved through the use of formulas, workflows, tasks, and steps, which declare the precise steps to reproduce along with the observed formulas describing the steps which transpired in the manufacturing process.
41+
repeated Formula formulation = 13;
4042
}
4143

4244
enum Classification {
@@ -253,6 +255,14 @@ enum ExternalReferenceType {
253255
EXTERNAL_REFERENCE_TYPE_MODEL_CARD = 32;
254256
// Plans of Action and Milestones (POAM) compliment an "attestation" external reference. POAM is defined by NIST as a "document that identifies tasks needing to be accomplished. It details resources required to accomplish the elements of the plan, any milestones in meeting the tasks and scheduled completion dates for the milestones".
255257
EXTERNAL_REFERENCE_TYPE_POAM = 33;
258+
// A record of events that occurred in a computer system or application, such as problems, errors, or information on current operations.
259+
EXTERNAL_REFERENCE_TYPE_LOG = 34;
260+
// Parameters or settings that may be used by other components or services.
261+
EXTERNAL_REFERENCE_TYPE_CONFIGURATION = 35;
262+
// Information used to substantiate a claim.
263+
EXTERNAL_REFERENCE_TYPE_EVIDENCE = 36;
264+
// Describes how a component or service was manufactured or deployed.
265+
EXTERNAL_REFERENCE_TYPE_FORMULATION = 37;
256266
}
257267

258268
enum HashAlg {
@@ -1144,8 +1154,10 @@ enum ComponentDataType {
11441154
COMPONENT_DATA_TYPE_CONFIGURATION = 1;
11451155
// A collection of data.
11461156
COMPONENT_DATA_TYPE_DATASET = 2;
1157+
// Data that can be used to create new instances of what the definition defines.
1158+
COMPONENT_DATA_TYPE_DEFINITION = 3;
11471159
// Any other type of data that does not fit into existing definitions.
1148-
COMPONENT_DATA_TYPE_OTHER = 3;
1160+
COMPONENT_DATA_TYPE_OTHER = 4;
11491161
}
11501162

11511163
message GraphicsCollection {
@@ -1160,5 +1172,316 @@ message GraphicsCollection {
11601172
// The graphic (vector or raster). Base64 encoding MUST be specified for binary images.
11611173
optional AttachedText image = 2;
11621174
}
1175+
}
1176+
1177+
// Describes workflows and resources that captures rules and other aspects of how the associated BOM component or service was formed.
1178+
message Formula {
1179+
// BOM unique reference to the resource.
1180+
optional string bom_ref = 1;
1181+
// Transient components that are used in tasks that constitute one or more of this formula's workflows
1182+
repeated Component components = 2;
1183+
// Transient services that are used in tasks that constitute one or more of this formula's workflows
1184+
repeated Service services = 3;
1185+
// List of workflows that can be declared to accomplish specific orchestrated goals and independently triggered.
1186+
repeated Workflow workflows = 4;
1187+
// Domain-specific formula properties.
1188+
repeated Property properties = 5;
1189+
}
1190+
1191+
// A specialized orchestration task.
1192+
message Workflow {
1193+
// BOM unique reference to the resource.
1194+
string bom_ref = 1;
1195+
// The unique identifier for the resource instance within its deployment context.
1196+
string uid = 2;
1197+
// The name of the resource instance.
1198+
optional string name = 3;
1199+
// A description of the resource instance.
1200+
optional string description = 4;
1201+
// Domain-specific resource instance properties.
1202+
repeated Property properties = 5;
1203+
// References to component or service resources that are used to realize the resource instance.
1204+
repeated ResourceReferenceChoice resourceReferences = 6;
1205+
// The tasks that comprise the workflow.
1206+
repeated Task tasks = 7;
1207+
// The graph of dependencies between tasks within the workflow.
1208+
repeated Dependency taskDependencies = 8;
1209+
// Indicates the types of activities performed by the set of workflow tasks.
1210+
repeated TaskType taskTypes = 9;
1211+
// The trigger that initiated the task.
1212+
optional Trigger trigger = 10;
1213+
// The sequence of steps for the task.
1214+
repeated Step steps = 11;
1215+
// Represents resources and data brought into a task at runtime by executor or task commands
1216+
repeated InputType inputs = 12;
1217+
// Represents resources and data output from a task at runtime by executor or task commands
1218+
repeated OutputType outputs = 13;
1219+
// The date and time (timestamp) when the task started.
1220+
optional google.protobuf.Timestamp timeStart = 14;
1221+
// The date and time (timestamp) when the task ended.
1222+
optional google.protobuf.Timestamp timeEnd = 15;
1223+
// A set of named filesystem or data resource shareable by workflow tasks.
1224+
repeated Workspace workspaces = 16;
1225+
// A graph of the component runtime topology for workflow's instance.
1226+
repeated Dependency runtimeTopology = 17;
1227+
}
1228+
1229+
// Describes the inputs, sequence of steps and resources used to accomplish a task and its output.
1230+
message Task {
1231+
// BOM unique reference to the resource.
1232+
string bom_ref = 1;
1233+
// The unique identifier for the resource instance within its deployment context.
1234+
string uid = 2;
1235+
// The name of the resource instance.
1236+
optional string name = 3;
1237+
// A description of the resource instance.
1238+
optional string description = 4;
1239+
// Domain-specific task instance properties.
1240+
repeated Property properties = 5;
1241+
// References to component or service resources that are used to realize the resource instance.
1242+
repeated ResourceReferenceChoice resourceReferences = 6;
1243+
// Indicates the types of activities performed by the set of workflow tasks.
1244+
repeated TaskType taskTypes = 7;
1245+
// The trigger that initiated the task.
1246+
optional Trigger trigger = 8;
1247+
// "The sequence of steps for the task.
1248+
repeated Step steps = 9;
1249+
// Represents resources and data brought into a task at runtime by executor or task commands
1250+
repeated InputType inputs = 10;
1251+
// Represents resources and data output from a task at runtime by executor or task commands
1252+
repeated OutputType outputs = 11;
1253+
// The date and time (timestamp) when the task started.
1254+
optional google.protobuf.Timestamp timeStart = 14;
1255+
// The date and time (timestamp) when the task ended.
1256+
optional google.protobuf.Timestamp timeEnd = 15;
1257+
// A set of named filesystem or data resource shareable by workflow tasks.
1258+
repeated Workspace workspaces = 16;
1259+
// A graph of the component runtime topology for task's instance.
1260+
repeated Dependency runtimeTopology = 17;
1261+
}
1262+
1263+
// Executes specific commands or tools in order to accomplish its owning task as part of a sequence.
1264+
message Step {
1265+
// A name for the step.
1266+
optional string name = 1;
1267+
// A description of the step.
1268+
optional string description = 2;
1269+
// Ordered list of commands or directives for the step
1270+
repeated Command commands = 3;
1271+
// Domain-specific step properties.
1272+
repeated Property properties = 4;
1273+
}
1274+
1275+
message Command {
1276+
// A text representation of the executed command.
1277+
optional string executed = 1;
1278+
// Domain-specific command properties.
1279+
repeated Property properties = 2;
1280+
}
1281+
1282+
// A named filesystem or data resource shareable by workflow tasks.
1283+
message Workspace {
1284+
// BOM unique reference to the resource.
1285+
string bom_ref = 1;
1286+
// The unique identifier for the resource instance within its deployment context.
1287+
string uid = 2;
1288+
// The name of the resource instance.
1289+
optional string name = 3;
1290+
// The names for the workspace as referenced by other workflow tasks. Effectively, a name mapping so other tasks can use their own local name in their steps.
1291+
repeated string aliases = 4;
1292+
// A description of the resource instance.
1293+
optional string description = 5;
1294+
// Domain-specific workspace instance properties.
1295+
repeated Property properties = 6;
1296+
// References to component or service resources that are used to realize the resource instance.
1297+
repeated ResourceReferenceChoice resourceReferences = 7;
1298+
// Describes the read-write access control for the workspace relative to the owning resource instance.
1299+
optional AccessMode accessMode = 8;
1300+
// A path to a location on disk where the workspace will be available to the associated task's steps.
1301+
optional string mountPath = 9;
1302+
// The name of a domain-specific data type the workspace represents.
1303+
optional string managedDataType = 10;
1304+
// Identifies the reference to the request for a specific volume type and parameters.
1305+
optional string volumeRequest = 11;
1306+
// Information about the actual volume instance allocated to the workspace.
1307+
optional Volume volume = 12;
1308+
1309+
enum AccessMode {
1310+
ACCESS_MODE_READ_ONLY = 0;
1311+
ACCESS_MODE_READ_WRITE = 1;
1312+
ACCESS_MODE_READ_WRITE_ONCE = 2;
1313+
ACCESS_MODE_WRITE_ONCE = 3;
1314+
ACCESS_MODE_WRITE_ONLY = 4;
1315+
}
1316+
}
1317+
1318+
// An identifiable, logical unit of data storage tied to a physical device.
1319+
message Volume {
1320+
// The unique identifier for the volume instance within its deployment context.
1321+
optional string uid = 1;
1322+
// The name of the volume instance
1323+
optional string name = 2;
1324+
// The volume mode for the volume instance.
1325+
optional VolumeMode mode = 3;
1326+
// The underlying path created from the actual volume.
1327+
optional string path = 4;
1328+
// The allocated size of the volume accessible to the associated workspace. This should include the scalar size as well as IEC standard unit in either decimal or binary form.
1329+
optional string sizeAllocated = 5;
1330+
// Indicates if the volume persists beyond the life of the resource it is associated with.
1331+
optional bool persistent = 6;
1332+
// Indicates if the volume is remotely (i.e., network) attached.
1333+
optional bool remote = 7;
1334+
// Domain-specific volume instance properties.
1335+
repeated Property properties = 8;
1336+
1337+
enum VolumeMode {
1338+
VOLUME_MODE_FILESYSTEM = 0;
1339+
VOLUME_MODE_BLOCK = 1;
1340+
}
1341+
}
1342+
1343+
// Represents a resource that can conditionally activate (or fire) tasks based upon associated events and their data.
1344+
message Trigger {
1345+
// BOM unique reference to the resource.
1346+
string bom_ref = 1;
1347+
// The unique identifier for the resource instance within its deployment context.
1348+
string uid = 2;
1349+
// The name of the resource instance.
1350+
optional string name = 3;
1351+
// A description of the resource instance.
1352+
optional string description = 4;
1353+
// Additional properties of the trigger.
1354+
repeated Property properties = 5;
1355+
// References to component or service resources that are used to realize the resource instance.
1356+
repeated ResourceReferenceChoice resourceReferences = 6;
1357+
// The source type of event which caused the trigger to fire.
1358+
TriggerType type = 7;
1359+
// The event data that caused the associated trigger to activate.
1360+
optional Event event = 8;
1361+
// Conditions
1362+
repeated Condition conditions = 9;
1363+
// The date and time (timestamp) when the trigger was activated.
1364+
optional google.protobuf.Timestamp timeActivated = 10;
1365+
// Represents resources and data brought into a task at runtime by executor or task commands
1366+
repeated InputType inputs = 11;
1367+
// Represents resources and data output from a task at runtime by executor or task commands
1368+
repeated OutputType outputs = 12;
1369+
1370+
enum TriggerType {
1371+
TRIGGER_TYPE_MANUAL = 0;
1372+
TRIGGER_TYPE_API = 1;
1373+
TRIGGER_TYPE_WEBHOOK = 2;
1374+
TRIGGER_TYPE_SCHEDULED = 3;
1375+
}
1376+
}
11631377

1164-
}
1378+
// Represents something that happened that may trigger a response.
1379+
message Event {
1380+
// The unique identifier of the event.
1381+
optional string uid = 1;
1382+
// A description of the event.
1383+
optional string description = 2;
1384+
// The date and time (timestamp) when the event was received.
1385+
optional google.protobuf.Timestamp timeReceived = 3;
1386+
// Encoding of the raw event data.
1387+
optional AttachedText data = 4;
1388+
// References the component or service that was the source of the event
1389+
optional ResourceReferenceChoice source = 5;
1390+
// References the component or service that was the target of the event
1391+
optional ResourceReferenceChoice target = 6;
1392+
// Additional properties of the event.
1393+
repeated Property properties = 7;
1394+
}
1395+
1396+
// Type that represents various input data types and formats.
1397+
message InputType {
1398+
// A references to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)
1399+
optional ResourceReferenceChoice source = 1;
1400+
// A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)
1401+
optional ResourceReferenceChoice target = 2;
1402+
// A reference to an independent resource provided as an input to a task by the workflow runtime.
1403+
optional ResourceReferenceChoice resource = 3;
1404+
// Inputs that have the form of parameters with names and values.
1405+
repeated Parameter parameters = 4;
1406+
// Inputs that have the form of parameters with names and values.
1407+
repeated EnvironmentVars environmentVars = 5;
1408+
// Inputs that have the form of data.
1409+
optional AttachedText data = 6;
1410+
// Additional properties of the input data.
1411+
repeated Property properties = 7;
1412+
}
1413+
1414+
message OutputType {
1415+
// Describes the type of data output.
1416+
optional OutputTypeType type = 1;
1417+
// Component or service that generated or provided the output from the task (e.g., a build tool)
1418+
optional ResourceReferenceChoice source = 2;
1419+
// Component or service that received the output from the task (e.g., reference to an artifactory service with data flow value of `outbound`)
1420+
optional ResourceReferenceChoice target = 3;
1421+
// A reference to an independent resource generated as output by the task.
1422+
optional ResourceReferenceChoice resource = 4;
1423+
// Outputs that have the form of data.
1424+
optional AttachedText data = 5;
1425+
// Outputs that have the form of environment variables.
1426+
repeated EnvironmentVars environmentVars = 6;
1427+
// Additional properties of the output data.
1428+
repeated Property properties = 7;
1429+
1430+
enum OutputTypeType {
1431+
OUTPUT_TYPE_ARTIFACT = 0;
1432+
OUTPUT_TYPE_ATTESTATION = 1;
1433+
OUTPUT_TYPE_LOG = 2;
1434+
OUTPUT_TYPE_EVIDENCE = 3;
1435+
OUTPUT_TYPE_METRICS = 4;
1436+
OUTPUT_TYPE_OTHER = 5;
1437+
}
1438+
}
1439+
1440+
message ResourceReferenceChoice {
1441+
oneof choice {
1442+
string ref = 1;
1443+
ExternalReference externalReference = 2;
1444+
}
1445+
}
1446+
1447+
// A condition that was used to determine a trigger should be activated.
1448+
message Condition {
1449+
// Describes the set of conditions which cause the trigger to activate.
1450+
optional string description = 1;
1451+
// The logical expression that was evaluated that determined the trigger should be fired.
1452+
optional string expression = 2;
1453+
// Domain-specific condition instance properties.
1454+
repeated Property properties = 3;
1455+
}
1456+
1457+
enum TaskType {
1458+
TASK_TYPE_COPY = 0;
1459+
TASK_TYPE_CLONE = 1;
1460+
TASK_TYPE_LINT = 2;
1461+
TASK_TYPE_SCAN = 3;
1462+
TASK_TYPE_MERGE = 4;
1463+
TASK_TYPE_BUILD = 5;
1464+
TASK_TYPE_TEST = 6;
1465+
TASK_TYPE_DELIVER = 7;
1466+
TASK_TYPE_DEPLOY = 8;
1467+
TASK_TYPE_RELEASE = 9;
1468+
TASK_TYPE_CLEAN = 10;
1469+
TASK_TYPE_OTHER = 11;
1470+
}
1471+
1472+
// A representation of a functional parameter.
1473+
message Parameter {
1474+
// The name of the parameter.
1475+
optional string name = 1;
1476+
// The value of the parameter.
1477+
optional string value = 2;
1478+
// The data type of the parameter.
1479+
optional string dataType = 3;
1480+
}
1481+
1482+
message EnvironmentVars {
1483+
oneof choice {
1484+
Property property = 1;
1485+
string value = 2;
1486+
}
1487+
}

0 commit comments

Comments
 (0)