Skip to content

Commit

Permalink
Updates Falco to upstream 0.15.0 tag (#1608)
Browse files Browse the repository at this point in the history
Some minor changes are included in Collector, where APIs or type have changed
between versions.
  • Loading branch information
Stringy authored Apr 16, 2024
1 parent f14877b commit ddcf390
Show file tree
Hide file tree
Showing 22 changed files with 236 additions and 119 deletions.
1 change: 0 additions & 1 deletion .github/workflows/collector-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ jobs:
echo "rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}"
echo "rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}"
echo "collector_git_ref: ${{ github.ref }}"
echo "collector_git_sha: ${{ github.sha }}"
echo "collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }}"
} > ${{ github.workspace }}/ansible/secrets.yml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/collector-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}
collector_git_ref: ${{ github.ref }}
collector_git_sha: ${{ github.sha }}
collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }}
disable_profiling: ${{ matrix.arch != 'amd64' && matrix.arch != 'arm64' }}
rhacs_eng_image: ${{ env.RHACS_ENG_IMAGE }}
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
[submodule "third_party/libbpf"]
path = builder/third_party/libbpf
url = https://github.com/libbpf/libbpf
branch = v1.1.0
branch = v1.3.0
[submodule "builder/third_party/gperftools"]
path = builder/third_party/gperftools
url = https://github.com/gperftools/gperftools.git
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ ifneq ($(BUILD_BUILDER_IMAGE), false)
-t quay.io/stackrox-io/collector-builder:$(COLLECTOR_BUILDER_TAG) \
-f "$(CURDIR)/builder/Dockerfile" \
"$(CURDIR)/builder"
else
docker pull --platform ${PLATFORM} quay.io/stackrox-io/collector-builder:$(COLLECTOR_BUILDER_TAG)
endif

collector: check-builder
Expand Down Expand Up @@ -111,6 +109,8 @@ endif
start-builder: builder teardown-builder
docker run -d \
--name $(COLLECTOR_BUILDER_NAME) \
--pull missing \
--platform ${PLATFORM} \
-v $(CURDIR):$(CURDIR) \
$(if $(LOCAL_SSH_PORT),-p $(LOCAL_SSH_PORT):22 )\
-w $(CURDIR) \
Expand Down
8 changes: 6 additions & 2 deletions ansible/ci-build-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@

vars:
collector_root: "{{ ansible_env.HOME }}/collector"
local_branch: local

tasks:
- name: Clone repository
ansible.builtin.git:
repo: https://github.com/stackrox/collector
dest: "{{ collector_root }}"
version: "{{ collector_git_sha }}"
refspec: "+{{ collector_git_ref | replace('refs/', '') }}"
# We fetch the ref (either master, or pull/<ID>/merge) and then
# create a local branch based on that. Doing it this way, rather
# than with commit hashes, prevents "reference is not a tree" errors
version: "{{ local_branch }}"
refspec: "+{{ collector_git_ref | replace('refs/', '') }}:{{ local_branch }}"
recursive: true
when: arch == "s390x"

Expand Down
8 changes: 6 additions & 2 deletions ansible/ci-build-collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@

vars:
collector_root: "{{ ansible_env.HOME }}/collector"
local_branch: local

tasks:
- debug: var=collector_root
- name: Clone repository
ansible.builtin.git:
repo: https://github.com/stackrox/collector
dest: "{{ collector_root }}"
version: "{{ collector_git_sha }}"
refspec: "+{{ collector_git_ref | replace('refs/', '') }}"
# We fetch the ref (either master, or pull/<ID>/merge) and then
# create a local branch based on that. Doing it this way, rather
# than with commit hashes, prevents "reference is not a tree" errors
version: "{{ local_branch }}"
refspec: "+{{ collector_git_ref | replace('refs/', '') }}:{{ local_branch }}"
recursive: true
when: arch == "s390x"

