Skip to content

Commit

Permalink
Add containerd related flags
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Krum <nibz@spencerkrum.com>

sysdig-CLA-1.0-contributing-entity: International Business Machines
sysdig-CLA-1.0-signed-off-by: Spencer Krum <skrum@us.ibm.com>
  • Loading branch information
nibalizer committed Apr 25, 2019
1 parent 05bb4a8 commit c186fba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions userspace/falco/falco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ static void usage()
" -A Monitor all events, including those with EF_DROP_FALCO flag.\n"
" -b, --print-base64 Print data buffers in base64. This is useful for encoding\n"
" binary data that needs to be used over media designed to\n"
" --cri <path> Path to CRI socket for container meatadata\n"
" Use the specified socket to fetch data from a CRI-compatible runtime\n"
" -d, --daemon Run as a daemon\n"
" -D <pattern> Disable any rules matching the regex <pattern>. Can be specified multiple times.\n"
" Can not be specified with -t.\n"
Expand Down Expand Up @@ -425,6 +427,7 @@ int falco_init(int argc, char **argv)
bool list_flds = false;
string list_flds_source = "";
bool print_support = false;
string cri_socket_path;

// Used for writing trace files
int duration_seconds = 0;
Expand Down Expand Up @@ -604,6 +607,10 @@ int falco_init(int argc, char **argv)
printf("falco version %s\n", FALCO_VERSION);
return EXIT_SUCCESS;
}
else if (string(long_options[long_index].name) == "cri")
{
cri_socket_path = optarg;
}
else if (string(long_options[long_index].name) == "list")
{
list_flds = true;
Expand Down Expand Up @@ -631,6 +638,12 @@ int falco_init(int argc, char **argv)
inspector = new sinsp();
inspector->set_buffer_format(event_buffer_format);

// If required, set the CRI path
if(!cri_socket_path.empty())
{
inspector->set_cri_socket_path(cri_socket_path);
}

//
// If required, set the snaplen
//
Expand Down

0 comments on commit c186fba

Please sign in to comment.