11# The Code42 CLI
22
33Use the ` code42 ` command to interact with your Code42 environment.
4- ` code42 securitydata ` is a CLI tool for extracting AED events.
4+ ` code42 security-data ` is a CLI tool for extracting AED events.
55Additionally, you can choose to only get events that Code42 previously did not observe since you last recorded a checkpoint
66(provided you do not change your query).
77
@@ -45,7 +45,7 @@ You can add multiple profiles with different names and the change the default pr
4545code42 profile use MY_SECOND_PROFILE
4646```
4747
48- When the ` --profile ` flag is available on other commands, such as those in ` securitydata ` , it will use that profile instead of the default one.
48+ When the ` --profile ` flag is available on other commands, such as those in ` security-data ` , it will use that profile instead of the default one.
4949
5050To see all your profiles, do:
5151
@@ -61,72 +61,72 @@ Using the CLI, you can query for events and send them to three possible destinat
6161To print events to stdout, do:
6262
6363``` bash
64- code42 securitydata print -b 2020-02-02
64+ code42 security-data print -b 2020-02-02
6565```
6666
6767Note that ` -b ` or ` --begin ` is usually required.
6868To specify a time, do:
6969
7070``` bash
71- code42 securitydata print -b 2020-02-02 12:51
71+ code42 security-data print -b 2020-02-02 12:51
7272```
7373
7474Begin date will be ignored if provided on subsequent queries using ` -i ` .
7575
7676Use different format with ` -f ` :
7777
7878``` bash
79- code42 securitydata print -b 2020-02-02 -f CEF
79+ code42 security-data print -b 2020-02-02 -f CEF
8080```
8181
8282The available formats are CEF, JSON, and RAW-JSON.
8383
8484To write events to a file, do:
8585
8686``` bash
87- code42 securitydata write-to filename.txt -b 2020-02-02
87+ code42 security-data write-to filename.txt -b 2020-02-02
8888```
8989
9090To send events to a server, do:
9191
9292``` bash
93- code42 securitydata send-to syslog.company.com -p TCP -b 2020-02-02
93+ code42 security-data send-to syslog.company.com -p TCP -b 2020-02-02
9494```
9595
9696To only get events that Code42 previously did not observe since you last recorded a checkpoint, use the ` -i ` flag.
9797
9898``` bash
99- code42 securitydata send-to syslog.company.com -i
99+ code42 security-data send-to syslog.company.com -i
100100```
101101
102102This is only guaranteed if you did not change your query.
103103
104104To send events to a server using a specific profile, do:
105105
106106``` bash
107- code42 securitydata send-to --profile PROFILE_FOR_RECURRING_JOB syslog.company.com -b 2020-02-02 -f CEF -i
107+ code42 security-data send-to --profile PROFILE_FOR_RECURRING_JOB syslog.company.com -b 2020-02-02 -f CEF -i
108108```
109109
110110You can also use wildcard for queries, but note, if they are not in quotes, you may get unexpected behavior.
111111
112112``` bash
113- code42 securitydata print --actor " *"
113+ code42 security-data print --actor " *"
114114```
115115
116116Each destination-type subcommand shares query parameters
117117
118118- ` -t ` (exposure types)
119119- ` -b ` (begin date)
120120- ` -e ` (end date)
121- - ` --c42username `
121+ - ` --c42-username `
122122- ` --actor `
123123- ` --md5 `
124124- ` --sha256 `
125125- ` --source `
126- - ` --filename `
127- - ` --filepath `
128- - ` --processOwner `
129- - ` --tabURL `
126+ - ` --file-name `
127+ - ` --file-path `
128+ - ` --process-owner `
129+ - ` --tab-url `
130130- ` --include-non-exposure ` (does not work with ` -t ` )
131131- ` --advanced-query ` (raw JSON query)
132132
0 commit comments