From 241213e156de8e1ed9f565bf74ee3f21a014c7d3 Mon Sep 17 00:00:00 2001 From: Letha <letha@mondoo.com> Date: Thu, 7 Nov 2024 09:46:09 -0800 Subject: [PATCH] Add GitHub long-form help (#4824) --- providers/github/config/config.go | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/providers/github/config/config.go b/providers/github/config/config.go index 373453cd60..b11a84b7c2 100644 --- a/providers/github/config/config.go +++ b/providers/github/config/config.go @@ -17,9 +17,28 @@ var Config = plugin.Provider{ ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { - Name: "github", - Use: "github", - Short: "a GitHub organization or repository", + Name: "github", + Use: "github", + Short: "a GitHub organization or repository", + Long: `Use the github provider to query resources within GitHub organizations and repositories. + +Available commands: + org GitHub organization + repo GitHub repo + +Examples: + cnspec scan github org <ORG_NAME> --discover organization + cnspec scan github org <ORG_NAME> --repos "<REPO1>,<REPO2>" + cnquery shell github org <ORG_NAME> + cnquery shell github org <YOUR-GITHUB-ORG> --app-id <YOUR-GITHUB-APP-ID> --app-installation-id <YOUR-GITHUB-APP-INSTALL-ID> --app-private-key <PATH-TO-PEM-FILE> + +Notes: + Mondoo needs a personal access token to scan a GitHub organization, public repo, or private repo. The token's level of access determines how much information Mondoo can retrieve. Supply your personal access token to Mondoo by setting the GITHUB_TOKEN environment variable. To learn how, read https://mondoo.com/docs/cnspec/saas/github/. + + If you have very large GitHub organizations, consider giving Mondoo access using custom GitHub app credentials. To learn how, read https://mondoo.com/docs/cnspec/saas/gh-app/. + + If you have a GitHub Enterprise Server account, you must provide the URL for the account using the --enterprise-url flag. +`, MinArgs: 2, MaxArgs: 2, Discovery: []string{ @@ -45,7 +64,7 @@ var Config = plugin.Provider{ Long: "repos", Type: plugin.FlagType_String, Default: "", - Desc: "Only include repositories with matching names", + Desc: "Only include repositories matching these names", }, { Long: "app-id", @@ -69,7 +88,7 @@ var Config = plugin.Provider{ Long: "enterprise-url", Type: plugin.FlagType_String, Default: "", - Desc: "GitHub Enterprise URL", + Desc: "GitHub Enterprise Server URL", }, }, },