Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application Security Engine Support #2273

Merged
merged 291 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
291 commits
Select commit Hold shift + click to select a range
cd5cb55
debug
AlteredCoder Jul 19, 2023
8ba692b
debug
AlteredCoder Jul 19, 2023
7d8c931
add loggers
AlteredCoder Jul 19, 2023
ab2c152
reduce verbosity
AlteredCoder Jul 19, 2023
472f40b
fix
AlteredCoder Jul 19, 2023
779ea2e
fix
AlteredCoder Jul 19, 2023
54fd2e4
fixed
buixor Jul 20, 2023
b33ba27
add flatten to manipulate arrays of arrays
buixor Jul 20, 2023
a326ffb
add distinct
buixor Jul 20, 2023
c17b103
take method from header
AlteredCoder Jul 25, 2023
4993758
handle missing headers
AlteredCoder Jul 26, 2023
01ced8f
merge
blotus Jul 24, 2023
792961d
wip
blotus Jul 24, 2023
f7e0980
waf_rules -> waf-rules
blotus Jul 24, 2023
2f5a6fb
wip
blotus Jul 24, 2023
dd5e38a
expose internal coraza vars in evt.Waap
blotus Jul 27, 2023
c413860
remove local replace
blotus Jul 27, 2023
a7cd86f
allow to select what variables shouldd be tracked
buixor Jul 31, 2023
e4e2bb5
switch to properly compiled regexp to be able to bail out early
buixor Jul 31, 2023
4a38cb5
logging
buixor Jul 31, 2023
fc8a0ee
update
AlteredCoder Jul 31, 2023
dd83bde
revert previous bad merge
blotus Jul 31, 2023
711f047
merge from master
blotus Jul 31, 2023
e381d85
Merge branch 'master' into coraza_poc_acquis
blotus Jul 31, 2023
343d22e
fix rules helpers
AlteredCoder Jul 31, 2023
da37b55
update
AlteredCoder Jul 31, 2023
51295ef
fix
AlteredCoder Jul 31, 2023
4332598
add debug
AlteredCoder Jul 31, 2023
353926e
add debug
AlteredCoder Jul 31, 2023
cbf06c2
fix outofband evt generation
AlteredCoder Aug 1, 2023
885c283
remove debug
AlteredCoder Aug 1, 2023
59e3d0d
distinct: return emtpy slice
blotus Aug 2, 2023
a4ee1e7
try re2 for @rx operator
blotus Aug 2, 2023
4846701
logging
buixor Aug 21, 2023
e0bd4dc
fix linter
AlteredCoder Aug 24, 2023
0379574
support SSL for waf
AlteredCoder Aug 31, 2023
24d2c26
clarify logging if triggering inband or outofband rules
buixor Sep 5, 2023
4e26e23
Waap config (#2460)
buixor Sep 11, 2023
1a5799e
up
buixor Sep 12, 2023
5a0b1b7
up
buixor Sep 12, 2023
1286efc
up
buixor Sep 12, 2023
6930b1e
up
buixor Sep 13, 2023
c435447
up
buixor Sep 13, 2023
2e60e80
up wip
buixor Sep 13, 2023
7081666
up
buixor Sep 13, 2023
6a47b9e
up
buixor Sep 13, 2023
a8321b5
up
buixor Sep 14, 2023
4234122
up
buixor Sep 19, 2023
502e21b
wip
blotus Aug 31, 2023
ca930cc
wip
blotus Sep 11, 2023
7fdd4d0
up
blotus Sep 13, 2023
d5e0c8a
up
blotus Sep 14, 2023
d3ce4cb
up
blotus Sep 14, 2023
535738b
up
blotus Sep 19, 2023
dd7fa82
up
blotus Oct 3, 2023
92a3c4b
up
blotus Oct 4, 2023
d3bb9f8
up
blotus Oct 17, 2023
7db5bf8
pkg/csconfig: set prometheus address:port defaults (#2533)
mmetc Oct 11, 2023
734ba46
Refact cscli hub/item commands (#2536)
mmetc Oct 12, 2023
a00bae6
cmd/crowdsec-cli: remove global prometheusURL (#2542)
mmetc Oct 16, 2023
f496bd1
bats: more cscli hub tests (#2541)
mmetc Oct 16, 2023
325003b
Refact cscli item listing, tests (#2547)
mmetc Oct 16, 2023
810a8ad
fix build (#2548)
mmetc Oct 16, 2023
4eae408
HubIndex struct, comments, name changes (#2549)
mmetc Oct 17, 2023
be6555e
Refact pkg/csconfig, HubCfg (#2552)
mmetc Oct 18, 2023
57d3ebb
typo (#2556)
mmetc Oct 18, 2023
511468b
up
blotus Oct 18, 2023
98fb84d
be consistent : waap-rules
buixor Oct 18, 2023
c89b429
naming
buixor Oct 18, 2023
2600ffb
delete coraza submodule
blotus Oct 19, 2023
ecbdf2f
merge master branch
blotus Oct 19, 2023
88e4f7c
Refact pkg/csconfig, pkg/cwhub (#2555)
mmetc Oct 19, 2023
b89c565
Merge branch 'master' into hub-1.5.6
mmetc Oct 19, 2023
350e897
merge hub-1.5.6 branch
blotus Oct 19, 2023
15120a6
merge hub-1.5.6
blotus Oct 19, 2023
ef118a4
add waap-configs hub item
blotus Oct 19, 2023
68c7824
up
blotus Oct 19, 2023
1468bb9
up
blotus Oct 19, 2023
0acda36
up
blotus Oct 20, 2023
5dbc275
warn user when setting unexpected default_remediation
buixor Oct 20, 2023
b110c74
allow description
buixor Oct 20, 2023
ac98256
Refact pkg/cwhub, cmd/crowdsec-cli (#2557)
mmetc Oct 20, 2023
dca6faa
logger
buixor Oct 23, 2023
2ff238d
logger
buixor Oct 23, 2023
c00b1ab
logger
buixor Oct 23, 2023
1b9d8c8
logger
buixor Oct 23, 2023
bd9df8f
logger
buixor Oct 23, 2023
00e1ffb
simplify a bit
buixor Oct 24, 2023
0365040
default level
buixor Oct 24, 2023
6850065
make waap rules generate crowdsec events (again)
buixor Oct 24, 2023
dd49620
our shortcut for waap events
buixor Oct 24, 2023
b2bb15b
generate a special event for waap
buixor Oct 24, 2023
c02c74b
shortcut for waap events
buixor Oct 24, 2023
1f3801f
add the helpers and the type
buixor Oct 24, 2023
9edde09
up
buixor Oct 24, 2023
eafffe7
up
buixor Oct 24, 2023
4bfca8c
fix meta encoding
buixor Oct 25, 2023
676352b
new custom rule format
blotus Oct 25, 2023
46ae0b3
properly set default log level
buixor Oct 26, 2023
e49f33b
Merge branch 'coraza_poc_acquis' of github.com:crowdsecurity/crowdsec…
buixor Oct 26, 2023
6cbeefe
up
buixor Oct 26, 2023
f18b554
warn at start if body reading is disabled
buixor Oct 26, 2023
82bb8a2
no leak plz
buixor Oct 26, 2023
0cebf83
add options via WaapConfig for inband and outofband engines
buixor Oct 26, 2023
cd1cefb
fix behavior so we only generate crowdsec events if interrupt was gen…
buixor Oct 26, 2023
6b8ed0c
Refactor hub URL/branch configuration (#2559)
mmetc Oct 27, 2023
495c6f9
add debug to rule collection
buixor Oct 27, 2023
31a3b8a
move this to pkg/waf
buixor Oct 27, 2023
bb59d98
make Event viabl
buixor Oct 27, 2023
01ddc45
use loggeR
buixor Oct 27, 2023
e5906e6
up
blotus Oct 27, 2023
b0e7da0
up
blotus Oct 27, 2023
37c5d54
up
blotus Oct 27, 2023
57b5f5c
uip
blotus Oct 27, 2023
c96c8f1
logging clean up
buixor Oct 27, 2023
83d5211
logging clean up
buixor Oct 27, 2023
81645c9
logging clean up
buixor Oct 27, 2023
d136cc4
logging clean up
buixor Oct 27, 2023
2e0b968
logging clean up
buixor Oct 27, 2023
17662e5
Refact pkg/cwhub, cscli: hub upgrades (#2568)
mmetc Oct 30, 2023
84ffde1
add body_type in custom rule
blotus Oct 31, 2023
590a19b
Refact pkg/cwhub: constructor, cscli output
mmetc Oct 31, 2023
fcd6c46
fix lint
mmetc Oct 31, 2023
450c263
Refact cwhub: minor cleanups and comments (#2574)
mmetc Oct 31, 2023
26c876d
merge hub-1.6 branch
blotus Nov 6, 2023
41d19de
Refact cwhub (#2578)
mmetc Nov 6, 2023
bfd94ce
make ParserIndex(), DownloadIndex() private methods (#2579)
mmetc Nov 7, 2023
84be2b8
Merge branch 'master' into hub-1.5.6
mmetc Nov 7, 2023
ad54b99
Refact pkg/hubtest (#2580)
mmetc Nov 7, 2023
f4b5bcb
Refact cwhub: version comparison and branch selection (#2581)
mmetc Nov 8, 2023
152c940
wip
blotus Nov 8, 2023
694028f
merge hub branch
blotus Nov 8, 2023
1154ada
up
blotus Nov 8, 2023
927310a
up
blotus Nov 8, 2023
a0b0745
up
blotus Nov 8, 2023
ec4b5bd
Refact cwhub (#2583)
mmetc Nov 9, 2023
f80d841
Refact cwhub: make some methods private (#2584)
mmetc Nov 9, 2023
ab8de19
Refact cwhub: move methods from hub to item (#2585)
mmetc Nov 9, 2023
9d7ed12
Refact cwhub (#2586)
mmetc Nov 10, 2023
d5c7870
Refact cwhub: remove global hub instance (#2587)
mmetc Nov 10, 2023
4bfa0a7
up
blotus Nov 10, 2023
d6f9bbc
merge hub-1.5.6 branch
blotus Nov 10, 2023
07d463f
up
blotus Nov 10, 2023
6dec8a2
update coraza
blotus Nov 14, 2023
042d316
Refact cwhub: remove global hub, func test improvements (#2588)
mmetc Nov 14, 2023
120f7cf
Merge branch 'master' into hub-1.5.6
mmetc Nov 14, 2023
f8c91d2
enable CI tests for hub-1.5.6 (#2592)
mmetc Nov 14, 2023
4a6fd33
replace 'timeout' helper with async python script; allow hub preload …
mmetc Nov 14, 2023
056c979
add support for labels to waap rules
buixor Nov 15, 2023
79d019f
Refact cwhub / sort cscli output, case insensitive (#2593)
mmetc Nov 15, 2023
c8af58d
ensure we're sending lapi/capi alert if the request matched some inba…
buixor Nov 15, 2023
d9b0d44
Refact cwhub (#2596)
mmetc Nov 16, 2023
65473d4
Refact cwhub: simplify enable/disable/download (#2597)
mmetc Nov 16, 2023
56ad2bb
Refact cwhub: item removal with shared dependencies (#2598)
mmetc Nov 16, 2023
db40ba7
Merge branch 'hub-1.5.6' into coraza_poc_acquis
blotus Nov 16, 2023
9db48e2
fix collections install/inspect with waap-{rules,configs}
blotus Nov 16, 2023
9864d2c
Add authentication between bouncers and waf
AlteredCoder Nov 16, 2023
d40e9fb
do not use filepath.Match
blotus Nov 17, 2023
0e717cb
up
blotus Nov 17, 2023
55491be
typo
buixor Nov 17, 2023
9af30e2
simplify a bit
buixor Nov 17, 2023
6718d82
allow testing of waap rules
buixor Nov 17, 2023
017331c
nuclei runner
buixor Nov 17, 2023
94a378d
up
blotus Nov 17, 2023
8173e1b
add timeout to auth request
AlteredCoder Nov 20, 2023
6b317f0
Refact cwhub: simplify tree scan and dependency checks (#2600)
mmetc Nov 20, 2023
4a265ca
up
blotus Nov 20, 2023
2d01e46
do not error if no waap rules are present
buixor Nov 20, 2023
7b1074f
Refact cwhub (#2603)
mmetc Nov 20, 2023
1509c2d
pkg/cwhub refact (#2606)
mmetc Nov 21, 2023
e4b92af
support dedicated waap rules testing in cscli hubtest
buixor Nov 21, 2023
9580f8e
merge hub-1.5.6
blotus Nov 21, 2023
2c652ef
pkg/cwhub documentation (#2607)
mmetc Nov 21, 2023
5abc8e0
merge hub-1.5.6
blotus Nov 21, 2023
ef9b6ac
use generic implem for cscli waap-configs
blotus Nov 22, 2023
56c616f
delete cscli/waap_configs.go
blotus Nov 22, 2023
dd6e539
fix hubtest coverage and some opti
AlteredCoder Nov 22, 2023
b6899e0
add more debug when unauthorized
AlteredCoder Nov 22, 2023
710d8a4
oups
AlteredCoder Nov 22, 2023
118da5b
up
blotus Nov 22, 2023
f77d9e0
up
blotus Nov 23, 2023
946fbbb
up
blotus Nov 24, 2023
b1653ae
up
blotus Nov 27, 2023
e7505f5
up
blotus Nov 27, 2023
dc39866
merge from master
blotus Nov 27, 2023
d851490
up
blotus Nov 27, 2023
3eb272c
Add metrics
AlteredCoder Nov 28, 2023
3683a7a
up
AlteredCoder Nov 28, 2023
5ca2ee2
update
AlteredCoder Nov 28, 2023
8999154
up
blotus Nov 28, 2023
b31d48a
rename headers
blotus Nov 29, 2023
fe005f8
up
blotus Nov 29, 2023
5f25476
up
blotus Nov 29, 2023
eed9ff0
up
blotus Nov 29, 2023
4b7b138
Merge branch 'master' into coraza_poc_acquis
blotus Nov 29, 2023
0084804
typo
blotus Nov 30, 2023
0cd2a2d
fix http code and remediation
blotus Nov 30, 2023
1eab34e
send event for in-band match
blotus Dec 1, 2023
a258cc0
default waap path to /
blotus Dec 1, 2023
68148e0
add evt to on_match hoks
blotus Dec 1, 2023
3836780
up
buixor Dec 1, 2023
1ffece8
Merge branch 'coraza_poc_acquis' of github.com:crowdsecurity/crowdsec…
buixor Dec 1, 2023
7e1fd33
enable expr debugging for hooks
blotus Dec 1, 2023
410e36e
Merge branch 'coraza_poc_acquis' of github.com:crowdsecurity/crowdsec…
buixor Dec 4, 2023
17cfc99
add request dumper with filters
buixor Dec 4, 2023
872e218
Merge branch 'master' into coraza_poc_acquis
blotus Dec 4, 2023
d9355e8
fix hubtest for waap
blotus Dec 4, 2023
60faeaa
add post_eval hook
blotus Dec 4, 2023
2a92012
return an error if a custom rule has both and and or
blotus Dec 4, 2023
393a8b8
linting
blotus Dec 4, 2023
3d3bf0b
lint
blotus Dec 4, 2023
6fb965b
add SetRemediationByTag/Name/ID
blotus Dec 4, 2023
cb030be
Fix Remove{in,out}bandby{name,tag}
blotus Dec 4, 2023
b01901b
fix Remove{in,out}bandRuleBy{name,tag} for pre_eval
blotus Dec 4, 2023
ac451cc
use expr func
blotus Dec 4, 2023
e637e7b
Revert "use expr func"
blotus Dec 4, 2023
1c22783
no need for any in helpers as we are not using expr.Function
blotus Dec 4, 2023
42e1da2
merge listen_addr and listen_port, default to 127.0.0.1:7442 if not set
blotus Dec 4, 2023
c3a4066
appsec renaming, part 1
blotus Dec 4, 2023
bff93d7
appsec renaming, part 2
blotus Dec 4, 2023
8046690
appsec renaming, part 3
blotus Dec 4, 2023
2089ad6
appsec renaming, part 4
blotus Dec 4, 2023
059c0ad
appsec renaming, part 5
blotus Dec 4, 2023
722ce46
remove useless check
blotus Dec 4, 2023
1a1f4f6
do not spam with "unknown" metrics
blotus Dec 4, 2023
52c1e16
more debug when loading rules
blotus Dec 5, 2023
bb307dd
return an error if not appsec-rules matches
blotus Dec 5, 2023
b86ac92
appsec renaming, part 6
blotus Dec 5, 2023
cce83d1
appsec renaming, part 7
blotus Dec 5, 2023
aa02a00
remove unused var
blotus Dec 5, 2023
91a6263
use official way of getting metrics for acquisition
AlteredCoder Dec 5, 2023
bd2c59b
fix some tests
blotus Dec 5, 2023
1738436
merge master
blotus Dec 5, 2023
63f230b
remove hub-1.5.6 reference from github workflows
mmetc Dec 5, 2023
9b79a37
display crowdsec logs when nuclei tests fail
blotus Dec 5, 2023
0c030a3
use fmt.Printf to make it more readable
blotus Dec 5, 2023
f7c5726
minor reverts and tweaks (#2639)
mmetc Dec 5, 2023
169e39a
fix log level propagation + log requests to the appsec engine
blotus Dec 5, 2023
5503b23
up
blotus Dec 5, 2023
25635a3
propagate labels from acquis to appsec events
blotus Dec 6, 2023
00d899e
rename struct in UnmarshalConfig
blotus Dec 6, 2023
dce1f3c
lower debug here, fix logging there
buixor Dec 6, 2023
c9e4aeb
up
buixor Dec 6, 2023
0c61726
propagate request_id/runner_id in more places for logging
blotus Dec 6, 2023
fe78511
cscli: simplify generic item commands (#2641)
mmetc Dec 6, 2023
4938808
add matched zones in context for appsec alerts
blotus Dec 6, 2023
8fa84e5
cscli: generic hubappsec (#2642)
mmetc Dec 6, 2023
1515dbd
update to our main branch of our coraza fork
blotus Dec 6, 2023
b573540
Merge branch 'master' into coraza_poc_acquis
blotus Dec 7, 2023
692d96b
have a better name when matching a native rule format
blotus Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions cmd/crowdsec-cli/hubappsec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package main

import (
"fmt"
"os"

"golang.org/x/text/cases"
"golang.org/x/text/language"
"gopkg.in/yaml.v3"

"github.com/crowdsecurity/crowdsec/pkg/appsec"
"github.com/crowdsecurity/crowdsec/pkg/appsec/appsec_rule"
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
)

func NewAppsecConfigCLI() *itemCLI {
return &itemCLI{
name: cwhub.APPSEC_CONFIGS,
singular: "appsec-config",
oneOrMore: "appsec-config(s)",
help: cliHelp{
example: `cscli appsec-configs list -a
cscli appsec-configs install crowdsecurity/vpatch
cscli appsec-configs inspect crowdsecurity/vpatch
cscli appsec-configs upgrade crowdsecurity/vpatch
cscli appsec-configs remove crowdsecurity/vpatch
`,
},
installHelp: cliHelp{
example: `cscli appsec-configs install crowdsecurity/vpatch`,
},
removeHelp: cliHelp{
example: `cscli appsec-configs remove crowdsecurity/vpatch`,
},
upgradeHelp: cliHelp{
example: `cscli appsec-configs upgrade crowdsecurity/vpatch`,
},
inspectHelp: cliHelp{
example: `cscli appsec-configs inspect crowdsecurity/vpatch`,
},
listHelp: cliHelp{
example: `cscli appsec-configs list
cscli appsec-configs list -a
cscli appsec-configs list crowdsecurity/vpatch`,
},
}
}

func NewAppsecRuleCLI() *itemCLI {
inspectDetail := func(item *cwhub.Item) error {
appsecRule := appsec.AppsecCollectionConfig{}
yamlContent, err := os.ReadFile(item.State.LocalPath)
if err != nil {
return fmt.Errorf("unable to read file %s : %s", item.State.LocalPath, err)
}
if err := yaml.Unmarshal(yamlContent, &appsecRule); err != nil {
return fmt.Errorf("unable to unmarshal yaml file %s : %s", item.State.LocalPath, err)
}

for _, ruleType := range appsec_rule.SupportedTypes() {
fmt.Printf("\n%s format:\n", cases.Title(language.Und, cases.NoLower).String(ruleType))
for _, rule := range appsecRule.Rules {
convertedRule, _, err := rule.Convert(ruleType, appsecRule.Name)
if err != nil {
return fmt.Errorf("unable to convert rule %s : %s", rule.Name, err)
}
fmt.Println(convertedRule)
}
}

return nil
}

return &itemCLI{
name: "appsec-rules",
singular: "appsec-rule",
oneOrMore: "appsec-rule(s)",
help: cliHelp{
example: `cscli appsec-rules list -a
cscli appsec-rules install crowdsecurity/crs
cscli appsec-rules inspect crowdsecurity/crs
cscli appsec-rules upgrade crowdsecurity/crs
cscli appsec-rules remove crowdsecurity/crs
`,
},
installHelp: cliHelp{
example: `cscli appsec-rules install crowdsecurity/crs`,
},
removeHelp: cliHelp{
example: `cscli appsec-rules remove crowdsecurity/crs`,
},
upgradeHelp: cliHelp{
example: `cscli appsec-rules upgrade crowdsecurity/crs`,
},
inspectHelp: cliHelp{
example: `cscli appsec-rules inspect crowdsecurity/crs`,
},
inspectDetail: inspectDetail,
listHelp: cliHelp{
example: `cscli appsec-rules list
cscli appsec-rules list -a
cscli appsec-rules list crowdsecurity/crs`,
},
}
}
40 changes: 40 additions & 0 deletions cmd/crowdsec-cli/hubcollection.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
)

func NewCollectionCLI() *itemCLI {
return &itemCLI{
name: cwhub.COLLECTIONS,
singular: "collection",
oneOrMore: "collection(s)",
help: cliHelp{
example: `cscli collections list -a
cscli collections install crowdsecurity/http-cve crowdsecurity/iptables
cscli collections inspect crowdsecurity/http-cve crowdsecurity/iptables
cscli collections upgrade crowdsecurity/http-cve crowdsecurity/iptables
cscli collections remove crowdsecurity/http-cve crowdsecurity/iptables
`,
},
installHelp: cliHelp{
example: `cscli collections install crowdsecurity/http-cve crowdsecurity/iptables`,
},
removeHelp: cliHelp{
example: `cscli collections remove crowdsecurity/http-cve crowdsecurity/iptables`,
},
upgradeHelp: cliHelp{
example: `cscli collections upgrade crowdsecurity/http-cve crowdsecurity/iptables`,
},
inspectHelp: cliHelp{
example: `cscli collections inspect crowdsecurity/http-cve crowdsecurity/iptables`,
},
listHelp: cliHelp{
example: `cscli collections list
cscli collections list -a
cscli collections list crowdsecurity/http-cve crowdsecurity/iptables

List only enabled collections unless "-a" or names are specified.`,
},
}
}
40 changes: 40 additions & 0 deletions cmd/crowdsec-cli/hubparser.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
)

func NewParserCLI() *itemCLI {
return &itemCLI{
name: cwhub.PARSERS,
singular: "parser",
oneOrMore: "parser(s)",
help: cliHelp{
example: `cscli parsers list -a
cscli parsers install crowdsecurity/caddy-logs crowdsecurity/sshd-logs
cscli parsers inspect crowdsecurity/caddy-logs crowdsecurity/sshd-logs
cscli parsers upgrade crowdsecurity/caddy-logs crowdsecurity/sshd-logs
cscli parsers remove crowdsecurity/caddy-logs crowdsecurity/sshd-logs
`,
},
installHelp: cliHelp{
example: `cscli parsers install crowdsecurity/caddy-logs crowdsecurity/sshd-logs`,
},
removeHelp: cliHelp{
example: `cscli parsers remove crowdsecurity/caddy-logs crowdsecurity/sshd-logs`,
},
upgradeHelp: cliHelp{
example: `cscli parsers upgrade crowdsecurity/caddy-logs crowdsecurity/sshd-logs`,
},
inspectHelp: cliHelp{
example: `cscli parsers inspect crowdsecurity/httpd-logs crowdsecurity/sshd-logs`,
},
listHelp: cliHelp{
example: `cscli parsers list
cscli parsers list -a
cscli parsers list crowdsecurity/caddy-logs crowdsecurity/sshd-logs

List only enabled parsers unless "-a" or names are specified.`,
},
}
}
40 changes: 40 additions & 0 deletions cmd/crowdsec-cli/hubpostoverflow.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
)

func NewPostOverflowCLI() *itemCLI {
return &itemCLI{
name: cwhub.POSTOVERFLOWS,
singular: "postoverflow",
oneOrMore: "postoverflow(s)",
help: cliHelp{
example: `cscli postoverflows list -a
cscli postoverflows install crowdsecurity/cdn-whitelist crowdsecurity/rdns
cscli postoverflows inspect crowdsecurity/cdn-whitelist crowdsecurity/rdns
cscli postoverflows upgrade crowdsecurity/cdn-whitelist crowdsecurity/rdns
cscli postoverflows remove crowdsecurity/cdn-whitelist crowdsecurity/rdns
`,
},
installHelp: cliHelp{
example: `cscli postoverflows install crowdsecurity/cdn-whitelist crowdsecurity/rdns`,
},
removeHelp: cliHelp{
example: `cscli postoverflows remove crowdsecurity/cdn-whitelist crowdsecurity/rdns`,
},
upgradeHelp: cliHelp{
example: `cscli postoverflows upgrade crowdsecurity/cdn-whitelist crowdsecurity/rdns`,
},
inspectHelp: cliHelp{
example: `cscli postoverflows inspect crowdsecurity/cdn-whitelist crowdsecurity/rdns`,
},
listHelp: cliHelp{
example: `cscli postoverflows list
cscli postoverflows list -a
cscli postoverflows list crowdsecurity/cdn-whitelist crowdsecurity/rdns

List only enabled postoverflows unless "-a" or names are specified.`,
},
}
}
40 changes: 40 additions & 0 deletions cmd/crowdsec-cli/hubscenario.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
)

func NewScenarioCLI() *itemCLI {
return &itemCLI{
name: cwhub.SCENARIOS,
singular: "scenario",
oneOrMore: "scenario(s)",
help: cliHelp{
example: `cscli scenarios list -a
cscli scenarios install crowdsecurity/ssh-bf crowdsecurity/http-probing
cscli scenarios inspect crowdsecurity/ssh-bf crowdsecurity/http-probing
cscli scenarios upgrade crowdsecurity/ssh-bf crowdsecurity/http-probing
cscli scenarios remove crowdsecurity/ssh-bf crowdsecurity/http-probing
`,
},
installHelp: cliHelp{
example: `cscli scenarios install crowdsecurity/ssh-bf crowdsecurity/http-probing`,
},
removeHelp: cliHelp{
example: `cscli scenarios remove crowdsecurity/ssh-bf crowdsecurity/http-probing`,
},
upgradeHelp: cliHelp{
example: `cscli scenarios upgrade crowdsecurity/ssh-bf crowdsecurity/http-probing`,
},
inspectHelp: cliHelp{
example: `cscli scenarios inspect crowdsecurity/ssh-bf crowdsecurity/http-probing`,
},
listHelp: cliHelp{
example: `cscli scenarios list
cscli scenarios list -a
cscli scenarios list crowdsecurity/ssh-bf crowdsecurity/http-probing

List only enabled scenarios unless "-a" or names are specified.`,
},
}
}
Loading
Loading