@@ -13,7 +13,6 @@ import {
1313 HostMetadata ,
1414 HostOS ,
1515 HostPolicyResponse ,
16- HostPolicyResponseActions ,
1716 HostPolicyResponseActionStatus ,
1817 PolicyData ,
1918} from './types' ;
@@ -564,88 +563,108 @@ export class EndpointDocGenerator {
564563 endpoint : {
565564 policy : {
566565 applied : {
567- actions : {
568- configure_elasticsearch_connection : {
569- message : 'elasticsearch communications configured successfully' ,
566+ actions : [
567+ {
568+ name : 'configure_elasticsearch_connection' ,
569+ message : 'elasticsearch comes configured successfully' ,
570570 status : HostPolicyResponseActionStatus . success ,
571571 } ,
572- configure_kernel : {
572+ {
573+ name : 'configure_kernel' ,
573574 message : 'Failed to configure kernel' ,
574575 status : HostPolicyResponseActionStatus . failure ,
575576 } ,
576- configure_logging : {
577+ {
578+ name : 'configure_logging' ,
577579 message : 'Successfully configured logging' ,
578580 status : HostPolicyResponseActionStatus . success ,
579581 } ,
580- configure_malware : {
582+ {
583+ name : 'configure_malware' ,
581584 message : 'Unexpected error configuring malware' ,
582585 status : HostPolicyResponseActionStatus . failure ,
583586 } ,
584- connect_kernel : {
587+ {
588+ name : 'connect_kernel' ,
585589 message : 'Successfully initialized minifilter' ,
586590 status : HostPolicyResponseActionStatus . success ,
587591 } ,
588- detect_file_open_events : {
592+ {
593+ name : 'detect_file_open_events' ,
589594 message : 'Successfully stopped file open event reporting' ,
590595 status : HostPolicyResponseActionStatus . success ,
591596 } ,
592- detect_file_write_events : {
597+ {
598+ name : 'detect_file_write_events' ,
593599 message : 'Failed to stop file write event reporting' ,
594600 status : HostPolicyResponseActionStatus . success ,
595601 } ,
596- detect_image_load_events : {
602+ {
603+ name : 'detect_image_load_events' ,
597604 message : 'Successfully started image load event reporting' ,
598605 status : HostPolicyResponseActionStatus . success ,
599606 } ,
600- detect_process_events : {
607+ {
608+ name : 'detect_process_events' ,
601609 message : 'Successfully started process event reporting' ,
602610 status : HostPolicyResponseActionStatus . success ,
603611 } ,
604- download_global_artifacts : {
605- message : 'Succesfully downloaded global artifacts' ,
612+ {
613+ name : 'download_global_artifacts' ,
614+ message : 'Failed to download EXE model' ,
606615 status : HostPolicyResponseActionStatus . success ,
607616 } ,
608- load_config : {
617+ {
618+ name : 'load_config' ,
609619 message : 'Successfully parsed configuration' ,
610620 status : HostPolicyResponseActionStatus . success ,
611621 } ,
612- load_malware_model : {
613- message : 'Successfully loaded malware model' ,
622+ {
623+ name : 'load_malware_mode' ,
624+ message : 'Error deserializing EXE model; no valid malware model installed' ,
614625 status : HostPolicyResponseActionStatus . success ,
615626 } ,
616- read_elasticsearch_config : {
627+ {
628+ name : 'read_elasticsearch_config' ,
617629 message : 'Successfully read Elasticsearch configuration' ,
618630 status : HostPolicyResponseActionStatus . success ,
619631 } ,
620- read_events_config : {
632+ {
633+ name : 'read_events_config' ,
621634 message : 'Successfully read events configuration' ,
622635 status : HostPolicyResponseActionStatus . success ,
623636 } ,
624- read_kernel_config : {
637+ {
638+ name : 'read_kernel_config' ,
625639 message : 'Succesfully read kernel configuration' ,
626640 status : HostPolicyResponseActionStatus . success ,
627641 } ,
628- read_logging_config : {
629- message : 'field (logging.debugview) not found in config' ,
642+ {
643+ name : 'read_logging_config' ,
644+ message : 'Field (logging.debugview) not found in config' ,
630645 status : HostPolicyResponseActionStatus . success ,
631646 } ,
632- read_malware_config : {
647+ {
648+ name : 'read_malware_config' ,
633649 message : 'Successfully read malware detect configuration' ,
634650 status : HostPolicyResponseActionStatus . success ,
635651 } ,
636- workflow : {
652+ {
653+ name : 'workflow' ,
637654 message : 'Failed to apply a portion of the configuration (kernel)' ,
638655 status : HostPolicyResponseActionStatus . success ,
639656 } ,
640- download_model : {
657+ {
658+ name : 'download_model' ,
641659 message : 'Failed to apply a portion of the configuration (kernel)' ,
642660 status : HostPolicyResponseActionStatus . success ,
643661 } ,
644- ingest_events_config : {
662+ {
663+ name : 'ingest_events_config' ,
645664 message : 'Failed to apply a portion of the configuration (kernel)' ,
646665 status : HostPolicyResponseActionStatus . success ,
647666 } ,
648- } ,
667+ ] ,
649668 id : this . commonInfo . endpoint . policy . id ,
650669 policy : {
651670 id : this . commonInfo . endpoint . policy . id ,
@@ -658,19 +677,39 @@ export class EndpointDocGenerator {
658677 status : status ( ) ,
659678 } ,
660679 logging : {
661- concerned_actions : this . randomHostPolicyResponseActions ( ) ,
680+ concerned_actions : this . randomHostPolicyResponseActionNames ( ) ,
662681 status : status ( ) ,
663682 } ,
664683 malware : {
665- concerned_actions : this . randomHostPolicyResponseActions ( ) ,
684+ concerned_actions : this . randomHostPolicyResponseActionNames ( ) ,
666685 status : status ( ) ,
667686 } ,
668687 streaming : {
669- concerned_actions : this . randomHostPolicyResponseActions ( ) ,
688+ concerned_actions : this . randomHostPolicyResponseActionNames ( ) ,
670689 status : status ( ) ,
671690 } ,
672691 } ,
673692 } ,
693+ artifacts : {
694+ global : {
695+ version : '1.4.0' ,
696+ identifiers : [
697+ {
698+ name : 'endpointpe-model' ,
699+ sha256 : 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ,
700+ } ,
701+ ] ,
702+ } ,
703+ user : {
704+ version : '1.4.0' ,
705+ identifiers : [
706+ {
707+ name : 'user-model' ,
708+ sha256 : 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ,
709+ } ,
710+ ] ,
711+ } ,
712+ } ,
674713 status : this . randomHostPolicyResponseActionStatus ( ) ,
675714 version : policyVersion ,
676715 } ,
@@ -679,7 +718,12 @@ export class EndpointDocGenerator {
679718 event : {
680719 created : ts ,
681720 id : this . seededUUIDv4 ( ) ,
682- kind : 'policy_response' ,
721+ kind : 'state' ,
722+ category : 'host' ,
723+ type : 'change' ,
724+ module : 'endpoint' ,
725+ action : 'endpoint_policy_response' ,
726+ dataset : 'endpoint.policy' ,
683727 } ,
684728 } ;
685729 }
@@ -728,7 +772,7 @@ export class EndpointDocGenerator {
728772 return uuid . v4 ( { random : [ ...this . randomNGenerator ( 255 , 16 ) ] } ) ;
729773 }
730774
731- private randomHostPolicyResponseActions ( ) : Array < keyof HostPolicyResponseActions > {
775+ private randomHostPolicyResponseActionNames ( ) : string [ ] {
732776 return this . randomArray ( this . randomN ( 8 ) , ( ) =>
733777 this . randomChoice ( [
734778 'load_config' ,
0 commit comments