From 95c25a2e9f2fb07623f11f1167398d4631a7beb6 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Sat, 16 Sep 2023 20:56:19 -0700 Subject: [PATCH] WIP --- cli/providers/providers.go | 7 ++- providers-sdk/v1/testutils/testutils.go | 7 ++- providers/builtin.go | 11 ++++ providers/os.resources.json | 1 - providers/providers.go | 43 ++++++++++++++ providers/recording.go | 25 ++++---- providers/runtime.go | 77 ++++++++++++++++++++++--- 7 files changed, 147 insertions(+), 24 deletions(-) delete mode 100644 providers/os.resources.json diff --git a/cli/providers/providers.go b/cli/providers/providers.go index ec0d85e489..1428083734 100644 --- a/cli/providers/providers.go +++ b/cli/providers/providers.go @@ -307,15 +307,18 @@ func setConnector(provider *plugin.Provider, connector *plugin.Connector, run fu if recordingPath == "" { recordingPath = useRecording } + doRecord := record != "" - runtime.Recording, err = providers.NewRecording(recordingPath, providers.RecordingOptions{ - DoRecord: record != "", + recording, err := providers.NewRecording(recordingPath, providers.RecordingOptions{ + DoRecord: doRecord, PrettyPrintJSON: pretty, }) if err != nil { log.Fatal().Msg(err.Error()) } + runtime.SetRecording(recording, provider.ID) + cliRes, err := runtime.Provider.Instance.Plugin.ParseCLI(&plugin.ParseCLIReq{ Connector: connector.Name, Args: args, diff --git a/providers-sdk/v1/testutils/testutils.go b/providers-sdk/v1/testutils/testutils.go index 4dbad40a1d..85b9c0424f 100644 --- a/providers-sdk/v1/testutils/testutils.go +++ b/providers-sdk/v1/testutils/testutils.go @@ -219,16 +219,17 @@ func mockRuntimeAbs(testdata string) llx.Runtime { if err != nil { panic("failed to load recording: " + err.Error()) } + roRecording := recording.ReadOnly() - err = runtime.SetRecording(recording, runtime.Provider.Instance.ID, true, true) + err = runtime.SetMockRecording(roRecording, runtime.Provider.Instance.ID, true) if err != nil { panic("failed to set recording: " + err.Error()) } - err = runtime.SetRecording(recording, networkconf.Config.ID, true, true) + err = runtime.SetMockRecording(roRecording, networkconf.Config.ID, true) if err != nil { panic("failed to set recording: " + err.Error()) } - err = runtime.SetRecording(recording, mockprovider.Config.ID, true, true) + err = runtime.SetMockRecording(roRecording, mockprovider.Config.ID, true) if err != nil { panic("failed to set recording: " + err.Error()) } diff --git a/providers/builtin.go b/providers/builtin.go index 8fbc4b4639..529660c886 100644 --- a/providers/builtin.go +++ b/providers/builtin.go @@ -13,6 +13,7 @@ package providers import ( _ "embed" + "go.mondoo.com/cnquery/providers-sdk/v1/resources" coreconf "go.mondoo.com/cnquery/providers/core/config" core "go.mondoo.com/cnquery/providers/core/provider" // osconf "go.mondoo.com/cnquery/providers/os/config" @@ -36,6 +37,16 @@ var builtinProviders = map[string]*builtinProvider{ }, Config: &coreconf.Config, }, + mockProvider.ID: { + Runtime: &RunningProvider{ + Name: mockProvider.Name, + ID: mockProvider.ID, + Plugin: initMockProvider(), + Schema: &resources.Schema{}, + isClosed: false, + }, + Config: mockProvider.Provider, + }, // osconf.Config.ID: { // Runtime: &RunningProvider{ // Name: osconf.Config.Name, diff --git a/providers/os.resources.json b/providers/os.resources.json deleted file mode 100644 index 2720c21228..0000000000 --- a/providers/os.resources.json +++ /dev/null @@ -1 +0,0 @@ -{"resources":{"asset":{"id":"asset","name":"asset","fields":{"eol":{"name":"eol","type":"\u001basset.eol","provider":"go.mondoo.com/cnquery/providers/os"},"vulnerabilityReport":{"name":"vulnerabilityReport","type":"\n","provider":"go.mondoo.com/cnquery/providers/os"}},"provider":"go.mondoo.com/cnquery/providers/os"},"asset.eol":{"id":"asset.eol","name":"asset.eol","fields":{"date":{"name":"date","type":"\t","is_mandatory":true,"title":"End-of-Life date","provider":"go.mondoo.com/cnquery/providers/os"},"docsUrl":{"name":"docsUrl","type":"\u0007","is_mandatory":true,"title":"Documentation URL","provider":"go.mondoo.com/cnquery/providers/os"},"productUrl":{"name":"productUrl","type":"\u0007","is_mandatory":true,"title":"Product URL","provider":"go.mondoo.com/cnquery/providers/os"}},"defaults":"date","provider":"go.mondoo.com/cnquery/providers/os"},"audit":{"id":"audit","fields":{"advisory":{"name":"advisory","type":"\u001baudit.advisory","title":"Platform/package advisory","is_private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"cve":{"name":"cve","type":"\u001baudit.cve","title":"Common Vulnerabilities and Exposures (CVE)","is_private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"cvss":{"name":"cvss","type":"\u001baudit.cvss","title":"Common Vulnerability Scoring System (CVSS) Score","is_private":true,"provider":"go.mondoo.com/cnquery/providers/os"}}},"audit.advisory":{"id":"audit.advisory","name":"audit.advisory","fields":{"description":{"name":"description","type":"\u0007","is_mandatory":true,"title":"Advisory Description","provider":"go.mondoo.com/cnquery/providers/os"},"id":{"name":"id","type":"\u0007","is_mandatory":true,"title":"Advisory ID","provider":"go.mondoo.com/cnquery/providers/os"},"modified":{"name":"modified","type":"\t","is_mandatory":true,"title":"Last modification date","provider":"go.mondoo.com/cnquery/providers/os"},"mrn":{"name":"mrn","type":"\u0007","is_mandatory":true,"title":"Mondoo Advisory Identifier","provider":"go.mondoo.com/cnquery/providers/os"},"published":{"name":"published","type":"\t","is_mandatory":true,"title":"Advisory publication date","provider":"go.mondoo.com/cnquery/providers/os"},"title":{"name":"title","type":"\u0007","is_mandatory":true,"title":"Advisory Title","provider":"go.mondoo.com/cnquery/providers/os"},"worstScore":{"name":"worstScore","type":"\u001baudit.cvss","is_mandatory":true,"title":"Worst CVSS Score of all assigned CVEs","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Platform/package advisory","private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"audit.cve":{"id":"audit.cve","name":"audit.cve","fields":{"id":{"name":"id","type":"\u0007","is_mandatory":true,"title":"CVE ID","provider":"go.mondoo.com/cnquery/providers/os"},"modified":{"name":"modified","type":"\t","is_mandatory":true,"title":"Last modification date","provider":"go.mondoo.com/cnquery/providers/os"},"mrn":{"name":"mrn","type":"\u0007","is_mandatory":true,"title":"Mondoo CVE Identifier","provider":"go.mondoo.com/cnquery/providers/os"},"published":{"name":"published","type":"\t","is_mandatory":true,"title":"publication date","provider":"go.mondoo.com/cnquery/providers/os"},"state":{"name":"state","type":"\u0007","is_mandatory":true,"title":"CVE state","provider":"go.mondoo.com/cnquery/providers/os"},"summary":{"name":"summary","type":"\u0007","is_mandatory":true,"title":"Summary Description","provider":"go.mondoo.com/cnquery/providers/os"},"unscored":{"name":"unscored","type":"\u0004","is_mandatory":true,"title":"Indicates if the CVE has a CVSS score","provider":"go.mondoo.com/cnquery/providers/os"},"worstScore":{"name":"worstScore","type":"\u001baudit.cvss","is_mandatory":true,"title":"Worst CVSS Score of all assigned CVEs","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Common Vulnerabilities and Exposures (CVE)","private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"audit.cvss":{"id":"audit.cvss","name":"audit.cvss","fields":{"score":{"name":"score","type":"\u0006","is_mandatory":true,"title":"CVSS Score ranging from 0.0 to 10.0","provider":"go.mondoo.com/cnquery/providers/os"},"vector":{"name":"vector","type":"\u0007","is_mandatory":true,"title":"CVSS score is also represented as a vector string","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Common Vulnerability Scoring System (CVSS) Score","private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"auditpol":{"id":"auditpol","name":"auditpol","fields":{"entry":{"name":"entry","type":"\u001bauditpol.entry","title":"Windows audit policy","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bauditpol.entry","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bauditpol.entry","title":"Windows audit policies","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"auditpol.entry":{"id":"auditpol.entry","name":"auditpol.entry","fields":{"exclusionsetting":{"name":"exclusionsetting","type":"\u0007","is_mandatory":true,"title":"Exclusive settings","provider":"go.mondoo.com/cnquery/providers/os"},"inclusionsetting":{"name":"inclusionsetting","type":"\u0007","is_mandatory":true,"title":"Inclusive setting","provider":"go.mondoo.com/cnquery/providers/os"},"machinename":{"name":"machinename","type":"\u0007","is_mandatory":true,"title":"Machine name","provider":"go.mondoo.com/cnquery/providers/os"},"policytarget":{"name":"policytarget","type":"\u0007","is_mandatory":true,"title":"Policy Target","provider":"go.mondoo.com/cnquery/providers/os"},"subcategory":{"name":"subcategory","type":"\u0007","is_mandatory":true,"title":"Subcategory","provider":"go.mondoo.com/cnquery/providers/os"},"subcategoryguid":{"name":"subcategoryguid","type":"\u0007","is_mandatory":true,"title":"Subcategory GUID","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Windows audit policy","min_mondoo_version":"5.15.0","defaults":"subcategory inclusionsetting exclusionsetting","provider":"go.mondoo.com/cnquery/providers/os"},"authorizedkeys":{"id":"authorizedkeys","name":"authorizedkeys","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"provider":"go.mondoo.com/cnquery/providers/os"},"entry":{"name":"entry","type":"\u001bauthorizedkeys.entry","title":"SSH authorized keys entry","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bauthorizedkeys.entry","refs":["\"file\"","\"content\""],"provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"list_type":"\u001bauthorizedkeys.entry","title":"List of SSH Authorized Keys","provider":"go.mondoo.com/cnquery/providers/os"},"authorizedkeys.entry":{"id":"authorizedkeys.entry","name":"authorizedkeys.entry","fields":{"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"key":{"name":"key","type":"\u0007","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"label":{"name":"label","type":"\u0007","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"line":{"name":"line","type":"\u0005","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"options":{"name":"options","type":"\u0019\u0007","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"type":{"name":"type","type":"\u0007","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SSH authorized keys entry","defaults":"key","provider":"go.mondoo.com/cnquery/providers/os"},"command":{"id":"command","name":"command","fields":{"command":{"name":"command","type":"\u0007","is_mandatory":true,"title":"Raw contents of the command","provider":"go.mondoo.com/cnquery/providers/os"},"exitcode":{"name":"exitcode","type":"\u0005","refs":["\"command\""],"title":"Exit code the command returned","provider":"go.mondoo.com/cnquery/providers/os"},"stderr":{"name":"stderr","type":"\u0007","refs":["\"command\""],"title":"Standard error output from running the command","provider":"go.mondoo.com/cnquery/providers/os"},"stdout":{"name":"stdout","type":"\u0007","refs":["\"command\""],"title":"Standard output from running the command","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"command","type":"\u0007"}]},"title":"Results of running a command on the system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"container":{"id":"container","fields":{"image":{"name":"image","type":"\u001bcontainer.image","title":"Container Image","provider":"go.mondoo.com/cnquery/providers/os"},"repository":{"name":"repository","type":"\u001bcontainer.repository","title":"Container registry repository","provider":"go.mondoo.com/cnquery/providers/os"}}},"container.image":{"id":"container.image","name":"container.image","fields":{"identifier":{"name":"identifier","type":"\u0007","is_mandatory":true,"title":"Identifier of type-specific portion of the image reference","provider":"go.mondoo.com/cnquery/providers/os"},"identifierType":{"name":"identifierType","type":"\u0007","is_mandatory":true,"title":"Identifier Type `tag` or `digest`","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Fully-qualified reference name","provider":"go.mondoo.com/cnquery/providers/os"},"reference":{"name":"reference","type":"\u0007","is_mandatory":true,"title":"Image reference","provider":"go.mondoo.com/cnquery/providers/os"},"repository":{"name":"repository","type":"\u001bcontainer.repository","title":"Repository used for Container Image","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Container Image","min_mondoo_version":"5.31.0","provider":"go.mondoo.com/cnquery/providers/os"},"container.repository":{"id":"container.repository","name":"container.repository","fields":{"fullName":{"name":"fullName","type":"\u0007","is_mandatory":true,"title":"Container Registry Repository URL","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Container Registry Repository Name","provider":"go.mondoo.com/cnquery/providers/os"},"registry":{"name":"registry","type":"\u0007","is_mandatory":true,"title":"Container Registry URL","provider":"go.mondoo.com/cnquery/providers/os"},"scheme":{"name":"scheme","type":"\u0007","is_mandatory":true,"title":"URL Scheme","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Container registry repository","min_mondoo_version":"5.31.0","provider":"go.mondoo.com/cnquery/providers/os"},"docker":{"id":"docker","name":"docker","fields":{"container":{"name":"container","type":"\u001bdocker.container","title":"Docker container","provider":"go.mondoo.com/cnquery/providers/os"},"containers":{"name":"containers","type":"\u0019\u001bdocker.container","title":"List all Docker containers","provider":"go.mondoo.com/cnquery/providers/os"},"image":{"name":"image","type":"\u001bdocker.image","title":"Docker image","provider":"go.mondoo.com/cnquery/providers/os"},"images":{"name":"images","type":"\u0019\u001bdocker.image","title":"List all Docker images","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Docker host resource","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"docker.container":{"id":"docker.container","name":"docker.container","fields":{"command":{"name":"command","type":"\u0007","is_mandatory":true,"title":"Container command","provider":"go.mondoo.com/cnquery/providers/os"},"id":{"name":"id","type":"\u0007","is_mandatory":true,"title":"Container ID","provider":"go.mondoo.com/cnquery/providers/os"},"image":{"name":"image","type":"\u0007","is_mandatory":true,"title":"Container image","provider":"go.mondoo.com/cnquery/providers/os"},"imageid":{"name":"imageid","type":"\u0007","is_mandatory":true,"title":"Image ID","provider":"go.mondoo.com/cnquery/providers/os"},"labels":{"name":"labels","type":"\u001a\u0007\u0007","is_mandatory":true,"title":"Label key value pairs","provider":"go.mondoo.com/cnquery/providers/os"},"names":{"name":"names","type":"\u0019\u0007","is_mandatory":true,"title":"Container names","provider":"go.mondoo.com/cnquery/providers/os"},"os":{"name":"os","type":"\u001bos.linux","min_mondoo_version":"6.19.0","is_embedded":true,"provider":"go.mondoo.com/cnquery/providers/os"},"state":{"name":"state","type":"\u0007","is_mandatory":true,"title":"Container state","provider":"go.mondoo.com/cnquery/providers/os"},"status":{"name":"status","type":"\u0007","is_mandatory":true,"title":"Status message","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Docker container","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"docker.image":{"id":"docker.image","name":"docker.image","fields":{"id":{"name":"id","type":"\u0007","is_mandatory":true,"title":"Image ID","provider":"go.mondoo.com/cnquery/providers/os"},"labels":{"name":"labels","type":"\u001a\u0007\u0007","is_mandatory":true,"title":"Labels key value pairs","provider":"go.mondoo.com/cnquery/providers/os"},"size":{"name":"size","type":"\u0005","is_mandatory":true,"title":"Image size in kilobytes","provider":"go.mondoo.com/cnquery/providers/os"},"tags":{"name":"tags","type":"\u0019\u0007","is_mandatory":true,"title":"Tag key value pairs","provider":"go.mondoo.com/cnquery/providers/os"},"virtualsize":{"name":"virtualsize","type":"\u0005","is_mandatory":true,"title":"Virtual image size in kilobytes","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Docker image","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"id":"file","name":"file","fields":{"basename":{"name":"basename","type":"\u0007","refs":["\"path\""],"title":"Filename without path prefix of this file","provider":"go.mondoo.com/cnquery/providers/os"},"content":{"name":"content","type":"\u0007","refs":["\"path\"","\"exists\""],"title":"Contents of this file","provider":"go.mondoo.com/cnquery/providers/os"},"dirname":{"name":"dirname","type":"\u0007","refs":["\"path\""],"title":"Path to the folder containing this file","provider":"go.mondoo.com/cnquery/providers/os"},"empty":{"name":"empty","type":"\u0004","refs":["\"path\""],"title":"Denotes whether the path is empty","min_mondoo_version":"5.18.0","provider":"go.mondoo.com/cnquery/providers/os"},"exists":{"name":"exists","type":"\u0004","refs":["\"path\""],"title":"Indicator if this file exists on the system","provider":"go.mondoo.com/cnquery/providers/os"},"group":{"name":"group","type":"\u001bgroup","title":"Ownership information about the group","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"title":"Location of the file on the system","provider":"go.mondoo.com/cnquery/providers/os"},"permissions":{"name":"permissions","type":"\u001bfile.permissions","refs":["\"path\""],"title":"Permissions for this file","provider":"go.mondoo.com/cnquery/providers/os"},"size":{"name":"size","type":"\u0005","refs":["\"path\""],"title":"Size of this file on disk","provider":"go.mondoo.com/cnquery/providers/os"},"user":{"name":"user","type":"\u001buser","title":"Ownership information about the user","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"File on the system","min_mondoo_version":"5.0.0","defaults":"path size permissions.string","provider":"go.mondoo.com/cnquery/providers/os"},"file.permissions":{"id":"file.permissions","name":"file.permissions","fields":{"group_executable":{"name":"group_executable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is executable by members of the group","provider":"go.mondoo.com/cnquery/providers/os"},"group_readable":{"name":"group_readable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is readable by members of the group","provider":"go.mondoo.com/cnquery/providers/os"},"group_writeable":{"name":"group_writeable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is writeable by members of the group","provider":"go.mondoo.com/cnquery/providers/os"},"isDirectory":{"name":"isDirectory","type":"\u0004","is_mandatory":true,"title":"Whether the file describes a directory","provider":"go.mondoo.com/cnquery/providers/os"},"isFile":{"name":"isFile","type":"\u0004","is_mandatory":true,"title":"Whether the file describes a regular file","provider":"go.mondoo.com/cnquery/providers/os"},"isSymlink":{"name":"isSymlink","type":"\u0004","is_mandatory":true,"title":"Whether the file is a symlink","provider":"go.mondoo.com/cnquery/providers/os"},"mode":{"name":"mode","type":"\u0005","is_mandatory":true,"title":"Raw POSIX mode for the permissions","provider":"go.mondoo.com/cnquery/providers/os"},"other_executable":{"name":"other_executable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is executable by others","provider":"go.mondoo.com/cnquery/providers/os"},"other_readable":{"name":"other_readable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is readable by others","provider":"go.mondoo.com/cnquery/providers/os"},"other_writeable":{"name":"other_writeable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is writeable by others","provider":"go.mondoo.com/cnquery/providers/os"},"sgid":{"name":"sgid","type":"\u0004","is_mandatory":true,"title":"SGID bit indicator","provider":"go.mondoo.com/cnquery/providers/os"},"sticky":{"name":"sticky","type":"\u0004","is_mandatory":true,"title":"Sticky bit indicator","provider":"go.mondoo.com/cnquery/providers/os"},"string":{"name":"string","type":"\u0007","title":"A simple printed string version of the permissions","provider":"go.mondoo.com/cnquery/providers/os"},"suid":{"name":"suid","type":"\u0004","is_mandatory":true,"title":"SUID bit indicator","provider":"go.mondoo.com/cnquery/providers/os"},"user_executable":{"name":"user_executable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is executable by its owner","provider":"go.mondoo.com/cnquery/providers/os"},"user_readable":{"name":"user_readable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is readable by its owner","provider":"go.mondoo.com/cnquery/providers/os"},"user_writeable":{"name":"user_writeable","type":"\u0004","is_mandatory":true,"title":"Indicator if this file is writeable by its owner","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Access permissions for a given file","private":true,"min_mondoo_version":"5.15.0","defaults":"string","provider":"go.mondoo.com/cnquery/providers/os"},"files":{"id":"files","name":"files","fields":{"find":{"name":"find","type":"\u001bfiles.find","title":"Find files on the system","provider":"go.mondoo.com/cnquery/providers/os"}},"provider":"go.mondoo.com/cnquery/providers/os"},"files.find":{"id":"files.find","name":"files.find","fields":{"from":{"name":"from","type":"\u0007","is_mandatory":true,"title":"From sets the starting point for the search operation","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bfile","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Search name of the name","provider":"go.mondoo.com/cnquery/providers/os"},"permissions":{"name":"permissions","type":"\u0005","is_mandatory":true,"title":"What permissions the file matches","provider":"go.mondoo.com/cnquery/providers/os"},"regex":{"name":"regex","type":"\u0007","is_mandatory":true,"title":"A regular expression for the file search","provider":"go.mondoo.com/cnquery/providers/os"},"type":{"name":"type","type":"\u0007","is_mandatory":true,"title":"What types of files will be listed (directories, files, devices, etc)","provider":"go.mondoo.com/cnquery/providers/os"},"xdev":{"name":"xdev","type":"\u0004","is_mandatory":true,"title":"xdev indicates if other devices will be searched","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bfile","title":"Find files on the system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"group":{"id":"group","name":"group","fields":{"gid":{"name":"gid","type":"\u0005","is_mandatory":true,"title":"Group ID","provider":"go.mondoo.com/cnquery/providers/os"},"members":{"name":"members","type":"\u0019\u001buser","title":"Users who are members of this group","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of this group","provider":"go.mondoo.com/cnquery/providers/os"},"sid":{"name":"sid","type":"\u0007","is_mandatory":true,"title":"Group's Security Identifier (Windows)","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"id","type":"\u0007"}]},"title":"Group on this system","min_mondoo_version":"5.15.0","defaults":"name gid","provider":"go.mondoo.com/cnquery/providers/os"},"groups":{"id":"groups","name":"groups","fields":{"list":{"name":"list","type":"\u0019\u001bgroup","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bgroup","title":"Groups configured on this system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"ip6tables":{"id":"ip6tables","name":"ip6tables","fields":{"input":{"name":"input","type":"\u0019\u001biptables.entry","title":"IPv6 input chain stats","provider":"go.mondoo.com/cnquery/providers/os"},"output":{"name":"output","type":"\u0019\u001biptables.entry","title":"IPv6 output chain stats","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"IPv6 tables","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"iptables":{"id":"iptables","name":"iptables","fields":{"entry":{"name":"entry","type":"\u001biptables.entry","provider":"go.mondoo.com/cnquery/providers/os"},"input":{"name":"input","type":"\u0019\u001biptables.entry","title":"IPv4 input chain stats","provider":"go.mondoo.com/cnquery/providers/os"},"output":{"name":"output","type":"\u0019\u001biptables.entry","title":"IPv4 output chain stats","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"IPv4 tables","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"iptables.entry":{"id":"iptables.entry","name":"iptables.entry","fields":{"bytes":{"name":"bytes","type":"\u0005","is_mandatory":true,"title":"This field tells us how large the packet is in octets, including headers and everything.","provider":"go.mondoo.com/cnquery/providers/os"},"chain":{"name":"chain","type":"\u0007","is_mandatory":true,"title":"input or output - used to create id","provider":"go.mondoo.com/cnquery/providers/os"},"destination":{"name":"destination","type":"\u0007","is_mandatory":true,"title":"The destination IP address or subnet of the traffic, or anywhere","provider":"go.mondoo.com/cnquery/providers/os"},"in":{"name":"in","type":"\u0007","is_mandatory":true,"title":"input","provider":"go.mondoo.com/cnquery/providers/os"},"lineNumber":{"name":"lineNumber","type":"\u0005","is_mandatory":true,"title":"Line number of statistic - used to create id","provider":"go.mondoo.com/cnquery/providers/os"},"opt":{"name":"opt","type":"\u0007","is_mandatory":true,"title":"indicates IP options","provider":"go.mondoo.com/cnquery/providers/os"},"options":{"name":"options","type":"\u0007","is_mandatory":true,"title":"The options field contains different optional settings within the header,","desc":"such as Internet timestamps, SACK or record route options.","provider":"go.mondoo.com/cnquery/providers/os"},"out":{"name":"out","type":"\u0007","is_mandatory":true,"title":"output","provider":"go.mondoo.com/cnquery/providers/os"},"packets":{"name":"packets","type":"\u0005","is_mandatory":true,"title":"packets from iptable","provider":"go.mondoo.com/cnquery/providers/os"},"protocol":{"name":"protocol","type":"\u0007","is_mandatory":true,"title":"protocol of the next level layer. For example, this may be TCP, UDP or ICMP among others.","provider":"go.mondoo.com/cnquery/providers/os"},"source":{"name":"source","type":"\u0007","is_mandatory":true,"title":"source address field that lets the receiver know where the packet came from.","provider":"go.mondoo.com/cnquery/providers/os"},"target":{"name":"target","type":"\u0007","is_mandatory":true,"title":"If a packet matches the rule, the target specifies what should be done with it.","provider":"go.mondoo.com/cnquery/providers/os"}},"min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"kernel":{"id":"kernel","name":"kernel","fields":{"info":{"name":"info","type":"\n","title":"Active kernel information","provider":"go.mondoo.com/cnquery/providers/os"},"installed":{"name":"installed","type":"\u0019\n","title":"Installed Versions","provider":"go.mondoo.com/cnquery/providers/os"},"module":{"name":"module","type":"\u001bkernel.module","title":"System kernel module information","provider":"go.mondoo.com/cnquery/providers/os"},"modules":{"name":"modules","type":"\u0019\u001bkernel.module","title":"List of kernel modules","provider":"go.mondoo.com/cnquery/providers/os"},"parameters":{"name":"parameters","type":"\u001a\u0007\u0007","title":"Kernel parameters map","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"System kernel information","min_mondoo_version":"5.15.0","defaults":"info","provider":"go.mondoo.com/cnquery/providers/os"},"kernel.module":{"id":"kernel.module","name":"kernel.module","fields":{"loaded":{"name":"loaded","type":"\u0004","is_mandatory":true,"title":"Indicates if this module is loaded","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of the kernel module","provider":"go.mondoo.com/cnquery/providers/os"},"size":{"name":"size","type":"\u0007","is_mandatory":true,"title":"Size of the kernel module","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"name","type":"\u0007"}]},"title":"System kernel module information","min_mondoo_version":"5.15.0","defaults":"name loaded","provider":"go.mondoo.com/cnquery/providers/os"},"logindefs":{"id":"logindefs","name":"logindefs","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Content of the configuration file","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","title":"Current configuration file for resource","provider":"go.mondoo.com/cnquery/providers/os"},"params":{"name":"params","type":"\u001a\u0007\u0007","refs":["\"content\""],"title":"Parsed logindef parameter","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"Shadow password suite configuration","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"lsblk":{"id":"lsblk","name":"lsblk","fields":{"entry":{"name":"entry","type":"\u001blsblk.entry","title":"Unix block device","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001blsblk.entry","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001blsblk.entry","title":"Unix list block devices","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"lsblk.entry":{"id":"lsblk.entry","name":"lsblk.entry","fields":{"fstype":{"name":"fstype","type":"\u0007","is_mandatory":true,"title":"Filesystem Type","provider":"go.mondoo.com/cnquery/providers/os"},"label":{"name":"label","type":"\u0007","is_mandatory":true,"title":"label for the fs","provider":"go.mondoo.com/cnquery/providers/os"},"mountpoints":{"name":"mountpoints","type":"\u0019\u0007","is_mandatory":true,"title":"mountpoints for the device","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Device name","provider":"go.mondoo.com/cnquery/providers/os"},"uuid":{"name":"uuid","type":"\u0007","is_mandatory":true,"title":"uuid for the fs","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Unix block device","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"machine":{"id":"machine","name":"machine","fields":{"baseboard":{"name":"baseboard","type":"\u001bmachine.baseboard","title":"SMBIOS baseboard (or module) information","provider":"go.mondoo.com/cnquery/providers/os"},"bios":{"name":"bios","type":"\u001bmachine.bios","title":"SMBIOS BIOS information","provider":"go.mondoo.com/cnquery/providers/os"},"chassis":{"name":"chassis","type":"\u001bmachine.chassis","title":"SMBIOS system enclosure or chassis","provider":"go.mondoo.com/cnquery/providers/os"},"system":{"name":"system","type":"\u001bmachine.system","title":"SMBIOS system information","provider":"go.mondoo.com/cnquery/providers/os"}},"min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"machine.baseboard":{"id":"machine.baseboard","name":"machine.baseboard","fields":{"assetTag":{"name":"assetTag","type":"\u0007","is_mandatory":true,"title":"Asset Tag","provider":"go.mondoo.com/cnquery/providers/os"},"manufacturer":{"name":"manufacturer","type":"\u0007","is_mandatory":true,"title":"Manufacturer","provider":"go.mondoo.com/cnquery/providers/os"},"product":{"name":"product","type":"\u0007","is_mandatory":true,"title":"Product","provider":"go.mondoo.com/cnquery/providers/os"},"serial":{"name":"serial","type":"\u0007","is_mandatory":true,"title":"Serial Number","provider":"go.mondoo.com/cnquery/providers/os"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Version","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SMBIOS baseboard (or module) information","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"machine.bios":{"id":"machine.bios","name":"machine.bios","fields":{"releaseDate":{"name":"releaseDate","type":"\u0007","is_mandatory":true,"title":"BIOS release date","provider":"go.mondoo.com/cnquery/providers/os"},"vendor":{"name":"vendor","type":"\u0007","is_mandatory":true,"title":"BIOS vendor","provider":"go.mondoo.com/cnquery/providers/os"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"BIOS version","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SMBIOS BIOS information","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"machine.chassis":{"id":"machine.chassis","name":"machine.chassis","fields":{"assetTag":{"name":"assetTag","type":"\u0007","is_mandatory":true,"title":"Asset Tag Number","provider":"go.mondoo.com/cnquery/providers/os"},"manufacturer":{"name":"manufacturer","type":"\u0007","is_mandatory":true,"title":"Manufacturer","provider":"go.mondoo.com/cnquery/providers/os"},"serial":{"name":"serial","type":"\u0007","is_mandatory":true,"title":"Serial Number","provider":"go.mondoo.com/cnquery/providers/os"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Version","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SMBIOS system enclosure or chassis","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"machine.system":{"id":"machine.system","name":"machine.system","fields":{"family":{"name":"family","type":"\u0007","is_mandatory":true,"title":"Family","provider":"go.mondoo.com/cnquery/providers/os"},"manufacturer":{"name":"manufacturer","type":"\u0007","is_mandatory":true,"title":"Manufacturer","provider":"go.mondoo.com/cnquery/providers/os"},"product":{"name":"product","type":"\u0007","is_mandatory":true,"title":"Product Name","provider":"go.mondoo.com/cnquery/providers/os"},"serial":{"name":"serial","type":"\u0007","is_mandatory":true,"title":"Serial Number","provider":"go.mondoo.com/cnquery/providers/os"},"sku":{"name":"sku","type":"\u0007","is_mandatory":true,"title":"SKU Number","provider":"go.mondoo.com/cnquery/providers/os"},"uuid":{"name":"uuid","type":"\u0007","is_mandatory":true,"title":"UUID","provider":"go.mondoo.com/cnquery/providers/os"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Version","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SMBIOS system information","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"mondoo":{"id":"mondoo","fields":{"eol":{"name":"eol","type":"\u001bmondoo.eol","title":"Returns platform EOL date information.","is_private":true,"provider":"go.mondoo.com/cnquery/providers/os"}}},"mondoo.eol":{"id":"mondoo.eol","name":"mondoo.eol","fields":{"date":{"name":"date","type":"\t","title":"End-of-Life date for the product","provider":"go.mondoo.com/cnquery/providers/os"},"product":{"name":"product","type":"\u0007","is_mandatory":true,"title":"Product Name","provider":"go.mondoo.com/cnquery/providers/os"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Product Version","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Returns platform EOL date information.","private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"mount":{"id":"mount","name":"mount","fields":{"list":{"name":"list","type":"\u0019\u001bmount.point","provider":"go.mondoo.com/cnquery/providers/os"},"point":{"name":"point","type":"\u001bmount.point","title":"Unix mount point","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bmount.point","title":"Unix Mounted Filesystem","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"mount.point":{"id":"mount.point","name":"mount.point","fields":{"device":{"name":"device","type":"\u0007","is_mandatory":true,"title":"Device","provider":"go.mondoo.com/cnquery/providers/os"},"fstype":{"name":"fstype","type":"\u0007","is_mandatory":true,"title":"Filesystem Type","provider":"go.mondoo.com/cnquery/providers/os"},"mounted":{"name":"mounted","type":"\u0004","is_mandatory":true,"title":"Flag whether the mount point is mounted","provider":"go.mondoo.com/cnquery/providers/os"},"options":{"name":"options","type":"\u001a\u0007\u0007","is_mandatory":true,"title":"Mount Options","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"title":"Path","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"Unix mount point","min_mondoo_version":"5.15.0","defaults":"device path fstype","provider":"go.mondoo.com/cnquery/providers/os"},"ntp":{"id":"ntp","fields":{"conf":{"name":"conf","type":"\u001bntp.conf","title":"NTP service configuration","provider":"go.mondoo.com/cnquery/providers/os"}}},"ntp.conf":{"id":"ntp.conf","name":"ntp.conf","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Raw contents of this NTP service configuration","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","title":"File of this NTP service configuration","provider":"go.mondoo.com/cnquery/providers/os"},"fudge":{"name":"fudge","type":"\u0019\u0007","refs":["\"settings\""],"title":"Additional information for clock drivers","provider":"go.mondoo.com/cnquery/providers/os"},"restrict":{"name":"restrict","type":"\u0019\u0007","refs":["\"settings\""],"title":"List of access control restrictions for this NTP service","provider":"go.mondoo.com/cnquery/providers/os"},"servers":{"name":"servers","type":"\u0019\u0007","refs":["\"settings\""],"title":"List of servers for this NTP service","provider":"go.mondoo.com/cnquery/providers/os"},"settings":{"name":"settings","type":"\u0019\u0007","refs":["\"content\""],"title":"List of settings for this NTP service","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"NTP service configuration","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"os":{"id":"os","name":"os","fields":{"base":{"name":"base","type":"\u001bos.base","provider":"go.mondoo.com/cnquery/providers/os"},"env":{"name":"env","type":"\u001a\u0007\u0007","title":"ENV variable contents","provider":"go.mondoo.com/cnquery/providers/os"},"hostname":{"name":"hostname","type":"\u0007","title":"Hostname for this OS","provider":"go.mondoo.com/cnquery/providers/os"},"linux":{"name":"linux","type":"\u001bos.linux","provider":"go.mondoo.com/cnquery/providers/os"},"machineid":{"name":"machineid","type":"\u0007","title":"Machine ID for this OS","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","title":"Pretty hostname on macOS/Linux or device name on Windows","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0019\u0007","refs":["\"env\""],"title":"PATH variable contents","provider":"go.mondoo.com/cnquery/providers/os"},"rebootpending":{"name":"rebootpending","type":"\u0004","title":"Indicates if a reboot is pending","provider":"go.mondoo.com/cnquery/providers/os"},"rootCertificates":{"name":"rootCertificates","type":"\u001bos.rootCertificates","title":"Operating system root certificates","provider":"go.mondoo.com/cnquery/providers/os"},"unix":{"name":"unix","type":"\u001bos.unix","provider":"go.mondoo.com/cnquery/providers/os"},"update":{"name":"update","type":"\u001bos.update","title":"Operating system update information","provider":"go.mondoo.com/cnquery/providers/os"},"updates":{"name":"updates","type":"\u0019\u001bos.update","title":"List of available OS updates","provider":"go.mondoo.com/cnquery/providers/os"},"uptime":{"name":"uptime","type":"\t","title":"Current uptime","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Operating system information","min_mondoo_version":"6.19.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.base":{"id":"os.base","name":"os.base","fields":{"command":{"name":"command","type":"\u001bos.base.command","title":"Results of running a command on the system","provider":"go.mondoo.com/cnquery/providers/os"},"env":{"name":"env","type":"\u001a\u0007\u0007","title":"ENV variable contents","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bos.base.file","title":"File on the system","provider":"go.mondoo.com/cnquery/providers/os"},"group":{"name":"group","type":"\u001bos.base.group","title":"Group on this system","provider":"go.mondoo.com/cnquery/providers/os"},"groups":{"name":"groups","type":"\u001bgroups","title":"User groups","provider":"go.mondoo.com/cnquery/providers/os"},"hostname":{"name":"hostname","type":"\u0007","title":"Hostname for this OS","provider":"go.mondoo.com/cnquery/providers/os"},"machine":{"name":"machine","type":"\u001bmachine","is_embedded":true,"provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","title":"Pretty Hostname on macOS/Linux or device name on Windows","provider":"go.mondoo.com/cnquery/providers/os"},"packages":{"name":"packages","type":"\u001bos.base.packages","title":"List of packages on this system","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0019\u0007","refs":["\"env\""],"title":"PATH variable contents","provider":"go.mondoo.com/cnquery/providers/os"},"rebootpending":{"name":"rebootpending","type":"\u0004","title":"Indicates if a reboot is pending","provider":"go.mondoo.com/cnquery/providers/os"},"service":{"name":"service","type":"\u001bos.base.service","title":"Service on this system","provider":"go.mondoo.com/cnquery/providers/os"},"services":{"name":"services","type":"\u001bos.base.services","title":"Services configured on this system","provider":"go.mondoo.com/cnquery/providers/os"},"updates":{"name":"updates","type":"\u0019\u001bos.update","title":"List of available OS updates","provider":"go.mondoo.com/cnquery/providers/os"},"uptime":{"name":"uptime","type":"\t","title":"Current uptime","provider":"go.mondoo.com/cnquery/providers/os"},"user":{"name":"user","type":"\u001bos.base.user","title":"User on this system","provider":"go.mondoo.com/cnquery/providers/os"},"users":{"name":"users","type":"\u001busers","title":"Users","provider":"go.mondoo.com/cnquery/providers/os"}},"min_mondoo_version":"6.19.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.command":{"id":"command","name":"command","fields":{"command":{"name":"command","type":"\u0007","is_mandatory":true,"title":"Raw contents of the command","provider":"go.mondoo.com/cnquery/providers/os"},"exitcode":{"name":"exitcode","type":"\u0005","refs":["\"command\""],"title":"Exit code the command returned","provider":"go.mondoo.com/cnquery/providers/os"},"stderr":{"name":"stderr","type":"\u0007","refs":["\"command\""],"title":"Standard error output from running the command","provider":"go.mondoo.com/cnquery/providers/os"},"stdout":{"name":"stdout","type":"\u0007","refs":["\"command\""],"title":"Standard output from running the command","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"command","type":"\u0007"}]},"title":"Results of running a command on the system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.file":{"id":"file","name":"file","fields":{"basename":{"name":"basename","type":"\u0007","refs":["\"path\""],"title":"Filename without path prefix of this file","provider":"go.mondoo.com/cnquery/providers/os"},"content":{"name":"content","type":"\u0007","refs":["\"path\"","\"exists\""],"title":"Contents of this file","provider":"go.mondoo.com/cnquery/providers/os"},"dirname":{"name":"dirname","type":"\u0007","refs":["\"path\""],"title":"Path to the folder containing this file","provider":"go.mondoo.com/cnquery/providers/os"},"empty":{"name":"empty","type":"\u0004","refs":["\"path\""],"title":"Denotes whether the path is empty","min_mondoo_version":"5.18.0","provider":"go.mondoo.com/cnquery/providers/os"},"exists":{"name":"exists","type":"\u0004","refs":["\"path\""],"title":"Indicator if this file exists on the system","provider":"go.mondoo.com/cnquery/providers/os"},"group":{"name":"group","type":"\u001bgroup","title":"Ownership information about the group","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"title":"Location of the file on the system","provider":"go.mondoo.com/cnquery/providers/os"},"permissions":{"name":"permissions","type":"\u001bfile.permissions","refs":["\"path\""],"title":"Permissions for this file","provider":"go.mondoo.com/cnquery/providers/os"},"size":{"name":"size","type":"\u0005","refs":["\"path\""],"title":"Size of this file on disk","provider":"go.mondoo.com/cnquery/providers/os"},"user":{"name":"user","type":"\u001buser","title":"Ownership information about the user","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"File on the system","min_mondoo_version":"5.0.0","defaults":"path size permissions.string","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.group":{"id":"group","name":"group","fields":{"gid":{"name":"gid","type":"\u0005","is_mandatory":true,"title":"Group ID","provider":"go.mondoo.com/cnquery/providers/os"},"members":{"name":"members","type":"\u0019\u001buser","title":"Users who are members of this group","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of this group","provider":"go.mondoo.com/cnquery/providers/os"},"sid":{"name":"sid","type":"\u0007","is_mandatory":true,"title":"Group's Security Identifier (Windows)","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"id","type":"\u0007"}]},"title":"Group on this system","min_mondoo_version":"5.15.0","defaults":"name gid","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.packages":{"id":"packages","name":"packages","fields":{"list":{"name":"list","type":"\u0019\u001bpackage","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bpackage","title":"List of packages on this system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.service":{"id":"service","name":"service","fields":{"description":{"name":"description","type":"\u0007","is_mandatory":true,"title":"Service description","provider":"go.mondoo.com/cnquery/providers/os"},"enabled":{"name":"enabled","type":"\u0004","is_mandatory":true,"title":"Is it enabled? (start at boot)","provider":"go.mondoo.com/cnquery/providers/os"},"installed":{"name":"installed","type":"\u0004","is_mandatory":true,"title":"Is it installed?","provider":"go.mondoo.com/cnquery/providers/os"},"masked":{"name":"masked","type":"\u0004","is_mandatory":true,"title":"Is it masked?","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of this service","provider":"go.mondoo.com/cnquery/providers/os"},"running":{"name":"running","type":"\u0004","is_mandatory":true,"title":"Is it running?","provider":"go.mondoo.com/cnquery/providers/os"},"type":{"name":"type","type":"\u0007","is_mandatory":true,"title":"Type information","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"name","type":"\u0007"}]},"title":"Service on this system","min_mondoo_version":"5.15.0","defaults":"name running enabled type","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.services":{"id":"services","name":"services","fields":{"list":{"name":"list","type":"\u0019\u001bservice","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bservice","title":"Services configured on this system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.base.user":{"id":"user","name":"user","fields":{"authorizedkeys":{"name":"authorizedkeys","type":"\u001bauthorizedkeys","refs":["\"home\""],"title":"List of authorized keys","provider":"go.mondoo.com/cnquery/providers/os"},"enabled":{"name":"enabled","type":"\u0004","is_mandatory":true,"title":"Indicates if the user is enabled","provider":"go.mondoo.com/cnquery/providers/os"},"gid":{"name":"gid","type":"\u0005","is_mandatory":true,"title":"User's Group ID","provider":"go.mondoo.com/cnquery/providers/os"},"group":{"name":"group","type":"\u001bgroup","refs":["\"gid\""],"title":"Group that user is a member of","provider":"go.mondoo.com/cnquery/providers/os"},"home":{"name":"home","type":"\u0007","is_mandatory":true,"title":"Home folder","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of the user","provider":"go.mondoo.com/cnquery/providers/os"},"shell":{"name":"shell","type":"\u0007","is_mandatory":true,"title":"Default shell configured","provider":"go.mondoo.com/cnquery/providers/os"},"sid":{"name":"sid","type":"\u0007","is_mandatory":true,"title":"User's Security Identifier (Windows)","provider":"go.mondoo.com/cnquery/providers/os"},"sshkeys":{"name":"sshkeys","type":"\u0019\u001bprivatekey","title":"List of SSH keys","provider":"go.mondoo.com/cnquery/providers/os"},"uid":{"name":"uid","type":"\u0005","is_mandatory":true,"title":"User ID","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"User on this system","defaults":"name uid gid","provider":"go.mondoo.com/cnquery/providers/os"},"os.linux":{"id":"os.linux","name":"os.linux","fields":{"ip6tables":{"name":"ip6tables","type":"\u001bip6tables","title":"iptables firewall for IPv6","provider":"go.mondoo.com/cnquery/providers/os"},"iptables":{"name":"iptables","type":"\u001biptables","title":"iptables firewall for IPv4","provider":"go.mondoo.com/cnquery/providers/os"},"unix":{"name":"unix","type":"\u001bos.unix","is_embedded":true,"provider":"go.mondoo.com/cnquery/providers/os"}},"min_mondoo_version":"6.19.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.rootCertificates":{"id":"os.rootCertificates","name":"os.rootCertificates","fields":{"content":{"name":"content","type":"\u0019\u0007","refs":["\"files\""],"provider":"go.mondoo.com/cnquery/providers/os"},"files":{"name":"files","type":"\u0019\u001bfile","is_mandatory":true,"title":"List of files that define these certificates","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bcertificate","refs":["\"content\""],"provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bcertificate","title":"Operating system root certificates","min_mondoo_version":"6.19.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.unix":{"id":"os.unix","name":"os.unix","fields":{"base":{"name":"base","type":"\u001bos.base","is_embedded":true,"provider":"go.mondoo.com/cnquery/providers/os"},"sshd":{"name":"sshd","type":"\u001bos.unix.sshd","title":"SSH server resource","provider":"go.mondoo.com/cnquery/providers/os"}},"min_mondoo_version":"6.19.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.unix.sshd":{"id":"sshd","name":"sshd","fields":{"config":{"name":"config","type":"\u001bsshd.config","title":"SSH server configuration","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SSH server resource","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"os.update":{"id":"os.update","name":"os.update","fields":{"category":{"name":"category","type":"\u0007","is_mandatory":true,"title":"Category of the update","provider":"go.mondoo.com/cnquery/providers/os"},"format":{"name":"format","type":"\u0007","is_mandatory":true,"title":"Package format for this update","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of the update","provider":"go.mondoo.com/cnquery/providers/os"},"restart":{"name":"restart","type":"\u0004","is_mandatory":true,"title":"Indicates if a restart is required","provider":"go.mondoo.com/cnquery/providers/os"},"severity":{"name":"severity","type":"\u0007","is_mandatory":true,"title":"Severity of the update","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Operating system update information","min_mondoo_version":"6.19.0","defaults":"name","provider":"go.mondoo.com/cnquery/providers/os"},"package":{"id":"package","name":"package","fields":{"arch":{"name":"arch","type":"\u0007","is_mandatory":true,"title":"Architecture of this package","provider":"go.mondoo.com/cnquery/providers/os"},"available":{"name":"available","type":"\u0007","is_mandatory":true,"title":"Available version","provider":"go.mondoo.com/cnquery/providers/os"},"description":{"name":"description","type":"\u0007","is_mandatory":true,"title":"Package description","provider":"go.mondoo.com/cnquery/providers/os"},"epoch":{"name":"epoch","type":"\u0007","is_mandatory":true,"title":"Epoch of this package","provider":"go.mondoo.com/cnquery/providers/os"},"format":{"name":"format","type":"\u0007","is_mandatory":true,"title":"Format of this package (e.g. rpm, deb)","provider":"go.mondoo.com/cnquery/providers/os"},"installed":{"name":"installed","type":"\u0004","is_mandatory":true,"title":"Indicates if this package is installed","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of the package","provider":"go.mondoo.com/cnquery/providers/os"},"origin":{"name":"origin","type":"\u0007","title":"Package origin (optional)","provider":"go.mondoo.com/cnquery/providers/os"},"outdated":{"name":"outdated","type":"\u0004","title":"Indicates if this package is outdated","provider":"go.mondoo.com/cnquery/providers/os"},"status":{"name":"status","type":"\u0007","title":"Status of this package (e.g. if it is needed)","provider":"go.mondoo.com/cnquery/providers/os"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Current version of the package","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"name","type":"\u0007"}]},"title":"Package on the platform or OS","min_mondoo_version":"5.15.0","defaults":"name version","provider":"go.mondoo.com/cnquery/providers/os"},"packages":{"id":"packages","name":"packages","fields":{"list":{"name":"list","type":"\u0019\u001bpackage","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bpackage","title":"List of packages on this system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"pam":{"id":"pam","fields":{"conf":{"name":"conf","type":"\u001bpam.conf","title":"PAM configuration (Pluggable Authentication Module)","provider":"go.mondoo.com/cnquery/providers/os"}}},"pam.conf":{"id":"pam.conf","name":"pam.conf","fields":{"content":{"name":"content","type":"\u0007","refs":["\"files\""],"title":"The raw PAM configuration (across all files)","provider":"go.mondoo.com/cnquery/providers/os"},"entries":{"name":"entries","type":"\u001a\u0007\u0019\u001bpam.conf.serviceEntry","refs":["\"files\""],"title":"List of services with parsed entries that are configured via PAM","provider":"go.mondoo.com/cnquery/providers/os"},"files":{"name":"files","type":"\u0019\u001bfile","title":"List of files that make up the PAM configuration","provider":"go.mondoo.com/cnquery/providers/os"},"serviceEntry":{"name":"serviceEntry","type":"\u001bpam.conf.serviceEntry","is_private":true,"provider":"go.mondoo.com/cnquery/providers/os"},"services":{"name":"services","type":"\u001a\u0007\u0019\u0007","refs":["\"files\""],"title":"Deprecated: A list of services that are configured via PAM","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"PAM configuration (Pluggable Authentication Module)","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"pam.conf.serviceEntry":{"id":"pam.conf.serviceEntry","name":"pam.conf.serviceEntry","fields":{"control":{"name":"control","type":"\u0007","is_mandatory":true,"title":"Level of control, ie required, requisite, sufficient","provider":"go.mondoo.com/cnquery/providers/os"},"lineNumber":{"name":"lineNumber","type":"\u0005","is_mandatory":true,"title":"Line number in service file - used for ID","provider":"go.mondoo.com/cnquery/providers/os"},"module":{"name":"module","type":"\u0007","is_mandatory":true,"title":"PAM module used","provider":"go.mondoo.com/cnquery/providers/os"},"options":{"name":"options","type":"\u0019\u0007","is_mandatory":true,"title":"Configuration options for pam service entry","provider":"go.mondoo.com/cnquery/providers/os"},"pamType":{"name":"pamType","type":"\u0007","is_mandatory":true,"title":"Type for pam entry, ie auth, password etc","provider":"go.mondoo.com/cnquery/providers/os"},"service":{"name":"service","type":"\u0007","is_mandatory":true,"title":"Service file that entry is from","provider":"go.mondoo.com/cnquery/providers/os"}},"private":true,"min_mondoo_version":"5.15.0","defaults":"service module","provider":"go.mondoo.com/cnquery/providers/os"},"parse":{"id":"parse","fields":{"certificates":{"name":"certificates","type":"\u001bparse.certificates","title":"Parse Certificates from files","provider":"go.mondoo.com/cnquery/providers/os"},"ini":{"name":"ini","type":"\u001bparse.ini","title":"Parse INI files","provider":"go.mondoo.com/cnquery/providers/os"},"json":{"name":"json","type":"\u001bparse.json","title":"Parse JSON files","provider":"go.mondoo.com/cnquery/providers/os"},"openpgp":{"name":"openpgp","type":"\u001bparse.openpgp","title":"Parse OpenPGP from files","provider":"go.mondoo.com/cnquery/providers/os"},"plist":{"name":"plist","type":"\u001bparse.plist","title":"Parse plist files","provider":"go.mondoo.com/cnquery/providers/os"},"yaml":{"name":"yaml","type":"\u001bparse.yaml","title":"Parse YAML files","provider":"go.mondoo.com/cnquery/providers/os"}}},"parse.certificates":{"id":"parse.certificates","name":"parse.certificates","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Certificate file content","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","title":"Certificate file","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bcertificate","refs":["\"content\"","\"path\""],"provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"title":"Certificate file path","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"list_type":"\u001bcertificate","title":"Parse Certificates from files","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"parse.ini":{"id":"parse.ini","name":"parse.ini","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Raw content of the file that is parsed","provider":"go.mondoo.com/cnquery/providers/os"},"delimiter":{"name":"delimiter","type":"\u0007","is_mandatory":true,"title":"Symbol that is separating keys and values","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"File that is being parsed","provider":"go.mondoo.com/cnquery/providers/os"},"params":{"name":"params","type":"\u001a\u0007\u0007","refs":["\"sections\""],"title":"A map of parameters that don't belong to sections","provider":"go.mondoo.com/cnquery/providers/os"},"sections":{"name":"sections","type":"\u001a\u0007\u001a\u0007\u0007","refs":["\"content\"","\"delimiter\""],"title":"A map of sections and key-value pairs","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"},{"name":"delimiter","type":"\u0007"}]},"title":"Parse INI files","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"parse.json":{"id":"parse.json","name":"parse.json","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Raw content of the file that is parsed","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"File that is being parsed","provider":"go.mondoo.com/cnquery/providers/os"},"params":{"name":"params","type":"\n","refs":["\"content\""],"title":"The parsed parameters that are defined in this file","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"Parse JSON files","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"parse.openpgp":{"id":"parse.openpgp","name":"parse.openpgp","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"OpenPGP file content","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"OpenPGP file","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bopenpgp.entity","refs":["\"content\""],"provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"title":"Path of the OpenPGP file. Deprecated: Please use file.path instead","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"list_type":"\u001bopenpgp.entity","title":"Parse OpenPGP from files","provider":"go.mondoo.com/cnquery/providers/os"},"parse.plist":{"id":"parse.plist","name":"parse.plist","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Raw content of the file that is parsed","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"File that is being parsed","provider":"go.mondoo.com/cnquery/providers/os"},"params":{"name":"params","type":"\n","refs":["\"content\""],"title":"The parsed parameters that are defined in this file","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"Parse plist files","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"parse.yaml":{"id":"parse.yaml","name":"parse.yaml","fields":{"content":{"name":"content","type":"\u0007","refs":["\"file\""],"title":"Raw content of the file that is parsed","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"File that is being parsed","provider":"go.mondoo.com/cnquery/providers/os"},"params":{"name":"params","type":"\n","refs":["\"content\""],"title":"The parsed parameters that are defined in this file","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"Parse YAML files","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"platform":{"id":"platform","fields":{"advisories":{"name":"advisories","type":"\u001bplatform.advisories","title":"Returns all platform/package advisories","provider":"go.mondoo.com/cnquery/providers/os"},"cves":{"name":"cves","type":"\u001bplatform.cves","title":"Returns all platform/package cves","provider":"go.mondoo.com/cnquery/providers/os"},"eol":{"name":"eol","type":"\u001bplatform.eol","title":"Information about the platform end-of-life. Deprecated, will be removed in v10.","desc":"Please use asset.eol instead.","provider":"go.mondoo.com/cnquery/providers/os"}}},"platform.advisories":{"id":"platform.advisories","name":"platform.advisories","fields":{"cvss":{"name":"cvss","type":"\u001baudit.cvss","title":"Worst CVSS score for all advisories","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001baudit.advisory","provider":"go.mondoo.com/cnquery/providers/os"},"stats":{"name":"stats","type":"\n","title":"Statistical information: total, critical, high, medium, low, none, unknown","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001baudit.advisory","title":"Returns all platform/package advisories","provider":"go.mondoo.com/cnquery/providers/os"},"platform.cves":{"id":"platform.cves","name":"platform.cves","fields":{"cvss":{"name":"cvss","type":"\u001baudit.cvss","title":"Worst CVSS score for all cves","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001baudit.cve","provider":"go.mondoo.com/cnquery/providers/os"},"stats":{"name":"stats","type":"\n","title":"Statistical information: total, critical, high, medium, low, none, unknown","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001baudit.cve","title":"Returns all platform/package cves","provider":"go.mondoo.com/cnquery/providers/os"},"platform.eol":{"id":"platform.eol","name":"platform.eol","fields":{"date":{"name":"date","type":"\t","is_mandatory":true,"title":"End-of-Life date","provider":"go.mondoo.com/cnquery/providers/os"},"docsUrl":{"name":"docsUrl","type":"\u0007","is_mandatory":true,"title":"Documentation URL","provider":"go.mondoo.com/cnquery/providers/os"},"productUrl":{"name":"productUrl","type":"\u0007","is_mandatory":true,"title":"Product URL","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Information about the platform end-of-life. Deprecated, will be removed in v10.","desc":"Please use asset.eol instead.","defaults":"date","provider":"go.mondoo.com/cnquery/providers/os"},"port":{"id":"port","name":"port","fields":{"address":{"name":"address","type":"\u0007","is_mandatory":true,"title":"Local address of this port","provider":"go.mondoo.com/cnquery/providers/os"},"port":{"name":"port","type":"\u0005","is_mandatory":true,"title":"Port number","provider":"go.mondoo.com/cnquery/providers/os"},"process":{"name":"process","type":"\u001bprocess","is_mandatory":true,"title":"Process that is connected to this port","provider":"go.mondoo.com/cnquery/providers/os"},"protocol":{"name":"protocol","type":"\u0007","is_mandatory":true,"title":"Protocol of this port","provider":"go.mondoo.com/cnquery/providers/os"},"remoteAddress":{"name":"remoteAddress","type":"\u0007","is_mandatory":true,"title":"Remote address connected to this port","provider":"go.mondoo.com/cnquery/providers/os"},"remotePort":{"name":"remotePort","type":"\u0005","is_mandatory":true,"title":"Remote port connected to this port","provider":"go.mondoo.com/cnquery/providers/os"},"state":{"name":"state","type":"\u0007","is_mandatory":true,"title":"State of this open port","provider":"go.mondoo.com/cnquery/providers/os"},"tls":{"name":"tls","type":"\u001btls","refs":["\"address\"","\"port\"","\"protocol\""],"title":"TLS on this port, if it is available","provider":"go.mondoo.com/cnquery/providers/os"},"user":{"name":"user","type":"\u001buser","is_mandatory":true,"title":"User configured for this port","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"TCP/IP port on the system","defaults":"port protocol address process.executable","provider":"go.mondoo.com/cnquery/providers/os"},"ports":{"id":"ports","name":"ports","fields":{"list":{"name":"list","type":"\u0019\u001bport","provider":"go.mondoo.com/cnquery/providers/os"},"listening":{"name":"listening","type":"\u0019\u001bport","title":"All listening ports","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bport","title":"TCP/IP ports on the system","provider":"go.mondoo.com/cnquery/providers/os"},"powershell":{"id":"powershell","name":"powershell","fields":{"exitcode":{"name":"exitcode","type":"\u0005","title":"Exit code the script returned","provider":"go.mondoo.com/cnquery/providers/os"},"script":{"name":"script","type":"\u0007","is_mandatory":true,"title":"Raw contents of the script","provider":"go.mondoo.com/cnquery/providers/os"},"stderr":{"name":"stderr","type":"\u0007","title":"Standard error output from running the script","provider":"go.mondoo.com/cnquery/providers/os"},"stdout":{"name":"stdout","type":"\u0007","title":"Standard output from running the script","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"script","type":"\u0007"}]},"title":"Results of running a PowerShell script on the system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"privatekey":{"id":"privatekey","name":"privatekey","fields":{"encrypted":{"name":"encrypted","type":"\u0004","is_mandatory":true,"provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"File on disk for this private key","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","is_mandatory":true,"title":"Key path on disk (deprecated, use file instead)","provider":"go.mondoo.com/cnquery/providers/os"},"pem":{"name":"pem","type":"\u0007","is_mandatory":true,"title":"PEM data","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Private Key Resource","provider":"go.mondoo.com/cnquery/providers/os"},"process":{"id":"process","name":"process","fields":{"command":{"name":"command","type":"\u0007","title":"Full command used to run this process","provider":"go.mondoo.com/cnquery/providers/os"},"executable":{"name":"executable","type":"\u0007","title":"Executable that is running this process","provider":"go.mondoo.com/cnquery/providers/os"},"flags":{"name":"flags","type":"\u001a\u0007\u0007","title":"Map of additional flags","provider":"go.mondoo.com/cnquery/providers/os"},"pid":{"name":"pid","type":"\u0005","is_mandatory":true,"title":"PID (process ID)","provider":"go.mondoo.com/cnquery/providers/os"},"state":{"name":"state","type":"\u0007","title":"State of the process (sleeping, running, etc)","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"pid","type":"\u0005"}]},"title":"Process on this system","min_mondoo_version":"5.15.0","defaults":"executable pid state","provider":"go.mondoo.com/cnquery/providers/os"},"processes":{"id":"processes","name":"processes","fields":{"list":{"name":"list","type":"\u0019\u001bprocess","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bprocess","title":"Processes available on this system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"rsyslog":{"id":"rsyslog","fields":{"conf":{"name":"conf","type":"\u001brsyslog.conf","title":"Rsyslog service configuration","provider":"go.mondoo.com/cnquery/providers/os"}}},"rsyslog.conf":{"id":"rsyslog.conf","name":"rsyslog.conf","fields":{"content":{"name":"content","type":"\u0007","refs":["\"files\""],"title":"Raw contents of this Rsyslog service configuration","provider":"go.mondoo.com/cnquery/providers/os"},"files":{"name":"files","type":"\u0019\u001bfile","refs":["\"path\""],"title":"Files that make up this Rsyslog service configuration","provider":"go.mondoo.com/cnquery/providers/os"},"path":{"name":"path","type":"\u0007","title":"Path for the main rsyslog file and search","provider":"go.mondoo.com/cnquery/providers/os"},"settings":{"name":"settings","type":"\u0019\u0007","refs":["\"content\""],"title":"List of settings for this Rsyslog service","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007"}]},"title":"Rsyslog service configuration","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"secpol":{"id":"secpol","name":"secpol","fields":{"eventaudit":{"name":"eventaudit","type":"\u001a\u0007\u0007","title":"Event Audit","provider":"go.mondoo.com/cnquery/providers/os"},"privilegerights":{"name":"privilegerights","type":"\u001a\u0007\u0019\u0007","title":"Privilege Rights","provider":"go.mondoo.com/cnquery/providers/os"},"registryvalues":{"name":"registryvalues","type":"\u001a\u0007\u0007","title":"Registry Values","provider":"go.mondoo.com/cnquery/providers/os"},"systemaccess":{"name":"systemaccess","type":"\u001a\u0007\u0007","title":"System Access","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Windows local security policy","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"service":{"id":"service","name":"service","fields":{"description":{"name":"description","type":"\u0007","is_mandatory":true,"title":"Service description","provider":"go.mondoo.com/cnquery/providers/os"},"enabled":{"name":"enabled","type":"\u0004","is_mandatory":true,"title":"Is it enabled? (start at boot)","provider":"go.mondoo.com/cnquery/providers/os"},"installed":{"name":"installed","type":"\u0004","is_mandatory":true,"title":"Is it installed?","provider":"go.mondoo.com/cnquery/providers/os"},"masked":{"name":"masked","type":"\u0004","is_mandatory":true,"title":"Is it masked?","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of this service","provider":"go.mondoo.com/cnquery/providers/os"},"running":{"name":"running","type":"\u0004","is_mandatory":true,"title":"Is it running?","provider":"go.mondoo.com/cnquery/providers/os"},"type":{"name":"type","type":"\u0007","is_mandatory":true,"title":"Type information","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"name","type":"\u0007"}]},"title":"Service on this system","min_mondoo_version":"5.15.0","defaults":"name running enabled type","provider":"go.mondoo.com/cnquery/providers/os"},"services":{"id":"services","name":"services","fields":{"list":{"name":"list","type":"\u0019\u001bservice","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bservice","title":"Services configured on this system","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"shadow":{"id":"shadow","name":"shadow","fields":{"entry":{"name":"entry","type":"\u001bshadow.entry","title":"Shadowed password file entry","provider":"go.mondoo.com/cnquery/providers/os"},"list":{"name":"list","type":"\u0019\u001bshadow.entry","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001bshadow.entry","title":"Shadowed Password File","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"shadow.entry":{"id":"shadow.entry","name":"shadow.entry","fields":{"expirydates":{"name":"expirydates","type":"\u0007","is_mandatory":true,"title":"Account expiration date","provider":"go.mondoo.com/cnquery/providers/os"},"inactivedays":{"name":"inactivedays","type":"\u0005","is_mandatory":true,"title":"Password inactivity period","provider":"go.mondoo.com/cnquery/providers/os"},"lastchanged":{"name":"lastchanged","type":"\t","is_mandatory":true,"title":"Date of last password change","provider":"go.mondoo.com/cnquery/providers/os"},"maxdays":{"name":"maxdays","type":"\u0005","is_mandatory":true,"title":"Maximum password age","provider":"go.mondoo.com/cnquery/providers/os"},"mindays":{"name":"mindays","type":"\u0005","is_mandatory":true,"title":"Minimum password age","provider":"go.mondoo.com/cnquery/providers/os"},"password":{"name":"password","type":"\u0007","is_mandatory":true,"title":"Password","provider":"go.mondoo.com/cnquery/providers/os"},"reserved":{"name":"reserved","type":"\u0007","is_mandatory":true,"title":"Reserved field","provider":"go.mondoo.com/cnquery/providers/os"},"user":{"name":"user","type":"\u0007","is_mandatory":true,"title":"User","provider":"go.mondoo.com/cnquery/providers/os"},"warndays":{"name":"warndays","type":"\u0005","is_mandatory":true,"title":"Password warning period","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Shadowed password file entry","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"sshd":{"id":"sshd","name":"sshd","fields":{"config":{"name":"config","type":"\u001bsshd.config","title":"SSH server configuration","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"SSH server resource","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"sshd.config":{"id":"sshd.config","name":"sshd.config","fields":{"ciphers":{"name":"ciphers","type":"\u0019\u0007","refs":["\"params\""],"title":"Ciphers configured for this SSH server","provider":"go.mondoo.com/cnquery/providers/os"},"content":{"name":"content","type":"\u0007","refs":["\"files\""],"title":"Raw content of this SSH server config","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","title":"File of this SSH server configuration","provider":"go.mondoo.com/cnquery/providers/os"},"files":{"name":"files","type":"\u0019\u001bfile","refs":["\"file\""],"title":"A list of lexically sorted files making up the SSH server configuration","provider":"go.mondoo.com/cnquery/providers/os"},"hostkeys":{"name":"hostkeys","type":"\u0019\u0007","refs":["\"params\""],"title":"Host Keys configured for this SSH server","provider":"go.mondoo.com/cnquery/providers/os"},"kexs":{"name":"kexs","type":"\u0019\u0007","refs":["\"params\""],"title":"Key Exchange Algorithms configured for this SSH server","provider":"go.mondoo.com/cnquery/providers/os"},"macs":{"name":"macs","type":"\u0019\u0007","refs":["\"params\""],"title":"MACs configured for this SSH server","provider":"go.mondoo.com/cnquery/providers/os"},"params":{"name":"params","type":"\u001a\u0007\u0007","refs":["\"content\""],"title":"Configuration values of this SSH server","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"path","type":"\u0007","optional":true}]},"title":"SSH server configuration","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"user":{"id":"user","name":"user","fields":{"authorizedkeys":{"name":"authorizedkeys","type":"\u001bauthorizedkeys","refs":["\"home\""],"title":"List of authorized keys","provider":"go.mondoo.com/cnquery/providers/os"},"enabled":{"name":"enabled","type":"\u0004","is_mandatory":true,"title":"Indicates if the user is enabled","provider":"go.mondoo.com/cnquery/providers/os"},"gid":{"name":"gid","type":"\u0005","is_mandatory":true,"title":"User's Group ID","provider":"go.mondoo.com/cnquery/providers/os"},"group":{"name":"group","type":"\u001bgroup","refs":["\"gid\""],"title":"Group that user is a member of","provider":"go.mondoo.com/cnquery/providers/os"},"home":{"name":"home","type":"\u0007","is_mandatory":true,"title":"Home folder","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Name of the user","provider":"go.mondoo.com/cnquery/providers/os"},"shell":{"name":"shell","type":"\u0007","is_mandatory":true,"title":"Default shell configured","provider":"go.mondoo.com/cnquery/providers/os"},"sid":{"name":"sid","type":"\u0007","is_mandatory":true,"title":"User's Security Identifier (Windows)","provider":"go.mondoo.com/cnquery/providers/os"},"sshkeys":{"name":"sshkeys","type":"\u0019\u001bprivatekey","title":"List of SSH keys","provider":"go.mondoo.com/cnquery/providers/os"},"uid":{"name":"uid","type":"\u0005","is_mandatory":true,"title":"User ID","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"User on this system","defaults":"name uid gid","provider":"go.mondoo.com/cnquery/providers/os"},"users":{"id":"users","name":"users","fields":{"list":{"name":"list","type":"\u0019\u001buser","provider":"go.mondoo.com/cnquery/providers/os"}},"list_type":"\u001buser","title":"Users configured on this system","provider":"go.mondoo.com/cnquery/providers/os"},"yum":{"id":"yum","name":"yum","fields":{"repo":{"name":"repo","type":"\u001byum.repo","title":"Yum repository resource","provider":"go.mondoo.com/cnquery/providers/os"},"repos":{"name":"repos","type":"\u0019\u001byum.repo","title":"List of all configured yum repositories","provider":"go.mondoo.com/cnquery/providers/os"},"vars":{"name":"vars","type":"\u001a\u0007\u0007","title":"variables defined built-in in Yum configuration files (/etc/yum.conf and all .repo files in the /etc/yum.repos.d/)","provider":"go.mondoo.com/cnquery/providers/os"}},"title":"Yum package manager resource","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"},"yum.repo":{"id":"yum.repo","name":"yum.repo","fields":{"baseurl":{"name":"baseurl","type":"\u0019\u0007","is_mandatory":true,"title":"URL where the repodata directory of a repository is located","provider":"go.mondoo.com/cnquery/providers/os"},"enabled":{"name":"enabled","type":"\u0004","title":"Indicates if this repository is used as package source","provider":"go.mondoo.com/cnquery/providers/os"},"expire":{"name":"expire","type":"\u0007","is_mandatory":true,"title":"Indicator when the repository will expire","provider":"go.mondoo.com/cnquery/providers/os"},"file":{"name":"file","type":"\u001bfile","is_mandatory":true,"title":"Repository configuration file path","min_mondoo_version":"5.18.0","provider":"go.mondoo.com/cnquery/providers/os"},"filename":{"name":"filename","type":"\u0007","is_mandatory":true,"title":"Deprecated: location of the repo configuration file, use file.path","provider":"go.mondoo.com/cnquery/providers/os"},"id":{"name":"id","type":"\u0007","is_mandatory":true,"title":"Repository ID","provider":"go.mondoo.com/cnquery/providers/os"},"mirrors":{"name":"mirrors","type":"\u0007","is_mandatory":true,"title":"Mirrors for this repository","provider":"go.mondoo.com/cnquery/providers/os"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Human-readable repository name","provider":"go.mondoo.com/cnquery/providers/os"},"pkgs":{"name":"pkgs","type":"\u0007","is_mandatory":true,"title":"Packages in repository","provider":"go.mondoo.com/cnquery/providers/os"},"revision":{"name":"revision","type":"\u0007","is_mandatory":true,"title":"Repository revision","provider":"go.mondoo.com/cnquery/providers/os"},"size":{"name":"size","type":"\u0007","is_mandatory":true,"title":"File size of this repository","provider":"go.mondoo.com/cnquery/providers/os"},"status":{"name":"status","type":"\u0007","is_mandatory":true,"title":"Repository status","provider":"go.mondoo.com/cnquery/providers/os"}},"init":{"args":[{"name":"id","type":"\u0007"}]},"title":"Yum repository resource","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/os"}}} \ No newline at end of file diff --git a/providers/providers.go b/providers/providers.go index 79f6ccb64c..0445dcbfc2 100644 --- a/providers/providers.go +++ b/providers/providers.go @@ -147,6 +147,44 @@ func ListAll() ([]*Provider, error) { return all, nil } +var mockProvider = Provider{ + Provider: &plugin.Provider{ + Name: "mock", + ID: "go.mondoo.com/cnquery/providers/mock", + Connectors: []plugin.Connector{{ + Name: "mock", + Use: "mock", + Short: "use a recording without an active connection", + }}, + }, +} + +type mockProviderService struct{} + +func (s *mockProviderService) ParseCLI(req *plugin.ParseCLIReq) (*plugin.ParseCLIRes, error) { + return nil, errors.New("mock doesn't parse CLI") +} + +func (s *mockProviderService) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*plugin.ConnectRes, error) { + panic("NO") +} + +func (s *mockProviderService) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + panic("NO") +} + +func (s *mockProviderService) GetData(req *plugin.DataReq) (*plugin.DataRes, error) { + panic("NO") +} + +func (s *mockProviderService) StoreData(req *plugin.StoreReq) (*plugin.StoreRes, error) { + panic("NO") +} + +func initMockProvider() *mockProviderService { + return nil +} + // EnsureProvider find the provider for a given connector either from the list // of existing proviers or by downloading and installing it. func EnsureProvider(existing Providers, connectorName string, connectorType string, autoUpdate bool) (*Provider, error) { @@ -155,6 +193,11 @@ func EnsureProvider(existing Providers, connectorName string, connectorType stri return provider, nil } + if connectorName == "mock" || connectorType == "mock" { + existing.Add(&mockProvider) + return &mockProvider, nil + } + upstream := DefaultProviders.ForConnection(connectorName, connectorType) if upstream == nil { // we can't find any provider for this connector in our default set diff --git a/providers/recording.go b/providers/recording.go index 0f418bb205..51a779f8b8 100644 --- a/providers/recording.go +++ b/providers/recording.go @@ -32,6 +32,11 @@ type recording struct { prettyPrintJSON bool `json:"-"` } +// ReadOnly converts the recording into a read-only recording +func (r *recording) ReadOnly() *readOnlyRecording { + return &readOnlyRecording{r} +} + type assetRecording struct { Asset assetInfo `json:"asset"` Connections []connectionRecording `json:"connections"` @@ -56,11 +61,11 @@ type assetInfo struct { } type connectionRecording struct { - Url string `json:"url"` - Provider string `json:"provider"` - Connector string `json:"connector"` - Version string `json:"version"` - id uint32 `json:"-"` + Url string `json:"url"` + ProviderID string `json:"provider"` + Connector string `json:"connector"` + Version string `json:"version"` + id uint32 `json:"-"` } type resourceRecording struct { @@ -374,7 +379,7 @@ func (r *recording) findAssetConnID(asset *inventory.Asset, conf *inventory.Conf return found, id } -func (r *recording) EnsureAsset(asset *inventory.Asset, provider string, connectionID uint32, conf *inventory.Config) { +func (r *recording) EnsureAsset(asset *inventory.Asset, providerID string, connectionID uint32, conf *inventory.Config) { found, _ := r.findAssetConnID(asset, conf) if found == -1 { @@ -409,10 +414,10 @@ func (r *recording) EnsureAsset(asset *inventory.Asset, provider string, connect url := conf.ToUrl() assetObj.connections[url] = &connectionRecording{ - Url: url, - Provider: provider, - Connector: conf.Type, - id: conf.Id, + Url: url, + ProviderID: providerID, + Connector: conf.Type, + id: conf.Id, } r.assets[connectionID] = assetObj } diff --git a/providers/runtime.go b/providers/runtime.go index 24416c8431..9fb23932a7 100644 --- a/providers/runtime.go +++ b/providers/runtime.go @@ -217,7 +217,7 @@ func (r *Runtime) Connect(req *plugin.ConnectReq) error { if err != nil { return err } - r.Recording.EnsureAsset(r.Provider.Connection.Asset, r.Provider.Instance.Name, r.Provider.Connection.Id, asset.Connections[0]) + r.Recording.EnsureAsset(r.Provider.Connection.Asset, r.Provider.Instance.ID, r.Provider.Connection.Id, asset.Connections[0]) return nil } @@ -401,11 +401,72 @@ func (p *providerCallbacks) Collect(req *plugin.DataRes) error { return nil } -func (r *Runtime) SetRecording(recording *recording, providerID string, readOnly bool, mockConnection bool) error { - if readOnly { - r.Recording = &readOnlyRecording{recording} - } else { - r.Recording = recording +func baseRecording(anyRecording Recording) *recording { + var baseRecording *recording + switch x := anyRecording.(type) { + case *recording: + baseRecording = x + case *readOnlyRecording: + baseRecording = x.recording + } + return baseRecording +} + +func (r *Runtime) SetRecording(anyRecording Recording, providerID string) error { + r.Recording = anyRecording + if providerID != mockProvider.ID { + // This is a sanity check, to make sure we didn't set a pseudo-mock connection + // without the mock provider. + if r.Provider == nil || r.Provider.Instance == nil || r.Provider.Instance.ID == "" { + return errors.New("running provider must be set") + } + return nil + } + + // At this point it's all about mock recordings. We now have 2 goals: + // 1. make one asset the primary asset for this runtime + // 2. load all schemas for all other connections + base := baseRecording(anyRecording) + if base == nil { + return errors.New("cannot get recording for mock connection, it is required") + } + + if len(base.Assets) == 0 { + return errors.New("no asset found in recording") + } + asset := base.Assets[0] + + if len(asset.Connections) == 0 { + return errors.New("asset '" + asset.Asset.ID + "' in recording (which is used by default) has no connections") + } + + for i := range asset.Connections { + conn := asset.Connections[i] + provider, err := r.addProvider(conn.ProviderID) + if err != nil { + return errors.New("failed to get provider '" + conn.ProviderID + "' which is used for asset '" + asset.Asset.ID + "' in this recording") + } + + if i == 0 { + r.Provider = provider + } + r.AddConnectedProvider(provider) + + err = r.SetMockRecording(anyRecording, provider.Instance.ID, true) + if err != nil { + panic("failed to set recording: " + err.Error()) + } + } + + return nil +} + +func (r *Runtime) SetMockRecording(anyRecording Recording, providerID string, mockConnection bool) error { + r.Recording = anyRecording + + baseRecording := baseRecording(anyRecording) + if baseRecording == nil { + return nil } provider, ok := r.providers[providerID] @@ -413,7 +474,7 @@ func (r *Runtime) SetRecording(recording *recording, providerID string, readOnly return errors.New("cannot set recording, provider '" + providerID + "' not found") } - assetRecording := &recording.Assets[0] + assetRecording := &baseRecording.Assets[0] asset := assetRecording.Asset.ToInventory() if mockConnection { @@ -442,7 +503,7 @@ func (r *Runtime) SetRecording(recording *recording, providerID string, readOnly // Dom: we may need to cancel the entire setup here, may need to be reconsidered... log.Warn().Msg("recording cannot determine asset, no connection was set up!") } else { - recording.assets[provider.Connection.Id] = assetRecording + baseRecording.assets[provider.Connection.Id] = assetRecording } return nil