mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
9d01ba33c6
Extended the OVAL parser/analyzer so that we can scan RHEL based systems.
132 lines
3.7 KiB
Cheetah
132 lines
3.7 KiB
Cheetah
{{ define "enroll" -}}
|
|
{
|
|
"enroll_secret": "{{ .EnrollSecret }}",
|
|
"host_details": {
|
|
"os_version": {
|
|
"build": "",
|
|
"major": "",
|
|
"minor": "",
|
|
"name": "Ubuntu 22.4.0",
|
|
"patch": "",
|
|
"platform": "ubuntu",
|
|
"platform_like": "ubuntu",
|
|
"version": "Ubuntu 22.4.0"
|
|
},
|
|
"osquery_info": {
|
|
"build_distro": "22.4.0",
|
|
"build_platform": "linux",
|
|
"config_hash": "",
|
|
"config_valid": "0",
|
|
"extensions": "inactive",
|
|
"instance_id": "{{ .UUID }}",
|
|
"pid": "12947",
|
|
"platform_mask": "21",
|
|
"start_time": "1580931224",
|
|
"uuid": "{{ .UUID }}",
|
|
"version": "4.6.0",
|
|
"watcher": "12946"
|
|
},
|
|
"platform_info": {
|
|
"address": "0xff990000",
|
|
"date": "12/16/2019 ",
|
|
"extra": "MBP114; 196.0.0.0.0; root@xapp160; Mon Dec 16 15:55:18 PST 2019; 196 (B&I); F000_B00; Official Build, Release; Apple LLVM version 5.0 (clang-500.0.68) (based on LLVM 3.3svn)",
|
|
"revision": "196 (B&I)",
|
|
"size": "8388608",
|
|
"vendor": "Apple Inc. ",
|
|
"version": "196.0.0.0.0 ",
|
|
"volume_size": "1507328"
|
|
},
|
|
"system_info": {
|
|
"computer_name": "{{ .CachedString "hostname" }}",
|
|
"cpu_brand": "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
|
|
"cpu_logical_cores": "8",
|
|
"cpu_physical_cores": "4",
|
|
"cpu_subtype": "Intel x86-64h Haswell",
|
|
"cpu_type": "x86_64h",
|
|
"hardware_model": "MacBookPro11,4",
|
|
"hardware_serial": "D02R835DG8WK",
|
|
"hardware_vendor": "Apple Inc.",
|
|
"hardware_version": "1.0",
|
|
"hostname": "{{ .CachedString "hostname" }}",
|
|
"local_hostname": "{{ .CachedString "hostname" }}",
|
|
"physical_memory": "17179869184",
|
|
"uuid": "{{ .UUID }}"
|
|
}
|
|
},
|
|
"host_identifier": "{{ .CachedString "hostname" }}",
|
|
"platform_type": "16"
|
|
}
|
|
{{- end }}
|
|
|
|
{{ define "fleet_detail_query_os_version" -}}
|
|
[
|
|
{
|
|
"name":"Ubuntu 22.4.0",
|
|
"version":"Ubuntu 22.4.0",
|
|
"major":"",
|
|
"minor":"",
|
|
"patch":"",
|
|
"build":"",
|
|
"platform":"ubuntu",
|
|
"platform_like":"ubuntu",
|
|
"codename":""
|
|
}
|
|
]
|
|
{{- end }}
|
|
|
|
|
|
{{ define "fleet_detail_query_osquery_info" -}}
|
|
[
|
|
{
|
|
"pid":"11287",
|
|
"uuid":"{{ .UUID }}",
|
|
"instance_id":"{{ .UUID }}",
|
|
"version":"4.1.2",
|
|
"config_hash":"b01efbf375ac6767f259ae98751154fef727ce35",
|
|
"config_valid":"1",
|
|
"extensions":"inactive",
|
|
"build_platform":"linux",
|
|
"build_distro":"22.4.0",
|
|
"start_time":"1582857555",
|
|
"watcher":"11286",
|
|
"platform_mask":"21"
|
|
}
|
|
]
|
|
{{- end }}
|
|
|
|
{{ define "fleet_detail_query_users" -}}
|
|
[
|
|
{{ range $index, $item := .HostUsersMacOS }}
|
|
{{if $index}},{{end}}
|
|
{
|
|
"uid": "{{ .Uid }}",
|
|
"username": "{{ .Username }}",
|
|
"type": "{{ .Type }}",
|
|
"groupname": "{{ .GroupName }}",
|
|
"shell": "{{ .Shell }}"
|
|
}
|
|
{{- end }}
|
|
]
|
|
{{- end }}
|
|
|
|
{{ define "fleet_detail_query_software_linux" -}}
|
|
[
|
|
{{ range $index, $item := .SoftwareUbuntu2204 }}
|
|
{{if $index}},{{end}}
|
|
{
|
|
"name": "{{ .Name }}",
|
|
"version": "{{ .Version }}",
|
|
"type": "Application (macOS)",
|
|
"bundle_identifier": "{{ .BundleIdentifier }}",
|
|
"source": "apps",
|
|
{{/* Note that in Go < 1.18, `{{ or (and .LastOpendedAt .LastOpenedAt.Unix) "" }}` won't work as expected because "and" and "or" don't short circuit. This was changed in Go 1.18 */}}
|
|
{{if .LastOpenedAt}}
|
|
"last_opened_at": "{{ .LastOpenedAt.Unix }}"
|
|
{{else}}
|
|
"last_opened_at": "-1"
|
|
{{end}}
|
|
}
|
|
{{- end }}
|
|
]
|
|
{{- end }}
|