-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
cyclonedx.go
1618 lines (1397 loc) · 85.8 KB
/
cyclonedx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file is part of CycloneDX Go
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) OWASP Foundation. All Rights Reserved.
package cyclonedx
import (
"encoding/xml"
"errors"
"fmt"
"regexp"
)
//go:generate stringer -linecomment -output cyclonedx_string.go -type MediaType,SpecVersion
const (
BOMFormat = "CycloneDX"
)
var ErrInvalidSpecVersion = errors.New("invalid specification version")
type Advisory struct {
Title string `json:"title,omitempty" xml:"title,omitempty"`
URL string `json:"url" xml:"url"`
}
type AffectedVersions struct {
Version string `json:"version,omitempty" xml:"version,omitempty"`
Range string `json:"range,omitempty" xml:"range,omitempty"`
Status VulnerabilityStatus `json:"status" xml:"status"`
}
type Affects struct {
Ref string `json:"ref" xml:"ref"`
Range *[]AffectedVersions `json:"versions,omitempty" xml:"versions>version,omitempty"`
}
type Annotation struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
Subjects *[]BOMReference `json:"subjects,omitempty" xml:"subjects>subject,omitempty"`
Annotator *Annotator `json:"annotator,omitempty" xml:"annotator,omitempty"`
Timestamp string `json:"timestamp,omitempty" xml:"timestamp,omitempty"`
Text string `json:"text,omitempty" xml:"text,omitempty"`
}
type Annotator struct {
Organization *OrganizationalEntity `json:"organization,omitempty" xml:"organization,omitempty"`
Individual *OrganizationalContact `json:"individual,omitempty" xml:"individual,omitempty"`
Component *Component `json:"component,omitempty" xml:"component,omitempty"`
Service *Service `json:"service,omitempty" xml:"service,omitempty"`
}
type Assessor struct {
BOMRef BOMReference `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
ThirdParty bool `json:"thirdParty,omitempty" xml:"thirdParty,omitempty"`
Organization *OrganizationalEntity `json:"organization,omitempty" xml:"organization,omitempty"`
}
type AttachedText struct {
Content string `json:"content" xml:",chardata"`
ContentType string `json:"contentType,omitempty" xml:"content-type,attr,omitempty"`
Encoding string `json:"encoding,omitempty" xml:"encoding,attr,omitempty"`
}
type Attestation struct {
Summary string `json:"summary,omitempty" xml:"summary,omitempty"`
Assessor BOMReference `json:"assessor,omitempty" xml:"assessor,omitempty"`
Map *[]AttestationMap `json:"map,omitempty" xml:"map,omitempty"`
Signature *JSFSignature `json:"signature,omitempty" xml:"-"`
}
type AttestationMap struct {
Requirement string `json:"requirement,omitempty" xml:"requirement,omitempty"`
Claims *[]BOMReference `json:"claims,omitempty" xml:"claims>claim,omitempty"`
CounterClaims *[]BOMReference `json:"counterClaims,omitempty" xml:"counterClaims>counterClaim,omitempty"`
Conformance *AttestationConformance `json:"conformance,omitempty" xml:"conformance,omitempty"`
Confidence *AttestationConfidence `json:"confidence,omitempty" xml:"confidence,omitempty"`
}
type AttestationConformance struct {
Score *float64 `json:"score,omitempty" xml:"score,omitempty"`
Rationale string `json:"rationale,omitempty" xml:"rationale,omitempty"`
MitigationStrategies *[]BOMReference `json:"mitigationStrategies,omitempty" xml:"mitigationStrategies>mitigationStrategy,omitempty"`
}
type AttestationConfidence struct {
Score *float64 `json:"score,omitempty" xml:"score,omitempty"`
Rationale string `json:"rationale,omitempty" xml:"rationale,omitempty"`
}
type BOM struct {
// XML specific fields
XMLName xml.Name `json:"-" xml:"bom"`
XMLNS string `json:"-" xml:"xmlns,attr"`
// JSON specific fields
JSONSchema string `json:"$schema,omitempty" xml:"-"`
BOMFormat string `json:"bomFormat" xml:"-"`
SpecVersion SpecVersion `json:"specVersion" xml:"-"`
SerialNumber string `json:"serialNumber,omitempty" xml:"serialNumber,attr,omitempty"`
Version int `json:"version" xml:"version,attr"`
Metadata *Metadata `json:"metadata,omitempty" xml:"metadata,omitempty"`
Components *[]Component `json:"components,omitempty" xml:"components>component,omitempty"`
Services *[]Service `json:"services,omitempty" xml:"services>service,omitempty"`
ExternalReferences *[]ExternalReference `json:"externalReferences,omitempty" xml:"externalReferences>reference,omitempty"`
Dependencies *[]Dependency `json:"dependencies,omitempty" xml:"dependencies>dependency,omitempty"`
Compositions *[]Composition `json:"compositions,omitempty" xml:"compositions>composition,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties>property,omitempty"`
Vulnerabilities *[]Vulnerability `json:"vulnerabilities,omitempty" xml:"vulnerabilities>vulnerability,omitempty"`
Annotations *[]Annotation `json:"annotations,omitempty" xml:"annotations>annotation,omitempty"`
Formulation *[]Formula `json:"formulation,omitempty" xml:"formulation>formula,omitempty"`
Declarations *Declarations `json:"declarations,omitempty" xml:"declarations,omitempty"`
Definitions *Definitions `json:"definitions,omitempty" xml:"definitions,omitempty"`
}
func NewBOM() *BOM {
return &BOM{
JSONSchema: jsonSchemas[SpecVersion1_6],
XMLNS: xmlNamespaces[SpecVersion1_6],
BOMFormat: BOMFormat,
SpecVersion: SpecVersion1_6,
Version: 1,
}
}
type BOMFileFormat int
const (
BOMFileFormatXML BOMFileFormat = iota
BOMFileFormatJSON
)
// Bool is a convenience function to transform a value of the primitive type bool to a pointer of bool
func Bool(value bool) *bool {
return &value
}
type BOMReference string
type Callstack struct {
Frames *[]CallstackFrame `json:"frames,omitempty" xml:"frames>frame,omitempty"`
}
type CallstackFrame struct {
Package string `json:"package,omitempty" xml:"package,omitempty"`
Module string `json:"module,omitempty" xml:"module,omitempty"`
Function string `json:"function,omitempty" xml:"function,omitempty"`
Parameters *[]string `json:"parameters,omitempty" xml:"parameters>parameter,omitempty"`
Line *int `json:"line,omitempty" xml:"line,omitempty"`
Column *int `json:"column,omitempty" xml:"column,omitempty"`
FullFilename string `json:"fullFilename,omitempty" xml:"fullFilename,omitempty"`
}
type CertificateProperties struct {
SubjectName string `json:"subjectName,omitempty" xml:"subjectName,omitempty"`
IssuerName string `json:"issuerName,omitempty" xml:"issuerName,omitempty"`
NotValidBefore string `json:"notValidBefore,omitempty" xml:"notValidBefore,omitempty"`
NotValidAfter string `json:"notValidAfter,omitempty" xml:"notValidAfter,omitempty"`
SignatureAlgorithmRef BOMReference `json:"signatureAlgorithmRef,omitempty" xml:"signatureAlgorithmRef,omitempty"`
SubjectPublicKeyRef BOMReference `json:"subjectPublicKeyRef,omitempty" xml:"subjectPublicKeyRef,omitempty"`
CertificateFormat string `json:"certificateFormat,omitempty" xml:"certificateFormat,omitempty"`
CertificateExtension string `json:"certificateExtension,omitempty" xml:"certificateExtension,omitempty"`
}
type Claim struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
Target BOMReference `json:"target,omitempty" xml:"target,omitempty"`
Predicate string `json:"predicate,omitempty" xml:"predicate,omitempty"`
MitigationStrategies *[]BOMReference `json:"mitigationStrategies,omitempty" xml:"mitigationStrategies>mitigationStrategy,omitempty"`
Reasoning string `json:"reasoning,omitempty" xml:"reasoning,omitempty"`
Evidence *[]BOMReference `json:"evidence,omitempty" xml:"evidence,omitempty"`
CounterEvidence *[]BOMReference `json:"counterEvidence,omitempty" xml:"counterEvidence,omitempty"`
ExternalReferences *[]ExternalReference `json:"externalReferences,omitempty" xml:"externalReferences>reference,omitempty"`
Signature *JSFSignature `json:"signature,omitempty" xml:"-"`
}
type CipherSuite struct {
Name string `json:"name,omitempty" xml:"name,omitempty"`
Algorithms *[]BOMReference `json:"algorithms,omitempty" xml:"algorithms,omitempty"`
Identifiers *[]string `json:"identifiers,omitempty" xml:"identifiers,omitempty"`
}
type ComponentType string
const (
ComponentTypeApplication ComponentType = "application"
ComponentTypeContainer ComponentType = "container"
ComponentTypeCryptographicAsset ComponentType = "cryptographic-asset"
ComponentTypeData ComponentType = "data"
ComponentTypeDevice ComponentType = "device"
ComponentTypeDeviceDriver ComponentType = "device-driver"
ComponentTypeFile ComponentType = "file"
ComponentTypeFirmware ComponentType = "firmware"
ComponentTypeFramework ComponentType = "framework"
ComponentTypeLibrary ComponentType = "library"
ComponentTypeMachineLearningModel ComponentType = "machine-learning-model"
ComponentTypeOS ComponentType = "operating-system"
ComponentTypePlatform ComponentType = "platform"
)
type Commit struct {
UID string `json:"uid,omitempty" xml:"uid,omitempty"`
URL string `json:"url,omitempty" xml:"url,omitempty"`
Author *IdentifiableAction `json:"author,omitempty" xml:"author,omitempty"`
Committer *IdentifiableAction `json:"committer,omitempty" xml:"committer,omitempty"`
Message string `json:"message,omitempty" xml:"message,omitempty"`
}
type Component struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
MIMEType string `json:"mime-type,omitempty" xml:"mime-type,attr,omitempty"`
Type ComponentType `json:"type" xml:"type,attr"`
Supplier *OrganizationalEntity `json:"supplier,omitempty" xml:"supplier,omitempty"`
Manufacturer *OrganizationalEntity `json:"manufacturer,omitempty" xml:"manufacturer,omitempty"`
Author string `json:"author,omitempty" xml:"author,omitempty"` // Deprecated: Use authors or manufacturer instead.
Authors *[]OrganizationalContact `json:"authors,omitempty" xml:"authors>author,omitempty"`
Publisher string `json:"publisher,omitempty" xml:"publisher,omitempty"`
Group string `json:"group,omitempty" xml:"group,omitempty"`
Name string `json:"name" xml:"name"`
Version string `json:"version,omitempty" xml:"version,omitempty"`
Description string `json:"description,omitempty" xml:"description,omitempty"`
Scope Scope `json:"scope,omitempty" xml:"scope,omitempty"`
Hashes *[]Hash `json:"hashes,omitempty" xml:"hashes>hash,omitempty"`
Licenses *Licenses `json:"licenses,omitempty" xml:"licenses,omitempty"`
Copyright string `json:"copyright,omitempty" xml:"copyright,omitempty"`
CPE string `json:"cpe,omitempty" xml:"cpe,omitempty"`
PackageURL string `json:"purl,omitempty" xml:"purl,omitempty"`
OmniborID *[]string `json:"omniborId,omitempty" xml:"omniborId,omitempty"`
SWHID *[]string `json:"swhid,omitempty" xml:"swhid,omitempty"`
SWID *SWID `json:"swid,omitempty" xml:"swid,omitempty"`
Modified *bool `json:"modified,omitempty" xml:"modified,omitempty"`
Pedigree *Pedigree `json:"pedigree,omitempty" xml:"pedigree,omitempty"`
ExternalReferences *[]ExternalReference `json:"externalReferences,omitempty" xml:"externalReferences>reference,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties>property,omitempty"`
Components *[]Component `json:"components,omitempty" xml:"components>component,omitempty"`
Evidence *Evidence `json:"evidence,omitempty" xml:"evidence,omitempty"`
ReleaseNotes *ReleaseNotes `json:"releaseNotes,omitempty" xml:"releaseNotes,omitempty"`
ModelCard *MLModelCard `json:"modelCard,omitempty" xml:"modelCard,omitempty"`
Data *ComponentData `json:"data,omitempty" xml:"data,omitempty"`
CryptoProperties *CryptoProperties `json:"cryptoProperties,omitempty" xml:"cryptoProperties,omitempty"`
}
type ComponentData struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
Type ComponentDataType `json:"type,omitempty" xml:"type,omitempty"`
Name string `json:"name,omitempty" xml:"name,omitempty"`
Contents *ComponentDataContents `json:"contents,omitempty" xml:"contents,omitempty"`
Classification string `json:"classification,omitempty" xml:"classification,omitempty"`
SensitiveData *[]string `json:"sensitiveData,omitempty" xml:"sensitiveData,omitempty"`
Graphics *ComponentDataGraphics `json:"graphics,omitempty" xml:"graphics,omitempty"`
Description string `json:"description,omitempty" xml:"description,omitempty"`
Governance *DataGovernance `json:"governance,omitempty" xml:"governance,omitempty"`
}
type ComponentDataContents struct {
Attachment *AttachedText `json:"attachment,omitempty" xml:"attachment,omitempty"`
URL string `json:"url,omitempty" xml:"url,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties,omitempty"`
}
type ComponentDataGovernanceResponsibleParty struct {
Organization *OrganizationalEntity `json:"organization,omitempty" xml:"organization,omitempty"`
Contact *OrganizationalContact `json:"contact,omitempty" xml:"contact,omitempty"`
}
type ComponentDataGraphic struct {
Name string `json:"name,omitempty" xml:"name,omitempty"`
Image *AttachedText `json:"image,omitempty" xml:"image,omitempty"`
}
type ComponentDataGraphics struct {
Description string `json:"description,omitempty" xml:"description,omitempty"`
Collection *[]ComponentDataGraphic `json:"collection,omitempty" xml:"collection>graphic,omitempty"`
}
type ComponentDataType string
const (
ComponentDataTypeConfiguration ComponentDataType = "configuration"
ComponentDataTypeDataset ComponentDataType = "dataset"
ComponentDataTypeDefinition ComponentDataType = "definition"
ComponentDataTypeOther ComponentDataType = "other"
ComponentDataTypeSourceCode ComponentDataType = "source-code"
)
type Composition struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
Aggregate CompositionAggregate `json:"aggregate" xml:"aggregate"`
Assemblies *[]BOMReference `json:"assemblies,omitempty" xml:"assemblies>assembly,omitempty"`
Dependencies *[]BOMReference `json:"dependencies,omitempty" xml:"dependencies>dependency,omitempty"`
Vulnerabilities *[]BOMReference `json:"vulnerabilities,omitempty" xml:"vulnerabilities>vulnerability,omitempty"`
}
type CompositionAggregate string
const (
CompositionAggregateComplete CompositionAggregate = "complete"
CompositionAggregateIncomplete CompositionAggregate = "incomplete"
CompositionAggregateIncompleteFirstPartyOnly CompositionAggregate = "incomplete_first_party_only"
CompositionAggregateIncompleteFirstPartyOpenSourceOnly CompositionAggregate = "incomplete_first_party_opensource_only"
CompositionAggregateIncompleteFirstPartyProprietaryOnly CompositionAggregate = "incomplete_first_party_proprietary_only"
CompositionAggregateIncompleteThirdPartyOnly CompositionAggregate = "incomplete_third_party_only"
CompositionAggregateIncompleteThirdPartyOpenSourceOnly CompositionAggregate = "incomplete_third_party_opensource_only"
CompositionAggregateIncompleteThirdPartyProprietaryOnly CompositionAggregate = "incomplete_third_party_proprietary_only"
CompositionAggregateNotSpecified CompositionAggregate = "not_specified"
CompositionAggregateUnknown CompositionAggregate = "unknown"
)
type Copyright struct {
Text string `json:"text" xml:"-"`
}
type Credits struct {
Organizations *[]OrganizationalEntity `json:"organizations,omitempty" xml:"organizations>organization,omitempty"`
Individuals *[]OrganizationalContact `json:"individuals,omitempty" xml:"individuals>individual,omitempty"`
}
type CryptoAlgorithmMode string
const (
CryptoAlgorithmModeCBC CryptoAlgorithmMode = "cbc"
CryptoAlgorithmModeECB CryptoAlgorithmMode = "ecb"
CryptoAlgorithmModeCCM CryptoAlgorithmMode = "ccm"
CryptoAlgorithmModeGCM CryptoAlgorithmMode = "gcm"
CryptoAlgorithmModeCFB CryptoAlgorithmMode = "cfb"
CryptoAlgorithmModeOFB CryptoAlgorithmMode = "ofb"
CryptoAlgorithmModeCTR CryptoAlgorithmMode = "ctr"
CryptoAlgorithmModeOther CryptoAlgorithmMode = "other"
CryptoAlgorithmModeUnknown CryptoAlgorithmMode = "unknown"
)
type CryptoAlgorithmProperties struct {
Primitive CryptoPrimitive `json:"primitive,omitempty" xml:"primitive,omitempty"`
ParameterSetIdentifier string `json:"parameterSetIdentifier,omitempty" xml:"parameterSetIdentifier,omitempty"`
Curve string `json:"curve,omitempty" xml:"curve,omitempty"`
ExecutionEnvironment CryptoExecutionEnvironment `json:"executionEnvironment,omitempty" xml:"executionEnvironment,omitempty"`
ImplementationPlatform ImplementationPlatform `json:"implementationPlatform,omitempty" xml:"implementationPlatform,omitempty"`
CertificationLevel *[]CryptoCertificationLevel `json:"certificationLevel,omitempty" xml:"certificationLevel,omitempty"`
Mode CryptoAlgorithmMode `json:"mode,omitempty" xml:"mode,omitempty"`
Padding CryptoPadding `json:"padding,omitempty" xml:"padding,omitempty"`
CryptoFunctions *[]CryptoFunction `json:"cryptoFunctions,omitempty" xml:"cryptoFunctions>cryptoFunction,omitempty"`
ClassicalSecurityLevel *int `json:"classicalSecurityLevel,omitempty" xml:"classicalSecurityLevel,omitempty"`
NistQuantumSecurityLevel *int `json:"nistQuantumSecurityLevel,omitempty" xml:"nistQuantumSecurityLevel,omitempty"`
}
type CryptoAssetType string
const (
CryptoAssetTypeAlgorithm CryptoAssetType = "algorithm"
CryptoAssetTypeCertificate CryptoAssetType = "certificate"
CryptoAssetTypeProtocol CryptoAssetType = "protocol"
CryptoAssetTypeRelatedCryptoMaterial CryptoAssetType = "related-crypto-material"
)
type CryptoCertificationLevel string
const (
CryptoCertificationLevelNone CryptoCertificationLevel = "none"
CryptoCertificationLevelFIPS140_1_L1 CryptoCertificationLevel = "fips140-1-l1"
CryptoCertificationLevelFIPS140_1_L2 CryptoCertificationLevel = "fips140-1-l2"
CryptoCertificationLevelFIPS140_1_L3 CryptoCertificationLevel = "fips140-1-l3"
CryptoCertificationLevelFIPS140_1_L4 CryptoCertificationLevel = "fips140-1-l4"
CryptoCertificationLevelFIPS140_2_L1 CryptoCertificationLevel = "fips140-2-l1"
CryptoCertificationLevelFIPS140_2_L2 CryptoCertificationLevel = "fips140-2-l2"
CryptoCertificationLevelFIPS140_2_L3 CryptoCertificationLevel = "fips140-2-l3"
CryptoCertificationLevelFIPS140_2_L4 CryptoCertificationLevel = "fips140-2-l4"
CryptoCertificationLevelFIPS140_3_L1 CryptoCertificationLevel = "fips140-3-l1"
CryptoCertificationLevelFIPS140_3_L2 CryptoCertificationLevel = "fips140-3-l2"
CryptoCertificationLevelFIPS140_3_L3 CryptoCertificationLevel = "fips140-3-l3"
CryptoCertificationLevelFIPS140_3_L4 CryptoCertificationLevel = "fips140-3-l4"
CryptoCertificationLevelCCEAL1 CryptoCertificationLevel = "cc-eal1"
CryptoCertificationLevelCCEAL1Plus CryptoCertificationLevel = "cc-eal1+"
CryptoCertificationLevelCCEAL2 CryptoCertificationLevel = "cc-eal2"
CryptoCertificationLevelCCEAL2Plus CryptoCertificationLevel = "cc-eal2+"
CryptoCertificationLevelCCEAL3 CryptoCertificationLevel = "cc-eal3"
CryptoCertificationLevelCCEAL3Plus CryptoCertificationLevel = "cc-eal3+"
CryptoCertificationLevelCCEAL4 CryptoCertificationLevel = "cc-eal4"
CryptoCertificationLevelCCEAL4Plus CryptoCertificationLevel = "cc-eal4+"
CryptoCertificationLevelCCEAL5 CryptoCertificationLevel = "cc-eal5"
CryptoCertificationLevelCCEAL5Plus CryptoCertificationLevel = "cc-eal5+"
CryptoCertificationLevelCCEAL6 CryptoCertificationLevel = "cc-eal6"
CryptoCertificationLevelCCEAL6Plus CryptoCertificationLevel = "cc-eal6+"
CryptoCertificationLevelCCEAL7 CryptoCertificationLevel = "cc-eal7"
CryptoCertificationLevelCCEAL7Plus CryptoCertificationLevel = "cc-eal7+"
CryptoCertificationLevelOther CryptoCertificationLevel = "other"
CryptoCertificationLevelUnknown CryptoCertificationLevel = "unknown"
)
type CryptoExecutionEnvironment string
const (
CryptoExecutionEnvironmentSoftwarePlainRAM CryptoExecutionEnvironment = "software-plain-ram"
CryptoExecutionEnvironmentSoftwareEncryptedRAM CryptoExecutionEnvironment = "software-encrypted-ram"
CryptoExecutionEnvironmentSoftwareTEE CryptoExecutionEnvironment = "software-tee"
CryptoExecutionEnvironmentHardware CryptoExecutionEnvironment = "hardware"
CryptoExecutionEnvironmentOther CryptoExecutionEnvironment = "other"
CryptoExecutionEnvironmentUnknown CryptoExecutionEnvironment = "unknown"
)
type CryptoFunction string
const (
CryptoFunctionGenerate CryptoFunction = "generate"
CryptoFunctionKeygen CryptoFunction = "keygen"
CryptoFunctionEncrypt CryptoFunction = "encrypt"
CryptoFunctionDecrypt CryptoFunction = "decrypt"
CryptoFunctionDigest CryptoFunction = "digest"
CryptoFunctionTag CryptoFunction = "tag"
CryptoFunctionKeyderive CryptoFunction = "keyderive"
CryptoFunctionSign CryptoFunction = "sign"
CryptoFunctionVerify CryptoFunction = "verify"
CryptoFunctionEncapsulate CryptoFunction = "encapsulate"
CryptoFunctionDecapsulate CryptoFunction = "decapsulate"
CryptoFunctionOther CryptoFunction = "other"
CryptoFunctionUnknown CryptoFunction = "unknown"
)
type CryptoKeyState string
const (
CryptoKeyStatePreActivation CryptoKeyState = "pre-activation"
CryptoKeyStateActive CryptoKeyState = "active"
CryptoKeyStateSuspended CryptoKeyState = "suspended"
CryptoKeyStateDeactivated CryptoKeyState = "deactivated"
CryptoKeyStateCompromised CryptoKeyState = "compromised"
CryptoKeyStateDestroyed CryptoKeyState = "destroyed"
)
type CryptoPadding string
const (
CryptoPaddingPKCS5 CryptoPadding = "pkcs5"
CryptoPaddingPKCS7 CryptoPadding = "pkcs7"
CryptoPaddingPKCS1v15 CryptoPadding = "pkcs1v15"
CryptoPaddingOAEP CryptoPadding = "oaep"
CryptoPaddingRaw CryptoPadding = "raw"
CryptoPaddingOther CryptoPadding = "other"
CryptoPaddingUnknown CryptoPadding = "unknown"
)
type CryptoPrimitive string
const (
CryptoPrimitiveDRBG CryptoPrimitive = "drbg"
CryptoPrimitiveMAC CryptoPrimitive = "mac"
CryptoPrimitiveBlockCipher CryptoPrimitive = "block-cipher"
CryptoPrimitiveStreamCipher CryptoPrimitive = "stream-cipher"
CryptoPrimitiveSignature CryptoPrimitive = "signature"
CryptoPrimitiveHash CryptoPrimitive = "hash"
CryptoPrimitivePKE CryptoPrimitive = "pke"
CryptoPrimitiveXOF CryptoPrimitive = "xof"
CryptoPrimitiveKDF CryptoPrimitive = "kdf"
CryptoPrimitiveKeyAgree CryptoPrimitive = "key-agree"
CryptoPrimitiveKEM CryptoPrimitive = "kem"
CryptoPrimitiveAE CryptoPrimitive = "ae"
CryptoPrimitiveCombiner CryptoPrimitive = "combiner"
CryptoPrimitiveOther CryptoPrimitive = "other"
CryptoPrimitiveUnknown CryptoPrimitive = "unknown"
)
type CryptoProperties struct {
AssetType CryptoAssetType `json:"assetType" xml:"assetType"`
AlgorithmProperties *CryptoAlgorithmProperties `json:"algorithmProperties,omitempty" xml:"algorithmProperties,omitempty"`
CertificateProperties *CertificateProperties `json:"certificateProperties,omitempty" xml:"certificateProperties,omitempty"`
RelatedCryptoMaterialProperties *RelatedCryptoMaterialProperties `json:"relatedCryptoMaterialProperties,omitempty" xml:"relatedCryptoMaterialProperties,omitempty"`
ProtocolProperties *CryptoProtocolProperties `json:"protocolProperties,omitempty" xml:"protocolProperties,omitempty"`
OID string `json:"oid,omitempty" xml:"oid,omitempty"`
}
type CryptoProtocolProperties struct {
Type CryptoProtocolType `json:"type,omitempty" xml:"type,omitempty"`
Version string `json:"version,omitempty" xml:"version,omitempty"`
CipherSuites *[]CipherSuite `json:"cipherSuites,omitempty" xml:"cipherSuites,omitempty"`
IKEv2TransformTypes *IKEv2TransformTypes `json:"ikev2TransformTypes,omitempty" xml:"ikev2TransformTypes,omitempty"`
CryptoRefArray *[]BOMReference `json:"cryptoRefArray,omitempty" xml:"cryptoRefArray,omitempty"`
}
type CryptoProtocolType string
const (
CryptoProtocolTypeTLS CryptoProtocolType = "tls"
CryptoProtocolTypeSSH CryptoProtocolType = "ssh"
CryptoProtocolTypeIPSec CryptoProtocolType = "ipsec"
CryptoProtocolTypeIKE CryptoProtocolType = "ike"
CryptoProtocolTypeSSTP CryptoProtocolType = "sstp"
CryptoProtocolTypeWPA CryptoProtocolType = "wpa"
CryptoProtocolTypeOther CryptoProtocolType = "other"
CryptoProtocolTypeUnknown CryptoProtocolType = "unknown"
)
type IKEv2TransformTypes struct {
Encr *[]BOMReference `json:"encr,omitempty" xml:"encr,omitempty"`
PRF *[]BOMReference `json:"prf,omitempty" xml:"prf,omitempty"`
Integ *[]BOMReference `json:"integ,omitempty" xml:"integ,omitempty"`
KE *[]BOMReference `json:"ke,omitempty" xml:"ke,omitempty"`
ESN bool `json:"esn" xml:"esn"`
Auth *[]BOMReference `json:"auth,omitempty" xml:"auth,omitempty"`
}
type SecuredBy struct {
Mechanism string `json:"mechanism,omitempty" xml:"mechanism,omitempty"`
AlgorithmRef BOMReference `json:"algorithmRef,omitempty" xml:"algorithmRef,omitempty"`
}
type DataClassification struct {
Flow DataFlow `json:"flow" xml:"flow,attr"`
Classification string `json:"classification" xml:",chardata"`
}
type DataFlow string
const (
DataFlowBidirectional DataFlow = "bi-directional"
DataFlowInbound DataFlow = "inbound"
DataFlowOutbound DataFlow = "outbound"
DataFlowUnknown DataFlow = "unknown"
)
type DataGovernance struct {
Custodians *[]ComponentDataGovernanceResponsibleParty `json:"custodians,omitempty" xml:"custodians>custodian,omitempty"`
Stewards *[]ComponentDataGovernanceResponsibleParty `json:"stewards,omitempty" xml:"stewards>steward,omitempty"`
Owners *[]ComponentDataGovernanceResponsibleParty `json:"owners,omitempty" xml:"owners>owner,omitempty"`
}
type Declarations struct {
Assessors *[]Assessor `json:"assessors,omitempty" xml:"assessors>assessor,omitempty"`
Attestations *[]Attestation `json:"attestations,omitempty" xml:"attestations>attestation,omitempty"`
Claims *[]Claim `json:"claims,omitempty" xml:"claims>claim,omitempty"`
Evidence *[]DeclarationEvidence `json:"evidence,omitempty" xml:"evidence>evidence,omitempty"`
Targets *Targets `json:"targets,omitempty" xml:"targets,omitempty"`
Affirmation *Affirmation `json:"affirmation,omitempty" xml:"affirmation,omitempty"`
Signature *JSFSignature `json:"signature,omitempty" xml:"-"`
}
type DeclarationEvidence struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
PropertyName string `json:"propertyName,omitempty" xml:"propertyName,omitempty"`
Description string `json:"description,omitempty" xml:"description,omitempty"`
Data *[]EvidenceData `json:"data,omitempty" xml:"data,omitempty"`
Created string `json:"created,omitempty" xml:"created,omitempty"`
Expires string `json:"expires,omitempty" xml:"expires,omitempty"`
Author *OrganizationalContact `json:"author,omitempty" xml:"author,omitempty"`
Reviewer *OrganizationalContact `json:"reviewer,omitempty" xml:"reviewer,omitempty"`
Signature *JSFSignature `json:"signature,omitempty" xml:"-"`
}
type Definitions struct {
Standards *[]StandardDefinition `json:"standards,omitempty" xml:"standards>standard,omitempty"`
}
type EvidenceData struct {
Name string `json:"name,omitempty" xml:"name,omitempty"`
Contents *EvidenceDataContents `json:"contents,omitempty" xml:"contents,omitempty"`
Classification *DataClassification `json:"classification,omitempty" xml:"data>classification,omitempty"`
SensitiveData *[]string `json:"sensitiveData,omitempty" xml:"sensitiveData,omitempty"`
Governance *DataGovernance `json:"governance,omitempty" xml:"governance,omitempty"`
}
type EvidenceDataContents struct {
Attachment *AttachedText `json:"attachment,omitempty" xml:"attachment,omitempty"`
URL string `json:"url,omitempty" xml:"url,omitempty"`
}
type Targets struct {
Organizations *[]OrganizationalEntity `json:"organizations,omitempty" xml:"organizations>organization,omitempty"`
Components *[]Component `json:"components,omitempty" xml:"components>component,omitempty"`
Services *[]Service `json:"services,omitempty" xml:"services>service,omitempty"`
}
type Affirmation struct {
Statement string `json:"statement,omitempty" xml:"statement,omitempty"`
Signatories *[]Signatory `json:"signatories,omitempty" xml:"signatories>signatory,omitempty"`
Signature *JSFSignature `json:"signature,omitempty" xml:"-"`
}
type Signatory struct {
Name string `json:"name,omitempty" xml:"name,omitempty"`
Role string `json:"role,omitempty" xml:"role,omitempty"`
Signature *JSFSignature `json:"signature,omitempty" xml:"-"`
Organization *OrganizationalEntity `json:"organization,omitempty" xml:"organization,omitempty"`
ExternalReference *ExternalReference `json:"externalReference,omitempty" xml:"externalReference,omitempty"`
}
type Dependency struct {
Ref string `json:"ref"`
Dependencies *[]string `json:"dependsOn,omitempty"`
}
type Diff struct {
Text *AttachedText `json:"text,omitempty" xml:"text,omitempty"`
URL string `json:"url,omitempty" xml:"url,omitempty"`
}
type EnvironmentVariables []EnvironmentVariableChoice
type EnvironmentVariableChoice struct {
Property *Property `json:"-" xml:"-"`
Value string `json:"-" xml:"-"`
}
type Event struct {
UID string `json:"uid,omitempty" xml:"uid,omitempty"`
Description string `json:"description,omitempty" xml:"description,omitempty"`
TimeReceived string `json:"timeReceived,omitempty" xml:"timeReceived,omitempty"`
Data *AttachedText `json:"data,omitempty" xml:"data,omitempty"`
Source *ResourceReferenceChoice `json:"source,omitempty" xml:"source,omitempty"`
Target *ResourceReferenceChoice `json:"target,omitempty" xml:"target,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties>property,omitempty"`
}
type Evidence struct {
Identity *EvidenceIdentity `json:"identity,omitempty" xml:"identity,omitempty"`
Occurrences *[]EvidenceOccurrence `json:"occurrences,omitempty" xml:"occurrences>occurrence,omitempty"`
Callstack *Callstack `json:"callstack,omitempty" xml:"callstack,omitempty"`
Licenses *Licenses `json:"licenses,omitempty" xml:"licenses,omitempty"`
Copyright *[]Copyright `json:"copyright,omitempty" xml:"copyright>text,omitempty"`
}
type EvidenceIdentity struct {
Field EvidenceIdentityFieldType `json:"field,omitempty" xml:"field,omitempty"`
Confidence *float32 `json:"confidence,omitempty" xml:"confidence,omitempty"`
Methods *[]EvidenceIdentityMethod `json:"methods,omitempty" xml:"methods>method,omitempty"`
Tools *[]BOMReference `json:"tools,omitempty" xml:"tools>tool,omitempty"`
}
type EvidenceIdentityFieldType string
const (
EvidenceIdentityFieldTypeCPE EvidenceIdentityFieldType = "cpe"
EvidenceIdentityFieldTypeGroup EvidenceIdentityFieldType = "group"
EvidenceIdentityFieldTypeHash EvidenceIdentityFieldType = "hash"
EvidenceIdentityFieldTypeName EvidenceIdentityFieldType = "name"
EvidenceIdentityFieldTypePURL EvidenceIdentityFieldType = "purl"
EvidenceIdentityFieldTypeOmniborID EvidenceIdentityFieldType = "omniborId"
EvidenceIdentityFieldTypeSWHID EvidenceIdentityFieldType = "swhid"
EvidenceIdentityFieldTypeSWID EvidenceIdentityFieldType = "swid"
EvidenceIdentityFieldTypeVersion EvidenceIdentityFieldType = "version"
)
type EvidenceIdentityMethod struct {
Technique EvidenceIdentityTechnique `json:"technique,omitempty" xml:"technique,omitempty"`
Confidence *float32 `json:"confidence,omitempty" xml:"confidence,omitempty"`
Value string `json:"value,omitempty" xml:"value,omitempty"`
}
type EvidenceIdentityTechnique string
const (
EvidenceIdentityTechniqueASTFingerprint EvidenceIdentityTechnique = "ast-fingerprint"
EvidenceIdentityTechniqueAttestation EvidenceIdentityTechnique = "attestation"
EvidenceIdentityTechniqueBinaryAnalysis EvidenceIdentityTechnique = "binary-analysis"
EvidenceIdentityTechniqueDynamicAnalysis EvidenceIdentityTechnique = "dynamic-analysis"
EvidenceIdentityTechniqueFilename EvidenceIdentityTechnique = "filename"
EvidenceIdentityTechniqueHashComparison EvidenceIdentityTechnique = "hash-comparison"
EvidenceIdentityTechniqueInstrumentation EvidenceIdentityTechnique = "instrumentation"
EvidenceIdentityTechniqueManifestAnalysis EvidenceIdentityTechnique = "manifest-analysis"
EvidenceIdentityTechniqueOther EvidenceIdentityTechnique = "other"
EvidenceIdentityTechniqueSourceCodeAnalysis EvidenceIdentityTechnique = "source-code-analysis"
)
type EvidenceOccurrence struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
Location string `json:"location,omitempty" xml:"location,omitempty"`
Line *int `json:"line,omitempty" xml:"line,attr,omitempty"`
Offset *int `json:"offset,omitempty" xml:"offset,attr,omitempty"`
Symbol string `json:"symbol,omitempty" xml:"symbol,attr,omitempty"`
AdditionalContext string `json:"additionalContext,omitempty" xml:"additionalContext,attr,omitempty"`
}
type ExternalReference struct {
URL string `json:"url" xml:"url"`
Comment string `json:"comment,omitempty" xml:"comment,omitempty"`
Hashes *[]Hash `json:"hashes,omitempty" xml:"hashes>hash,omitempty"`
Type ExternalReferenceType `json:"type" xml:"type,attr"`
}
type ExternalReferenceType string
const (
ERTypeAdversaryModel ExternalReferenceType = "adversary-model"
ERTypeAdvisories ExternalReferenceType = "advisories"
ERTypeAttestation ExternalReferenceType = "attestation"
ERTypeBOM ExternalReferenceType = "bom"
ERTypeBuildMeta ExternalReferenceType = "build-meta"
ERTypeBuildSystem ExternalReferenceType = "build-system"
ERTypeCertificationReport ExternalReferenceType = "certification-report"
ERTypeChat ExternalReferenceType = "chat"
ERTypeConfiguration ExternalReferenceType = "configuration"
ERTypeCodifiedInfrastructure ExternalReferenceType = "codified-infrastructure"
ERTypeComponentAnalysisReport ExternalReferenceType = "component-analysis-report"
ERTypeDistribution ExternalReferenceType = "distribution"
ERTypeDistributionIntake ExternalReferenceType = "distribution-intake"
ERTypeDocumentation ExternalReferenceType = "documentation"
ERTypeDynamicAnalysisReport ExternalReferenceType = "dynamic-analysis-report"
ERTypeEvidence ExternalReferenceType = "evidence"
ERTypeExploitabilityStatement ExternalReferenceType = "exploitability-statement"
ERTypeFormulation ExternalReferenceType = "formulation"
ERTypeIssueTracker ExternalReferenceType = "issue-tracker"
ERTypeLicense ExternalReferenceType = "license"
ERTypeLog ExternalReferenceType = "log"
ERTypeMailingList ExternalReferenceType = "mailing-list"
ERTypeMaturityReport ExternalReferenceType = "maturity-report"
ERTypeModelCard ExternalReferenceType = "model-card"
ERTypeOther ExternalReferenceType = "other"
ERTypePentestReport ExternalReferenceType = "pentest-report"
ERTypeQualityMetrics ExternalReferenceType = "quality-metrics"
ERTypeReleaseNotes ExternalReferenceType = "release-notes"
ERTypeRiskAssessment ExternalReferenceType = "risk-assessment"
ERTypeRuntimeAnalysisReport ExternalReferenceType = "runtime-analysis-report"
ERTypeSecurityContact ExternalReferenceType = "security-contact"
ERTypeSocial ExternalReferenceType = "social"
ERTypeStaticAnalysisReport ExternalReferenceType = "static-analysis-report"
ERTypeSupport ExternalReferenceType = "support"
ERTypeThreatModel ExternalReferenceType = "threat-model"
ERTypeVCS ExternalReferenceType = "vcs"
ERTypeVulnerabilityAssertion ExternalReferenceType = "vulnerability-assertion"
ERTypeWebsite ExternalReferenceType = "website"
)
type Formula struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
Components *[]Component `json:"components,omitempty" xml:"components>component,omitempty"`
Services *[]Service `json:"services,omitempty" xml:"services>service,omitempty"`
Workflows *[]Workflow `json:"workflows,omitempty" xml:"workflows>workflow,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties>property,omitempty"`
}
type Hash struct {
Algorithm HashAlgorithm `json:"alg" xml:"alg,attr"`
Value string `json:"content" xml:",chardata"`
}
type HashAlgorithm string
const (
HashAlgoMD5 HashAlgorithm = "MD5"
HashAlgoSHA1 HashAlgorithm = "SHA-1"
HashAlgoSHA256 HashAlgorithm = "SHA-256"
HashAlgoSHA384 HashAlgorithm = "SHA-384"
HashAlgoSHA512 HashAlgorithm = "SHA-512"
HashAlgoSHA3_256 HashAlgorithm = "SHA3-256"
HashAlgoSHA3_384 HashAlgorithm = "SHA3-384"
HashAlgoSHA3_512 HashAlgorithm = "SHA3-512"
HashAlgoBlake2b_256 HashAlgorithm = "BLAKE2b-256"
HashAlgoBlake2b_384 HashAlgorithm = "BLAKE2b-384"
HashAlgoBlake2b_512 HashAlgorithm = "BLAKE2b-512"
HashAlgoBlake3 HashAlgorithm = "BLAKE3"
)
type IdentifiableAction struct {
Timestamp string `json:"timestamp,omitempty" xml:"timestamp,omitempty"`
Name string `json:"name,omitempty" xml:"name,omitempty"`
Email string `json:"email,omitempty" xml:"email,omitempty"`
}
type ImpactAnalysisJustification string
const (
IAJCodeNotPresent ImpactAnalysisJustification = "code_not_present"
IAJCodeNotReachable ImpactAnalysisJustification = "code_not_reachable"
IAJRequiresConfiguration ImpactAnalysisJustification = "requires_configuration"
IAJRequiresDependency ImpactAnalysisJustification = "requires_dependency"
IAJRequiresEnvironment ImpactAnalysisJustification = "requires_environment"
IAJProtectedByCompiler ImpactAnalysisJustification = "protected_by_compiler"
IAJProtectedAtRuntime ImpactAnalysisJustification = "protected_at_runtime"
IAJProtectedAtPerimeter ImpactAnalysisJustification = "protected_at_perimeter"
IAJProtectedByMitigatingControl ImpactAnalysisJustification = "protected_by_mitigating_control"
)
type ImpactAnalysisResponse string
const (
IARCanNotFix ImpactAnalysisResponse = "can_not_fix"
IARWillNotFix ImpactAnalysisResponse = "will_not_fix"
IARUpdate ImpactAnalysisResponse = "update"
IARRollback ImpactAnalysisResponse = "rollback"
IARWorkaroundAvailable ImpactAnalysisResponse = "workaround_available"
)
type ImpactAnalysisState string
const (
IASResolved ImpactAnalysisState = "resolved"
IASResolvedWithPedigree ImpactAnalysisState = "resolved_with_pedigree"
IASExploitable ImpactAnalysisState = "exploitable"
IASInTriage ImpactAnalysisState = "in_triage"
IASFalsePositive ImpactAnalysisState = "false_positive"
IASNotAffected ImpactAnalysisState = "not_affected"
)
type ImplementationPlatform string
const (
ImplementationPlatformGeneric ImplementationPlatform = "generic"
ImplementationPlatformX86_32 ImplementationPlatform = "x86_32"
ImplementationPlatformX86_64 ImplementationPlatform = "x86_64"
ImplementationPlatformARMv7A ImplementationPlatform = "armv7-a"
ImplementationPlatformARMv7M ImplementationPlatform = "armv7-m"
ImplementationPlatformARMv8A ImplementationPlatform = "armv8-a"
ImplementationPlatformARMv8M ImplementationPlatform = "armv8-m"
ImplementationPlatformARMv9A ImplementationPlatform = "armv9-a"
ImplementationPlatformARMv9M ImplementationPlatform = "armv9-m"
ImplementationPlatformS390x ImplementationPlatform = "s390x"
ImplementationPlatformPPC64 ImplementationPlatform = "ppc64"
ImplementationPlatformPPC64LE ImplementationPlatform = "ppc64le"
ImplementationPlatformOther ImplementationPlatform = "other"
ImplementationPlatformUnknown ImplementationPlatform = "unknown"
)
type Issue struct {
ID string `json:"id" xml:"id"`
Name string `json:"name,omitempty" xml:"name,omitempty"`
Description string `json:"description" xml:"description"`
Source *Source `json:"source,omitempty" xml:"source,omitempty"`
References *[]string `json:"references,omitempty" xml:"references>url,omitempty"`
Type IssueType `json:"type" xml:"type,attr"`
}
type IssueType string
const (
IssueTypeDefect IssueType = "defect"
IssueTypeEnhancement IssueType = "enhancement"
IssueTypeSecurity IssueType = "security"
)
type JSFSignature struct {
*JSFSigner `json:"-" xml:"-"`
Signers *[]JSFSigner `json:"signers,omitempty" xml:"-"`
Chain *[]JSFSigner `json:"chain,omitempty" xml:"-"`
}
type JSFSigner struct {
Algorithm string `json:"algorithm" xml:"-"`
KeyID string `json:"keyId,omitempty" xml:"-"`
PublicKey JSFPublicKey `json:"publicKey,omitempty" xml:"-"`
CertificatePath *[]string `json:"certificatePath,omitempty" xml:"-"`
Excludes *[]string `json:"excludes,omitempty" xml:"-"`
Value string `json:"value" xml:"-"`
}
type JSFPublicKey struct {
KTY string `json:"kty,omitempty" xml:"-"`
CRV string `json:"crv,omitempty" xml:"-"`
X string `json:"x,omitempty" xml:"-"`
Y string `json:"y,omitempty" xml:"-"`
N string `json:"n,omitempty" xml:"-"`
E string `json:"e,omitempty" xml:"-"`
}
type License struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
ID string `json:"id,omitempty" xml:"id,omitempty"`
Name string `json:"name,omitempty" xml:"name,omitempty"`
Acknowledgement LicenseAcknowledgement `json:"acknowledgement,omitempty" xml:"acknowledgement,attr,omitempty"`
Text *AttachedText `json:"text,omitempty" xml:"text,omitempty"`
URL string `json:"url,omitempty" xml:"url,omitempty"`
Licensing *Licensing `json:"licensing,omitempty" xml:"licensing,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties>property,omitempty"`
}
type LicenseAcknowledgement string
const (
LicenseAcknowledgementDeclared LicenseAcknowledgement = "declared"
LicenseAcknowledgementConcluded LicenseAcknowledgement = "concluded"
)
type Licenses []LicenseChoice
type LicenseChoice struct {
License *License `json:"license,omitempty" xml:"-"`
Expression string `json:"expression,omitempty" xml:"-"`
}
type LicenseType string
const (
LicenseTypeAcademic LicenseType = "academic"
LicenseTypeAppliance LicenseType = "appliance"
LicenseTypeClientAccess LicenseType = "client-access"
LicenseTypeConcurrentUser LicenseType = "concurrent-user"
LicenseTypeCorePoints LicenseType = "core-points"
LicenseTypeCustomMetric LicenseType = "custom-metric"
LicenseTypeDevice LicenseType = "device"
LicenseTypeEvaluation LicenseType = "evaluation"
LicenseTypeNamedUser LicenseType = "named-user"
LicenseTypeNodeLocked LicenseType = "node-locked"
LicenseTypeOEM LicenseType = "oem"
LicenseTypeOther LicenseType = "other"
LicenseTypePerpetual LicenseType = "perpetual"
LicenseTypeProcessorPoints LicenseType = "processor-points"
LicenseTypeSubscription LicenseType = "subscription"
LicenseTypeUser LicenseType = "user"
)
type Licensing struct {
AltIDs *[]string `json:"altIds,omitempty" xml:"altIds>altId,omitempty"`
Licensor *OrganizationalEntityOrContact `json:"licensor,omitempty" xml:"licensor,omitempty"`
Licensee *OrganizationalEntityOrContact `json:"licensee,omitempty" xml:"licensee,omitempty"`
Purchaser *OrganizationalEntityOrContact `json:"purchaser,omitempty" xml:"purchaser,omitempty"`
PurchaseOrder string `json:"purchaseOrder,omitempty" xml:"purchaseOrder,omitempty"`
LicenseTypes *[]LicenseType `json:"licenseTypes,omitempty" xml:"licenseTypes>licenseType,omitempty"`
LastRenewal string `json:"lastRenewal,omitempty" xml:"lastRenewal,omitempty"`
Expiration string `json:"expiration,omitempty" xml:"expiration,omitempty"`
}
type Lifecycle struct {
Name string `json:"name,omitempty" xml:"name,omitempty"`
Phase LifecyclePhase `json:"phase,omitempty" xml:"phase,omitempty"`
Description string `json:"description,omitempty" xml:"description,omitempty"`
}
type LifecyclePhase string
const (
LifecyclePhaseBuild LifecyclePhase = "build"
LifecyclePhaseDecommission LifecyclePhase = "decommission"
LifecyclePhaseDesign LifecyclePhase = "design"
LifecyclePhaseDiscovery LifecyclePhase = "discovery"
LifecyclePhaseOperations LifecyclePhase = "operations"
LifecyclePhasePostBuild LifecyclePhase = "post-build"
LifecyclePhasePreBuild LifecyclePhase = "pre-build"
)
// MediaType defines the official media types for CycloneDX BOMs.
// See https://cyclonedx.org/specification/overview/#registered-media-types
type MediaType int
const (
MediaTypeJSON MediaType = iota + 1 // application/vnd.cyclonedx+json
MediaTypeXML // application/vnd.cyclonedx+xml
MediaTypeProtobuf // application/x.vnd.cyclonedx+protobuf
)
func (mt MediaType) WithVersion(specVersion SpecVersion) (string, error) {
if mt == MediaTypeJSON && specVersion < SpecVersion1_2 {
return "", fmt.Errorf("json format is not supported for specification versions lower than %s", SpecVersion1_2)
}
return fmt.Sprintf("%s; version=%s", mt, specVersion), nil
}
type Metadata struct {
Timestamp string `json:"timestamp,omitempty" xml:"timestamp,omitempty"`
Lifecycles *[]Lifecycle `json:"lifecycles,omitempty" xml:"lifecycles>lifecycle,omitempty"`
Tools *ToolsChoice `json:"tools,omitempty" xml:"tools,omitempty"`
Authors *[]OrganizationalContact `json:"authors,omitempty" xml:"authors>author,omitempty"`
Component *Component `json:"component,omitempty" xml:"component,omitempty"`
Manufacture *OrganizationalEntity `json:"manufacture,omitempty" xml:"manufacture,omitempty"` // Deprecated: Use Component Manufacturer instead.
Manufacturer *OrganizationalEntity `json:"manufacturer,omitempty" xml:"manufacturer,omitempty"`
Supplier *OrganizationalEntity `json:"supplier,omitempty" xml:"supplier,omitempty"`
Licenses *Licenses `json:"licenses,omitempty" xml:"licenses,omitempty"`
Properties *[]Property `json:"properties,omitempty" xml:"properties>property,omitempty"`
}
type MLDatasetChoice struct {
Ref string `json:"-" xml:"-"`
ComponentData *ComponentData `json:"-" xml:"-"`
}
type MLInputOutputParameters struct {
Format string `json:"format,omitempty" xml:"format,omitempty"`
}
type MLModelCard struct {
BOMRef string `json:"bom-ref,omitempty" xml:"bom-ref,attr,omitempty"`
ModelParameters *MLModelParameters `json:"modelParameters,omitempty" xml:"modelParameters,omitempty"`
QuantitativeAnalysis *MLQuantitativeAnalysis `json:"quantitativeAnalysis,omitempty" xml:"quantitativeAnalysis,omitempty"`
Considerations *MLModelCardConsiderations `json:"considerations,omitempty" xml:"considerations,omitempty"`
}
type MLModelCardConsiderations struct {
Users *[]string `json:"users,omitempty" xml:"users>user,omitempty"`
UseCases *[]string `json:"useCases,omitempty" xml:"useCases>useCase,omitempty"`
TechnicalLimitations *[]string `json:"technicalLimitations,omitempty" xml:"technicalLimitations>technicalLimitation,omitempty"`
PerformanceTradeoffs *[]string `json:"performanceTradeoffs,omitempty" xml:"performanceTradeoffs>performanceTradeoff,omitempty"`
EthicalConsiderations *[]MLModelCardEthicalConsideration `json:"ethicalConsiderations,omitempty" xml:"ethicalConsiderations>ethicalConsideration,omitempty"`
EnvironmentalConsiderations *MLModelCardEnvironmentalConsiderations `json:"environmentalConsiderations,omitempty" xml:"environmentalConsiderations,omitempty"`
FairnessAssessments *[]MLModelCardFairnessAssessment `json:"fairnessAssessments,omitempty" xml:"fairnessAssessments>fairnessAssessment,omitempty"`
}
type MLModelCardEnvironmentalConsiderations struct {