Fix cscli hub (#534)
This commit is contained in:
parent
fd8c23eb09
commit
79080d4e36
11
.github/workflows/ci_hub-tests.yml
vendored
11
.github/workflows/ci_hub-tests.yml
vendored
|
@ -27,14 +27,15 @@ jobs:
|
|||
git clone https://github.com/crowdsecurity/hub-tests.git
|
||||
cd hub-tests
|
||||
make
|
||||
- uses: oprypin/find-latest-tag@v1
|
||||
- id: keydb
|
||||
uses: pozetroninc/github-action-get-latest-release@master
|
||||
with:
|
||||
repository: crowdsecurity/crowdsec # The repository to scan.
|
||||
releases-only: false # We know that all relevant tags have a GitHub release for them.
|
||||
id: crowdsec # The step ID to refer to later.
|
||||
owner: crowdsecurity
|
||||
repo: crowdsec
|
||||
excludes: prerelease, draft
|
||||
- name: Create crowdsec test env with all parsers from the release
|
||||
run: |
|
||||
cd crowdsec-${{ steps.crowdsec.outputs.tag }}
|
||||
cd crowdsec-${{ steps.keydb.outputs.release }}
|
||||
./test_env.sh
|
||||
cd tests
|
||||
for i in `./cscli -c dev.yaml parsers list -a -o json | jq -r ".[].name" ` ; do
|
||||
|
|
|
@ -94,7 +94,6 @@ func NewCollectionsCmd() *cobra.Command {
|
|||
Short: "Upgrade given collection(s)",
|
||||
Long: `Fetch and upgrade given collection(s) from hub`,
|
||||
Example: `cscli collections upgrade crowdsec/xxx crowdsec/xyz`,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := cwhub.GetHubIdx(csConfig.Cscli); err != nil {
|
||||
log.Fatalf("Failed to get Hub index : %v", err)
|
||||
|
@ -109,7 +108,7 @@ func NewCollectionsCmd() *cobra.Command {
|
|||
}
|
||||
},
|
||||
}
|
||||
cmdCollectionsUpgrade.PersistentFlags().BoolVarP(&all, "download-only", "d", false, "Only download packages, don't enable")
|
||||
cmdCollectionsUpgrade.PersistentFlags().BoolVarP(&all, "all", "a", false, "Upgrade all the collections")
|
||||
cmdCollectionsUpgrade.PersistentFlags().BoolVar(&forceAction, "force", false, "Force upgrade : Overwrite tainted and outdated files")
|
||||
cmdCollections.AddCommand(cmdCollectionsUpgrade)
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ cscli hub update # Download list of available configurations from the hub
|
|||
ListItem(cwhub.PARSERS_OVFLW, args)
|
||||
},
|
||||
}
|
||||
cmdHub.PersistentFlags().BoolVarP(&all, "all", "a", false, "List as well disabled items")
|
||||
cmdHubList.PersistentFlags().BoolVarP(&all, "all", "a", false, "List as well disabled items")
|
||||
cmdHub.AddCommand(cmdHubList)
|
||||
|
||||
var cmdHubUpdate = &cobra.Command{
|
||||
|
@ -84,5 +84,39 @@ Fetches the [.index.json](https://github.com/crowdsecurity/hub/blob/master/.inde
|
|||
}
|
||||
cmdHub.AddCommand(cmdHubUpdate)
|
||||
|
||||
var cmdHubUpgrade = &cobra.Command{
|
||||
Use: "upgrade",
|
||||
Short: "Upgrade all configs installed from hub",
|
||||
Long: `
|
||||
Upgrade all configs installed from Crowdsec Hub. Run 'sudo cscli hub update' if you want the latest versions available.
|
||||
`,
|
||||
Args: cobra.ExactArgs(0),
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
if csConfig.Cscli == nil {
|
||||
return fmt.Errorf("you must configure cli before interacting with hub")
|
||||
}
|
||||
|
||||
if err := setHubBranch(); err != nil {
|
||||
return fmt.Errorf("error while setting hub branch: %s", err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := cwhub.GetHubIdx(csConfig.Cscli); err != nil {
|
||||
log.Fatalf("Failed to get Hub index : %v", err)
|
||||
log.Infoln("Run 'sudo cscli hub update' to get the hub index")
|
||||
}
|
||||
log.Infof("Upgrading collections")
|
||||
UpgradeConfig(cwhub.COLLECTIONS, "", forceAction)
|
||||
log.Infof("Upgrading parsers")
|
||||
UpgradeConfig(cwhub.PARSERS, "", forceAction)
|
||||
log.Infof("Upgrading scenarios")
|
||||
UpgradeConfig(cwhub.SCENARIOS, "", forceAction)
|
||||
log.Infof("Upgrading postoverflows")
|
||||
UpgradeConfig(cwhub.PARSERS_OVFLW, "", forceAction)
|
||||
},
|
||||
}
|
||||
cmdHubUpgrade.PersistentFlags().BoolVar(&forceAction, "force", false, "Force upgrade : Overwrite tainted and outdated files")
|
||||
cmdHub.AddCommand(cmdHubUpgrade)
|
||||
return cmdHub
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ Keep in mind the machine needs to be validated by an administrator on LAPI side
|
|||
}
|
||||
cmdLapiRegister.Flags().StringVarP(&apiURL, "url", "u", "", "URL of the API (ie. http://127.0.0.1)")
|
||||
cmdLapiRegister.Flags().StringVarP(&outputFile, "file", "f", "", "output file destination")
|
||||
cmdLapiRegister.Flags().StringVar(&lapiUser, "machine", "", "output file destination")
|
||||
cmdLapiRegister.Flags().StringVar(&lapiUser, "machine", "", "Name of the machine to register with")
|
||||
cmdLapi.AddCommand(cmdLapiRegister)
|
||||
|
||||
var cmdLapiStatus = &cobra.Command{
|
||||
|
|
|
@ -90,7 +90,6 @@ cscli parsers remove crowdsecurity/sshd-logs
|
|||
Short: "Upgrade given parser(s)",
|
||||
Long: `Fetch and upgrade given parser(s) from hub`,
|
||||
Example: `cscli parsers upgrade crowdsec/xxx crowdsec/xyz`,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := cwhub.GetHubIdx(csConfig.Cscli); err != nil {
|
||||
log.Fatalf("Failed to get Hub index : %v", err)
|
||||
|
|
|
@ -89,7 +89,6 @@ func NewPostOverflowsCmd() *cobra.Command {
|
|||
Short: "Upgrade given postoverflow(s)",
|
||||
Long: `Fetch and Upgrade given postoverflow(s) from hub`,
|
||||
Example: `cscli postoverflows upgrade crowdsec/xxx crowdsec/xyz`,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := cwhub.GetHubIdx(csConfig.Cscli); err != nil {
|
||||
log.Fatalf("Failed to get Hub index : %v", err)
|
||||
|
@ -104,7 +103,7 @@ func NewPostOverflowsCmd() *cobra.Command {
|
|||
}
|
||||
},
|
||||
}
|
||||
cmdPostOverflowsUpgrade.PersistentFlags().BoolVarP(&all, "download-only", "d", false, "Only download packages, don't enable")
|
||||
cmdPostOverflowsUpgrade.PersistentFlags().BoolVarP(&all, "all", "a", false, "Upgrade all the postoverflows")
|
||||
cmdPostOverflowsUpgrade.PersistentFlags().BoolVar(&forceAction, "force", false, "Force upgrade : Overwrite tainted and outdated files")
|
||||
cmdPostOverflows.AddCommand(cmdPostOverflowsUpgrade)
|
||||
|
||||
|
|
|
@ -90,7 +90,6 @@ cscli scenarios remove crowdsecurity/ssh-bf
|
|||
Short: "Upgrade given scenario(s)",
|
||||
Long: `Fetch and Upgrade given scenario(s) from hub`,
|
||||
Example: `cscli scenarios upgrade crowdsec/xxx crowdsec/xyz`,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := cwhub.GetHubIdx(csConfig.Cscli); err != nil {
|
||||
log.Fatalf("Failed to get Hub index : %v", err)
|
||||
|
@ -105,7 +104,7 @@ cscli scenarios remove crowdsecurity/ssh-bf
|
|||
}
|
||||
},
|
||||
}
|
||||
cmdScenariosUpgrade.PersistentFlags().BoolVarP(&all, "download-only", "d", false, "Only download packages, don't enable")
|
||||
cmdScenariosUpgrade.PersistentFlags().BoolVarP(&all, "all", "a", false, "Upgrade all the scenarios")
|
||||
cmdScenariosUpgrade.PersistentFlags().BoolVar(&forceAction, "force", false, "Force upgrade : Overwrite tainted and outdated files")
|
||||
cmdScenarios.AddCommand(cmdScenariosUpgrade)
|
||||
|
||||
|
|
|
@ -236,10 +236,16 @@ func UpgradeConfig(itemType string, name string, force bool) {
|
|||
}
|
||||
cwhub.AddItem(itemType, v)
|
||||
}
|
||||
if !found {
|
||||
log.Errorf("Didn't find %s", name)
|
||||
if !found && name == "" {
|
||||
log.Infof("No %s installed, nothing to upgrade", itemType)
|
||||
} else if !found {
|
||||
log.Errorf("Item '%s' not found in hub", name)
|
||||
} else if updated == 0 && found {
|
||||
log.Errorf("Nothing to update")
|
||||
if name == "" {
|
||||
log.Infof("All %s are already up-to-date", itemType)
|
||||
} else {
|
||||
log.Infof("Item '%s' is up-to-date", name)
|
||||
}
|
||||
} else if updated != 0 {
|
||||
log.Infof("Upgraded %d items", updated)
|
||||
}
|
||||
|
|
|
@ -38,4 +38,4 @@ It is meant to allow you to manage bans, parsers/scenarios/etc, api and generall
|
|||
* [cscli scenarios](cscli_scenarios.md) - Install/Remove/Upgrade/Inspect scenario(s) from hub
|
||||
* [cscli simulation](cscli_simulation.md) - Manage simulation status of scenarios
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -28,4 +28,4 @@ Manage alerts
|
|||
* [cscli alerts inspect](cscli_alerts_inspect.md) - Show info about an alert
|
||||
* [cscli alerts list](cscli_alerts_list.md) - List alerts
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -43,4 +43,4 @@ cscli alerts delete -s crowdsecurity/ssh-bf"
|
|||
|
||||
* [cscli alerts](cscli_alerts.md) - Manage alerts
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ cscli alerts inspect 123
|
|||
|
||||
* [cscli alerts](cscli_alerts.md) - Manage alerts
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -48,4 +48,4 @@ cscli alerts list --type ban
|
|||
|
||||
* [cscli alerts](cscli_alerts.md) - Manage alerts
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ To list/add/delete bouncers
|
|||
* [cscli bouncers delete](cscli_bouncers_delete.md) - delete bouncer
|
||||
* [cscli bouncers list](cscli_bouncers_list.md) - List bouncers
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli bouncers add MyBouncerName -l 24
|
|||
|
||||
* [cscli bouncers](cscli_bouncers.md) - Manage bouncers
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -28,4 +28,4 @@ cscli bouncers delete MyBouncerName [flags]
|
|||
|
||||
* [cscli bouncers](cscli_bouncers.md) - Manage bouncers
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -38,4 +38,4 @@ cscli bouncers list
|
|||
|
||||
* [cscli bouncers](cscli_bouncers.md) - Manage bouncers
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -26,4 +26,4 @@ Manage interaction with Central API (CAPI)
|
|||
* [cscli capi register](cscli_capi_register.md) - Register to Central API (CAPI)
|
||||
* [cscli capi status](cscli_capi_status.md) - Check status with the Central API (CAPI)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -29,4 +29,4 @@ cscli capi register [flags]
|
|||
|
||||
* [cscli capi](cscli_capi.md) - Manage interaction with Central API (CAPI)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -28,4 +28,4 @@ cscli capi status [flags]
|
|||
|
||||
* [cscli capi](cscli_capi.md) - Manage interaction with Central API (CAPI)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -33,4 +33,4 @@ Install/Remove/Upgrade/Inspect collections from the CrowdSec Hub.
|
|||
* [cscli collections remove](cscli_collections_remove.md) - Remove given collection(s)
|
||||
* [cscli collections upgrade](cscli_collections_upgrade.md) - Upgrade given collection(s)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ cscli collections inspect crowdsec/xxx crowdsec/xyz
|
|||
|
||||
```
|
||||
-h, --help help for inspect
|
||||
-u, --url string Prometheus url (default "http://127.0.0.1:6060/metrics")
|
||||
-u, --url string Prometheus url
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
@ -39,4 +39,4 @@ cscli collections inspect crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli collections](cscli_collections.md) - Manage collections from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli collections install crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli collections](cscli_collections.md) - Manage collections from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -39,4 +39,4 @@ cscli collections list
|
|||
|
||||
* [cscli collections](cscli_collections.md) - Manage collections from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ cscli collections remove crowdsec/xxx crowdsec/xyz
|
|||
### Options
|
||||
|
||||
```
|
||||
--all Delete all the files in selected scope
|
||||
--all Delete all the collections
|
||||
--force Force remove : Remove tainted and outdated files
|
||||
-h, --help help for remove
|
||||
--purge Delete source file too
|
||||
```
|
||||
|
@ -40,4 +41,4 @@ cscli collections remove crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli collections](cscli_collections.md) - Manage collections from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ cscli collections upgrade crowdsec/xxx crowdsec/xyz
|
|||
### Options
|
||||
|
||||
```
|
||||
-d, --download-only Only download packages, don't enable
|
||||
-a, --all Upgrade all the collections
|
||||
--force Force upgrade : Overwrite tainted and outdated files
|
||||
-h, --help help for upgrade
|
||||
```
|
||||
|
@ -40,4 +40,4 @@ cscli collections upgrade crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli collections](cscli_collections.md) - Manage collections from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -27,4 +27,4 @@ Allows to view current config
|
|||
* [cscli config restore](cscli_config_restore.md) - Restore config in backup <directory>
|
||||
* [cscli config show](cscli_config_show.md) - Displays current config
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -45,4 +45,4 @@ cscli config backup ./my-backup
|
|||
|
||||
* [cscli config](cscli_config.md) - Allows to view current config
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli config restore <directory> [flags]
|
|||
|
||||
* [cscli config](cscli_config.md) - Allows to view current config
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -32,4 +32,4 @@ cscli config show [flags]
|
|||
|
||||
* [cscli config](cscli_config.md) - Allows to view current config
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -43,4 +43,4 @@ cscli dashboard remove
|
|||
* [cscli dashboard start](cscli_dashboard_start.md) - Start the metabase container.
|
||||
* [cscli dashboard stop](cscli_dashboard_stop.md) - Stops the metabase container.
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -43,4 +43,4 @@ cscli dashboard remove --force
|
|||
|
||||
* [cscli dashboard](cscli_dashboard.md) - Manage your metabase dashboard container
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -47,4 +47,4 @@ cscli dashboard setup -l 0.0.0.0 -p 443 --password <password>
|
|||
|
||||
* [cscli dashboard](cscli_dashboard.md) - Manage your metabase dashboard container
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -32,4 +32,4 @@ cscli dashboard start [flags]
|
|||
|
||||
* [cscli dashboard](cscli_dashboard.md) - Manage your metabase dashboard container
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -32,4 +32,4 @@ cscli dashboard stop [flags]
|
|||
|
||||
* [cscli dashboard](cscli_dashboard.md) - Manage your metabase dashboard container
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -37,4 +37,4 @@ cscli decisions [action] [filter]
|
|||
* [cscli decisions delete](cscli_decisions_delete.md) - Delete decisions
|
||||
* [cscli decisions list](cscli_decisions_list.md) - List decisions from LAPI
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -45,4 +45,4 @@ cscli decisions add --scope username --value foobar
|
|||
|
||||
* [cscli decisions](cscli_decisions.md) - Manage decisions
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -45,4 +45,4 @@ cscli decisions delete --type captcha
|
|||
|
||||
* [cscli decisions](cscli_decisions.md) - Manage decisions
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -48,4 +48,4 @@ cscli decisions list -t ban
|
|||
|
||||
* [cscli decisions](cscli_decisions.md) - Manage decisions
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ cscli hub update # Download list of available configurations from the hub
|
|||
### Options
|
||||
|
||||
```
|
||||
-a, --all List as well disabled items
|
||||
-h, --help help for hub
|
||||
```
|
||||
|
||||
|
@ -44,5 +43,6 @@ cscli hub update # Download list of available configurations from the hub
|
|||
* [cscli](cscli.md) - cscli allows you to manage crowdsec
|
||||
* [cscli hub list](cscli_hub_list.md) - List installed configs
|
||||
* [cscli hub update](cscli_hub_update.md) - Fetch available configs from hub
|
||||
* [cscli hub upgrade](cscli_hub_upgrade.md) - Upgrade all configs installed from hub
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
|
|
@ -9,13 +9,13 @@ cscli hub list [-a] [flags]
|
|||
### Options
|
||||
|
||||
```
|
||||
-a, --all List as well disabled items
|
||||
-h, --help help for list
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-a, --all List as well disabled items
|
||||
-b, --branch string Use given branch from hub
|
||||
-c, --config string path to crowdsec config file (default "/etc/crowdsec/config.yaml")
|
||||
--debug Set logging to debug.
|
||||
|
@ -30,4 +30,4 @@ cscli hub list [-a] [flags]
|
|||
|
||||
* [cscli hub](cscli_hub.md) - Manage Hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ cscli hub update [flags]
|
|||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-a, --all List as well disabled items
|
||||
-b, --branch string Use given branch from hub
|
||||
-c, --config string path to crowdsec config file (default "/etc/crowdsec/config.yaml")
|
||||
--debug Set logging to debug.
|
||||
|
@ -36,4 +35,4 @@ cscli hub update [flags]
|
|||
|
||||
* [cscli hub](cscli_hub.md) - Manage Hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
39
docs/v1.X/docs/cscli/cscli_hub_upgrade.md
Normal file
39
docs/v1.X/docs/cscli/cscli_hub_upgrade.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
## cscli hub upgrade
|
||||
|
||||
Upgrade all configs installed from hub
|
||||
|
||||
### Synopsis
|
||||
|
||||
|
||||
Upgrade all configs installed from Crowdsec Hub. Run 'sudo cscli hub update' if you want the latest versions available.
|
||||
|
||||
|
||||
```
|
||||
cscli hub upgrade [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--force Force upgrade : Overwrite tainted and outdated files
|
||||
-h, --help help for upgrade
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-b, --branch string Use given branch from hub
|
||||
-c, --config string path to crowdsec config file (default "/etc/crowdsec/config.yaml")
|
||||
--debug Set logging to debug.
|
||||
--error Set logging to error.
|
||||
--info Set logging to info.
|
||||
-o, --output string Output format : human, json, raw.
|
||||
--trace Set logging to trace.
|
||||
--warning Set logging to warning.
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [cscli hub](cscli_hub.md) - Manage Hub
|
||||
|
||||
|
|
@ -26,4 +26,4 @@ Manage interaction with Local API (LAPI)
|
|||
* [cscli lapi register](cscli_lapi_register.md) - Register a machine to Local API (LAPI)
|
||||
* [cscli lapi status](cscli_lapi_status.md) - Check authentication to Local API (LAPI)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ cscli lapi register [flags]
|
|||
```
|
||||
-f, --file string output file destination
|
||||
-h, --help help for register
|
||||
--machine string Name of the machine to register with
|
||||
-u, --url string URL of the API (ie. http://127.0.0.1)
|
||||
```
|
||||
|
||||
|
@ -35,4 +36,4 @@ cscli lapi register [flags]
|
|||
|
||||
* [cscli lapi](cscli_lapi.md) - Manage interaction with Local API (LAPI)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -28,4 +28,4 @@ cscli lapi status [flags]
|
|||
|
||||
* [cscli lapi](cscli_lapi.md) - Manage interaction with Local API (LAPI)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -42,4 +42,4 @@ cscli machines [action]
|
|||
* [cscli machines list](cscli_machines_list.md) - List machines
|
||||
* [cscli machines validate](cscli_machines_validate.md) - validate a machine to access the local API
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -48,4 +48,4 @@ cscli machines add MyTestMachine --password MyPassword
|
|||
|
||||
* [cscli machines](cscli_machines.md) - Manage local API machines
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ cscli machines delete <machine_name>
|
|||
|
||||
* [cscli machines](cscli_machines.md) - Manage local API machines
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -38,4 +38,4 @@ cscli machines list
|
|||
|
||||
* [cscli machines](cscli_machines.md) - Manage local API machines
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -38,4 +38,4 @@ cscli machines validate <machine_name>
|
|||
|
||||
* [cscli machines](cscli_machines.md) - Manage local API machines
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ cscli metrics [flags]
|
|||
|
||||
```
|
||||
-h, --help help for metrics
|
||||
-u, --url string Prometheus url (default "http://127.0.0.1:6060/metrics")
|
||||
-u, --url string Prometheus url (http://<ip>:<port>/metrics)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
@ -33,4 +33,4 @@ cscli metrics [flags]
|
|||
|
||||
* [cscli](cscli.md) - cscli allows you to manage crowdsec
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli parsers remove crowdsecurity/sshd-logs
|
|||
* [cscli parsers remove](cscli_parsers_remove.md) - Remove given parser(s)
|
||||
* [cscli parsers upgrade](cscli_parsers_upgrade.md) - Upgrade given parser(s)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ cscli parsers inspect crowdsec/xxx
|
|||
|
||||
```
|
||||
-h, --help help for inspect
|
||||
-u, --url string Prometheus url (default "http://127.0.0.1:6060/metrics")
|
||||
-u, --url string Prometheus url
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
@ -39,4 +39,4 @@ cscli parsers inspect crowdsec/xxx
|
|||
|
||||
* [cscli parsers](cscli_parsers.md) - Install/Remove/Upgrade/Inspect parser(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli parsers install crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli parsers](cscli_parsers.md) - Install/Remove/Upgrade/Inspect parser(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli parser list crowdsecurity/xxx
|
|||
|
||||
* [cscli parsers](cscli_parsers.md) - Install/Remove/Upgrade/Inspect parser(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ cscli parsers remove crowdsec/xxx crowdsec/xyz
|
|||
|
||||
```
|
||||
--all Delete all the parsers
|
||||
--force Force remove : Remove tainted and outdated files
|
||||
-h, --help help for remove
|
||||
--purge Delete source file too
|
||||
```
|
||||
|
@ -40,4 +41,4 @@ cscli parsers remove crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli parsers](cscli_parsers.md) - Install/Remove/Upgrade/Inspect parser(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli parsers upgrade crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli parsers](cscli_parsers.md) - Install/Remove/Upgrade/Inspect parser(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -39,4 +39,4 @@ cscli postoverflows install crowdsecurity/cdn-whitelist
|
|||
* [cscli postoverflows remove](cscli_postoverflows_remove.md) - Remove given postoverflow(s)
|
||||
* [cscli postoverflows upgrade](cscli_postoverflows_upgrade.md) - Upgrade given postoverflow(s)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -38,4 +38,4 @@ cscli postoverflows inspect crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli postoverflows](cscli_postoverflows.md) - Install/Remove/Upgrade/Inspect postoverflow(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli postoverflows install crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli postoverflows](cscli_postoverflows.md) - Install/Remove/Upgrade/Inspect postoverflow(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli postoverflows list crowdsecurity/xxx
|
|||
|
||||
* [cscli postoverflows](cscli_postoverflows.md) - Install/Remove/Upgrade/Inspect postoverflow(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@ cscli postoverflows remove crowdsec/xxx crowdsec/xyz
|
|||
### Options
|
||||
|
||||
```
|
||||
--all Delete all the files in selected scope
|
||||
--all Delete all the postoverflows
|
||||
--force Force remove : Remove tainted and outdated files
|
||||
-h, --help help for remove
|
||||
--purge Delete source file in ~/.cscli/hub/ too
|
||||
--purge Delete source file too
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
@ -40,4 +41,4 @@ cscli postoverflows remove crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli postoverflows](cscli_postoverflows.md) - Install/Remove/Upgrade/Inspect postoverflow(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ cscli postoverflows upgrade crowdsec/xxx crowdsec/xyz
|
|||
### Options
|
||||
|
||||
```
|
||||
-d, --download-only Only download packages, don't enable
|
||||
-a, --all Upgrade all the postoverflows
|
||||
--force Force upgrade : Overwrite tainted and outdated files
|
||||
-h, --help help for upgrade
|
||||
```
|
||||
|
@ -40,4 +40,4 @@ cscli postoverflows upgrade crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli postoverflows](cscli_postoverflows.md) - Install/Remove/Upgrade/Inspect postoverflow(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli scenarios remove crowdsecurity/ssh-bf
|
|||
* [cscli scenarios remove](cscli_scenarios_remove.md) - Remove given scenario(s)
|
||||
* [cscli scenarios upgrade](cscli_scenarios_upgrade.md) - Upgrade given scenario(s)
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ cscli scenarios inspect crowdsec/xxx
|
|||
|
||||
```
|
||||
-h, --help help for inspect
|
||||
-u, --url string Prometheus url (default "http://127.0.0.1:6060/metrics")
|
||||
-u, --url string Prometheus url
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
@ -39,4 +39,4 @@ cscli scenarios inspect crowdsec/xxx
|
|||
|
||||
* [cscli scenarios](cscli_scenarios.md) - Install/Remove/Upgrade/Inspect scenario(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli scenarios install crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli scenarios](cscli_scenarios.md) - Install/Remove/Upgrade/Inspect scenario(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ cscli scenarios list crowdsecurity/xxx
|
|||
|
||||
* [cscli scenarios](cscli_scenarios.md) - Install/Remove/Upgrade/Inspect scenario(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@ cscli scenarios remove crowdsec/xxx crowdsec/xyz
|
|||
### Options
|
||||
|
||||
```
|
||||
--all Delete all the files in selected scope
|
||||
--all Delete all the scenarios
|
||||
--force Force remove : Remove tainted and outdated files
|
||||
-h, --help help for remove
|
||||
--purge Delete source file in ~/.cscli/hub/ too
|
||||
--purge Delete source file too
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
@ -40,4 +41,4 @@ cscli scenarios remove crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli scenarios](cscli_scenarios.md) - Install/Remove/Upgrade/Inspect scenario(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ cscli scenarios upgrade crowdsec/xxx crowdsec/xyz
|
|||
### Options
|
||||
|
||||
```
|
||||
-d, --download-only Only download packages, don't enable
|
||||
--force Force install : Overwrite tainted and outdated files
|
||||
-a, --all Upgrade all the scenarios
|
||||
--force Force upgrade : Overwrite tainted and outdated files
|
||||
-h, --help help for upgrade
|
||||
```
|
||||
|
||||
|
@ -40,4 +40,4 @@ cscli scenarios upgrade crowdsec/xxx crowdsec/xyz
|
|||
|
||||
* [cscli scenarios](cscli_scenarios.md) - Install/Remove/Upgrade/Inspect scenario(s) from hub
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ cscli simulation disable crowdsecurity/ssh-bf
|
|||
* [cscli simulation enable](cscli_simulation_enable.md) - Enable the simulation, globally or on specified scenarios
|
||||
* [cscli simulation status](cscli_simulation_status.md) - Show simulation mode status
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ cscli simulation disable
|
|||
|
||||
* [cscli simulation](cscli_simulation.md) - Manage simulation status of scenarios
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ cscli simulation enable
|
|||
|
||||
* [cscli simulation](cscli_simulation.md) - Manage simulation status of scenarios
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
|
@ -34,4 +34,4 @@ cscli simulation status
|
|||
|
||||
* [cscli simulation](cscli_simulation.md) - Manage simulation status of scenarios
|
||||
|
||||
###### Auto generated by spf13/cobra on 30-Nov-2020
|
||||
|
||||
|
|
Loading…
Reference in a new issue