Expand Down
2 changes: 1 addition & 1 deletion builder/third_party/libbpf
Submodule libbpf updated 51 files
+1 −0 .gitattributes
+3 −0 .github/PULL_REQUEST_TEMPLATE.md
+1 −0 .github/actions/build-selftests/build_selftests.sh
+84,207 −143,586 .github/actions/build-selftests/vmlinux.h
+2 −0 .github/actions/vmtest/action.yml
+16 −0 .github/workflows/test.yml
+6 −2 .readthedocs.yaml
+1 −1 BPF-CHECKPOINT-COMMIT
+1 −1 CHECKPOINT-COMMIT
+0 −70 ci/diffs/0001-s390-define-RUNTIME_DISCARD_EXIT-to-fix-link-error-w.patch
+0 −46 ci/diffs/0001-selftests-bpf-Select-CONFIG_FUNCTION_ERROR_INJECTION.patch
+89 −0 ci/diffs/0001-selftests-bpf-xskxceiver-ksft_print_msg-fix-format-t.patch
+0 −4 ci/vmtest/configs/ALLOWLIST-5.5.0
+2 −115 ci/vmtest/configs/DENYLIST-5.5.0
+8 −0 ci/vmtest/configs/DENYLIST-latest
+1 −0 ci/vmtest/configs/DENYLIST-latest.s390x
+10 −3 ci/vmtest/run_selftests.sh
+1 −0 docs/conf.py
+10 −0 docs/program_types.rst
+2 −1 docs/sphinx/requirements.txt
+251 −40 include/uapi/linux/bpf.h
+6 −0 include/uapi/linux/fcntl.h
+142 −0 include/uapi/linux/if_link.h
+9 −0 include/uapi/linux/if_xdp.h
+22 −2 include/uapi/linux/netdev.h
+2 −1 include/uapi/linux/perf_event.h
+4 −3 scripts/build-fuzzers.sh
+6 −3 src/Makefile
+147 −49 src/bpf.c
+138 −21 src/bpf.h
+27 −9 src/bpf_helper_defs.h
+114 −5 src/bpf_helpers.h
+3 −4 src/bpf_tracing.h
+161 −1 src/btf.c
+19 −3 src/btf_dump.c
+559 −0 src/elf.c
+7 −7 src/gen_loader.c
+0 −10 src/hashmap.h
+986 −314 src/libbpf.c
+190 −3 src/libbpf.h
+18 −0 src/libbpf.map
+19 −0 src/libbpf_common.h
+21 −0 src/libbpf_internal.h
+4 −1 src/libbpf_probes.c
+1 −1 src/libbpf_version.h
+13 −1 src/linker.c
+5 −0 src/netlink.c
+1 −1 src/relo_core.c
+72 −13 src/ringbuf.c
+2 −2 src/usdt.bpf.h
+85 −41 src/usdt.c
2 changes: 1 addition & 1 deletion collector/lib/ContainerMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ContainerMetadata {
}

inline std::string GetContainerLabel(const std::string& container_id, const std::string& label) {
const auto containers = inspector_->m_container_manager.get_containers();
auto containers = inspector_->m_container_manager.get_containers();
const auto& container = containers->find(container_id);
if (container == containers->end()) {
return "";
Expand Down
4 changes: 2 additions & 2 deletions collector/lib/system-inspector/EventExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace collector::system_inspector {

void EventExtractor::Init(sinsp* inspector) {
for (auto* wrapper : wrappers_) {
sinsp_filter_check* check = g_filterlist.new_filter_check_from_fldname(wrapper->event_name, inspector, true);
std::unique_ptr<sinsp_filter_check> check = FilterList().new_filter_check_from_fldname(wrapper->event_name, inspector, true);
check->parse_field_name(wrapper->event_name, true, false);
wrapper->filter_check.reset(check);
wrapper->filter_check.reset(check.release());
}
}

Expand Down
5 changes: 5 additions & 0 deletions collector/lib/system-inspector/EventExtractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class EventExtractor {
void Init(sinsp* inspector);
void ClearWrappers();

static sinsp_filter_check_list& FilterList() {
static sinsp_filter_check_list filterlist;
return filterlist;
}

private:
struct FilterCheckWrapper {
FilterCheckWrapper(EventExtractor* extractor, const char* event_name) : event_name(event_name) {
Expand Down
5 changes: 3 additions & 2 deletions collector/lib/system-inspector/Service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool Service::InitKernel(const CollectorConfig& config, const DriverCandidate& c

inspector_->set_import_users(config.ImportUsers());
inspector_->set_thread_timeout_s(30);
inspector_->set_thread_purge_interval_s(60);
inspector_->set_auto_threads_purging_interval_s(60);
inspector_->m_thread_manager->set_max_thread_table_size(config.GetSinspThreadCacheSize());

// Connection status tracking is used in NetworkSignalHandler,
Expand Down Expand Up @@ -119,7 +119,8 @@ bool Service::InitKernel(const CollectorConfig& config, const DriverCandidate& c
inspector_->set_filter("container.id != 'host'");

default_formatter_.reset(new sinsp_evt_formatter(inspector_.get(),
DEFAULT_OUTPUT_STR));
DEFAULT_OUTPUT_STR,
EventExtractor::FilterList()));
}

std::unique_ptr<IKernelDriver> driver;
Expand Down
Loading

0 comments on commit ddcf390

Please sign in to comment.