-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathschema.json
851 lines (834 loc) · 25.3 KB
/
schema.json
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"action": {
"title": "Agent action",
"description": "An Elastic Agent action",
"type": "object",
"properties": {
"_id": {
"description": "The unique identifier for action document",
"type": "string"
},
"_seq_no": {
"description": "The action sequence number",
"type": "integer"
},
"action_id": {
"description": "The unique identifier for the Elastic Agent action. There could be multiple documents with the same action_id if the action is split into two separate documents.",
"type": "string",
"format": "uuid"
},
"@timestamp": {
"description": "Date/time the action was created",
"type": "string",
"format": "date-time"
},
"expiration": {
"description": "The action expiration date/time",
"type": "string",
"format": "date-time"
},
"start_time": {
"description": "The action start date/time",
"type": "string",
"format": "date-time"
},
"minimum_execution_duration": {
"description": "The minimum time (in seconds) provided for an action execution when scheduled by fleet-server.",
"type": "integer"
},
"rollout_duration_seconds": {
"description": "The rollout duration (in seconds) provided for an action execution when scheduled by fleet-server.",
"type": "integer"
},
"type": {
"description": "The action type. INPUT_ACTION is the value for the actions that suppose to be routed to the endpoints/beats.",
"type": "string"
},
"input_type": {
"description": "The input type the actions should be routed to.",
"type": "string"
},
"timeout": {
"description": "The optional action timeout in seconds",
"type": "integer"
},
"user_id": {
"description": "The ID of the user who created the action.",
"type": "string"
},
"traceparent": {
"description": "APM traceparent for the action.",
"type": "string"
},
"agents": {
"description": "The Agent IDs the action is intended for. No support for json.RawMessage with the current generator. Could be useful to lazy parse the agent ids",
"type": "array",
"items": {
"type": "string"
}
},
"data": {
"description": "The opaque payload.",
"format": "raw"
},
"signed": {
"$ref": "#/definitions/signed"
}
},
"required": [
"id"
]
},
"signed": {
"description": "The action signed data and signature.",
"type": "object",
"properties": {
"data": {
"description": "The base64 encoded, UTF-8 JSON serialized action bytes that are signed.",
"type": "string"
},
"signature": {
"description": "The base64 encoded signature.",
"type": "string"
}
},
"required": [
"data",
"signature"
]
},
"action-result": {
"title": "Agent action results",
"description": "An Elastic Agent action results",
"type": "object",
"properties": {
"@timestamp": {
"description": "Date/time the action was created",
"type": "string",
"format": "date-time"
},
"agent_id": {
"description": "The agent id.",
"type": "string"
},
"action_id": {
"description": "The action id.",
"type": "string"
},
"action_input_type": {
"description": "The input type of the original action.",
"type": "string"
},
"started_at": {
"description": "Date/time the action was started",
"type": "string",
"format": "date-time"
},
"completed_at": {
"description": "Date/time the action was completed",
"type": "string",
"format": "date-time"
},
"action_data": {
"description": "The opaque payload.",
"format": "raw"
},
"action_response": {
"description": "The custom action response payload.",
"format": "raw"
},
"error": {
"description": "The action error message.",
"type": "string"
},
"data": {
"description": "The opaque payload.",
"format": "raw"
}
},
"required": [
"id",
"agent",
"action"
]
},
"agent-metadata": {
"title": "Agent Metadata",
"description": "An Elastic Agent metadata",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for the Elastic Agent",
"type": "string",
"format": "uuid"
},
"version": {
"description": "The version of the Elastic Agent",
"type": "string"
}
},
"required": [
"id",
"version"
]
},
"artifact": {
"title": "Artifact",
"description": "An artifact served by Fleet",
"type": "object",
"properties": {
"identifier": {
"description": "Human readable artifact identifier",
"type": "string"
},
"compression_algorithm": {
"description": "Name of compression algorithm applied to artifact",
"type": "string"
},
"encryption_algorithm": {
"description": "Name of encryption algorithm applied to artifact",
"type": "string"
},
"encoded_sha256": {
"description": "SHA256 of artifact after encoding has been applied",
"type": "string"
},
"encoded_size": {
"description": "Size of artifact after encoding has been applied",
"type": "integer"
},
"decoded_sha256": {
"description": "SHA256 of artifact before encoding has been applied",
"type": "string"
},
"decoded_size": {
"description": "Size of artifact before encoding has been applied",
"type": "integer"
},
"created": {
"description": "Timestamp artifact was created",
"type": "string",
"format": "date-time"
},
"body": {
"description": "Encoded artifact data",
"format": "raw"
},
"package_name": {
"description": "Name of the package that owns this artifact",
"type": "string"
}
},
"required": [
"identifier",
"compressionAlgorithm",
"encodedSha256",
"encodedSize",
"decodedSha256",
"decodedSize",
"created",
"body"
]
},
"host-metadata": {
"title": "Host Metadata",
"description": "The host metadata for the Elastic Agent",
"type": "object",
"properties": {
"id": {
"description": "The ID of the host",
"type": "string"
},
"architecture": {
"description": "The architecture for the Elastic Agent",
"type": "string"
},
"name": {
"description": "The hostname of the Elastic Agent",
"type": "string"
},
"ip": {
"description": "The IP addresses of the Elastic Agent",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"id",
"architecture",
"name"
]
},
"server-metadata": {
"title": "Server Metadata",
"description": "A Fleet Server metadata",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for the Fleet Server",
"type": "string",
"format": "uuid"
},
"version": {
"description": "The version of the Fleet Server",
"type": "string"
}
},
"required": [
"id",
"version"
]
},
"server": {
"title": "Server",
"description": "A Fleet Server",
"type": "object",
"properties": {
"@timestamp": {
"description": "Date/time the server was updated",
"type": "string",
"format": "date-time"
},
"agent": { "$ref": "#/definitions/agent-metadata" },
"host": { "$ref": "#/definitions/host-metadata" },
"server": { "$ref": "#/definitions/server-metadata" }
},
"required": [
"agent",
"host",
"server"
]
},
"policy": {
"title": "Policy",
"description": "A policy that an Elastic Agent is attached to",
"type": "object",
"properties": {
"@timestamp": {
"description": "Date/time the policy revision was created",
"type": "string",
"format": "date-time"
},
"policy_id": {
"description": "The ID of the policy",
"type": "string",
"format": "uuid"
},
"revision_idx": {
"description": "The revision index of the policy",
"type": "integer"
},
"coordinator_idx": {
"description": "The coordinator index of the policy",
"type": "integer"
},
"data": {
"$ref": "#/definitions/policy-data"
},
"default_fleet_server": {
"description": "True when this policy is the default policy to start Fleet Server",
"type": "boolean"
},
"unenroll_timeout": {
"description": "Timeout (seconds) that an Elastic Agent should be un-enrolled.",
"type": "integer"
}
},
"required": [
"policy_id",
"revision_idx",
"coordinator_idx",
"data",
"default_fleet_server"
]
},
"policy-leader": {
"title": "Policy Leader",
"description": "The current leader Fleet Server for a policy",
"type": "object",
"properties": {
"@timestamp": {
"description": "Date/time the leader was taken or held",
"type": "string",
"format": "date-time"
},
"server": { "$ref": "#/definitions/server-metadata" }
},
"required": [
"server"
]
},
"to_retire_api_key_ids": {
"type": "array",
"items": {
"description": "the Output API Keys that were replaced and should be retired",
"type": "object",
"properties": {
"id": {
"description": "API Key identifier",
"type": "string"
},
"retired_at": {
"description": "Date/time the API key was retired",
"type": "string",
"format": "date-time"
},
"output": {
"description": "Output name where the API Key belongs",
"type": "string"
}
}
}
},
"policy_output" : {
"type": "object",
"description": "holds the needed data to manage the output API keys",
"properties": {
"api_key": {
"description": "API key the Elastic Agent uses to authenticate with elasticsearch",
"type": "string"
},
"to_retire_api_key_ids": {
"description": "API keys to be invalidated on next agent ack",
"$ref": "#/definitions/to_retire_api_key_ids"
},
"api_key_id": {
"description": "ID of the API key the Elastic Agent uses to authenticate with elasticsearch",
"type": "string"
},
"permissions_hash": {
"description": "The policy output permissions hash",
"type": "string"
},
"type": {
"description": "Type is the output type. Currently only Elasticsearch is supported.",
"type": "string"
}
},
"required": [
"api_key",
"api_key_history",
"api_key_id",
"permissions_hash",
"type"
]
},
"output_health": {
"description": "Output health represents a health state of an output",
"type": "object",
"properties": {
"output": {
"type": "string",
"description": "Output ID"
},
"state": {
"type": "string",
"description": "Health state, can be HEALTHY or DEGRADED"
},
"message": {
"type": "string",
"description": "Long state message if unhealthy"
},
"@timestamp": {
"type": "string",
"description": "Timestamp of reported state"
},
"data_stream": {
"type": "object",
"properties": {
"dataset": {
"type": "string"
},
"type": {
"type": "string"
},
"namespace": {
"type": "string"
}
}
}
}
},
"agent": {
"title": "Agent",
"description": "An Elastic Agent that has enrolled into Fleet",
"type": "object",
"properties": {
"_id": {
"description": "The unique identifier for the Elastic Agent",
"type": "string",
"format": "uuid"
},
"_version": {
"description": "The version of the document in the index",
"type": "integer"
},
"shared_id": {
"description": "Shared ID",
"type": "string"
},
"enrollment_id": {
"description": "Enrollment ID",
"type": "string"
},
"type": {
"description": "Type",
"type": "string"
},
"active": {
"description": "Active flag",
"type": "boolean"
},
"enrolled_at": {
"description": "Date/time the Elastic Agent enrolled",
"type": "string",
"format": "date-time"
},
"unenrolled_at": {
"description": "Date/time the Elastic Agent unenrolled",
"type": "string",
"format": "date-time"
},
"unenrolled_reason": {
"description": "Reason the Elastic Agent was unenrolled",
"type": "string",
"enum": ["manual", "timeout"]
},
"unenrollment_started_at": {
"description": "Date/time the Elastic Agent unenrolled started",
"type": "string",
"format": "date-time"
},
"upgraded_at": {
"description": "Date/time the Elastic Agent was last upgraded",
"type": "string",
"format": "date-time"
},
"upgrade_started_at": {
"description": "Date/time the Elastic Agent started the current upgrade",
"type": "string",
"format": "date-time"
},
"upgrade_status": {
"description": "Upgrade status",
"type": "string"
},
"access_api_key_id": {
"description": "ID of the API key the Elastic Agent must used to contact Fleet Server",
"type": "string"
},
"agent": { "$ref": "#/definitions/agent-metadata" },
"user_provided_metadata": {
"description": "User provided metadata information for the Elastic Agent",
"format": "raw"
},
"tags": {
"description": "User provided tags for the Elastic Agent",
"type": "array",
"items": {
"type": "string"
}
},
"local_metadata": {
"description": "Local metadata information for the Elastic Agent",
"format": "raw"
},
"policy_id": {
"description": "The policy ID for the Elastic Agent",
"type": "string",
"format": "uuid"
},
"policy_revision_idx": {
"description": "The current policy revision_idx for the Elastic Agent",
"type": "integer"
},
"policy_coordinator_idx": {
"description": "The current policy coordinator for the Elastic Agent",
"type": "integer"
},
"policy_output_permissions_hash": {
"description": "Deprecated. Use Outputs instead. The policy output permissions hash",
"type": "string"
},
"last_updated": {
"description": "Date/time the Elastic Agent was last updated",
"type": "string",
"format": "date-time"
},
"last_checkin": {
"description": "Date/time the Elastic Agent checked in last time",
"type": "string",
"format": "date-time"
},
"last_checkin_status": {
"description": "Last checkin status",
"type": "string"
},
"last_checkin_message": {
"description": "Last checkin message",
"type": "string"
},
"components": {
"description": "Elastic Agent components detailed status information",
"format": "raw"
},
"default_api_key_id": {
"description": "Deprecated. Use Outputs instead. ID of the API key the Elastic Agent uses to authenticate with elasticsearch",
"type": "string"
},
"default_api_key": {
"description": "Deprecated. Use Outputs instead. API key the Elastic Agent uses to authenticate with elasticsearch",
"type": "string"
},
"default_api_key_history": {
"description": "Deprecated. Use Outputs instead. Default API Key History",
"$ref": "#/definitions/to_retire_api_key_ids"
},
"outputs": {
"description": "Outputs is the policy output data, mapping the output name to its data",
"type": "object",
"additionalProperties": { "$ref": "#/definitions/policy_output"}
},
"updated_at": {
"description": "Date/time the Elastic Agent was last updated",
"type": "string",
"format": "date-time"
},
"packages": {
"description": "Packages array",
"type": "array",
"items": {
"type": "string"
}
},
"action_seq_no": {
"description": "The last acknowledged action sequence number for the Elastic Agent",
"type": "array",
"items": {
"type": "integer"
}
},
"upgrade_details": {
"description": "Additional upgrade status details.",
"type": "object"
}
},
"required": [
"_id",
"type",
"active",
"enrolled_at",
"status"
]
},
"enrollment_api_key": {
"title": "Enrollment API key",
"description": "An Elastic Agent enrollment API key",
"type": "object",
"properties": {
"active": {
"description": "True when the key is active",
"type": "boolean"
},
"api_key_id": {
"description": "The unique identifier for the enrollment key, currently xid",
"type": "string"
},
"api_key": {
"description": "Api key",
"type": "string"
},
"name": {
"description": "Enrollment key name",
"type": "string"
},
"policy_id": {
"type": "string"
},
"expire_at": {
"type": "string",
"format": "date-time"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"api_key_id",
"api_key"
]
},
"checkin": {
"title": "Checkin",
"description": "An Elastic Agent checkin to Fleet",
"type": "object",
"properties": {
"_id": {
"description": "The unique identifier for the Elastic Agent checkin",
"type": "string",
"format": "uuid"
},
"@timestamp": {
"description": "Date/time the checkin was created",
"type": "string",
"format": "date-time"
},
"agent": { "$ref": "#/definitions/agent-metadata" },
"host": { "$ref": "#/definitions/host-metadata" },
"server": { "$ref": "#/definitions/server-metadata" },
"status": {
"description": "The current overall status of the Elastic Agent",
"type": "string",
"enum": ["enrolling", "healthy", "error", "degraded", "offline", "unenrolling", "upgrading"]
},
"message": {
"description": "The current overall status message of the Elastic Agent",
"type": "string"
},
"policy": {
"title": "Checkin Policy",
"description": "The current status of the applied policy",
"type": "object",
"properties": {
"id": {
"description": "The ID for the policy",
"type": "string",
"format": "uuid"
},
"revision": {
"description": "The revision of the policy",
"type": "integer"
},
"inputs": {
"title": "Checkin Policy Input",
"description": "The current input status per policy",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "The ID for the input",
"type": "string",
"format": "uuid"
},
"template_id": {
"description": "The template ID for the input",
"type": "string",
"format": "uuid"
},
"status": {
"description": "The current status of the input",
"type": "string",
"enum": ["healthy", "error", "degraded"]
},
"message": {
"description": "The current status message of the intput",
"type": "string"
}
},
"required": [
"id",
"template_id",
"status",
"message"
]
}
}
},
"required": [
"id",
"revision",
"inputs"
]
}
},
"required": [
"_id",
"agent",
"status",
"message",
"enrolled_at",
"updated_at"
]
},
"policy-data": {
"title": "Policy Data",
"description": "The policy data that an agent needs to run",
"type": "object",
"properties": {
"id": {
"description": "The policy's ID",
"type": "string"
},
"outputs": {
"description": "A map of all outputs that the agent running the policy can use to send data to.",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"$comment": "results in map[string]map[string]interface{}. We use a dynamic output objects because it would be a larger task to define the properties we need to support for each output type, this may be done as future work"
}
}
},
"inputs": {
"description": "A list of all inputs the agent should run",
"type": "array",
"items": {
"type": "object",
"additionalProperties":{
"$comment": "embedded additionalProperties type results in `outputs map[string]interface{}`"
}
}
},
"secret_references": {
"description": "A list of all secrets fleet-server needs to inject into the policy before passing it to the agent. This attribute is removed when policy data is send to an agent.",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
]
}
},
"revision": {
"description": "The policy revision number. Should match revision_idx",
"type": "integer"
},
"agent": {
"description": "The policy's agent configuration details",
"format": "raw"
},
"signed": {
"$ref": "#/definitions/signed"
},
"output_permissions": {
"description": "The Elasticsearch permissions needed to run the policy",
"format": "raw"
},
"fleet": {
"description": "The policy's fleet configuration details",
"format": "raw"
}
},
"required": [
"id",
"revision",
"outputs"
]
}
}
}