libs icon indicating copy to clipboard operation
libs copied to clipboard

Add euid to execve/execveat exit events

Open gnosek opened this issue 2 years ago • 3 comments

We can't prevent losing setuid events completely and the uid is pretty important for some execve-related rules, so explicitly pass the uid in execve/at exit events

Signed-off-by: Grzegorz Nosek [email protected] Co-authored-by: Angelo Puglisi [email protected]

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-udig

/area libscap

/area libsinsp

/area tests

/area proposals

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

gnosek avatar Jun 10 '22 12:06 gnosek

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnosek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

poiana avatar Jun 10 '22 12:06 poiana

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

poiana avatar Sep 18 '22 21:09 poiana

/remove-lifecycle stale

Andreagit97 avatar Sep 19 '22 11:09 Andreagit97

/milestone 0.11.0

FedeDP avatar Dec 02 '22 13:12 FedeDP

Marking as wip since we need to handle modern_bpf as well

gnosek avatar Dec 05 '22 19:12 gnosek

The PR looks good but we still need to address the ARM workaround tracepoints for all the 3 drivers, this is the bpf one :point_down: https://github.com/falcosecurity/libs/blob/c1d075ffda41dcbdeec0a9fee86f288b7b360d19/driver/bpf/fillers.h#L6142

Andreagit97 avatar Dec 08 '22 13:12 Andreagit97

@Andreagit97 everything should be in there now

gnosek avatar Dec 12 '22 18:12 gnosek

LGTM label has been added.

Git tree hash: eca6c922b16a487571f286ba35f11a7d2c3ff122

poiana avatar Dec 13 '22 08:12 poiana

/hold for the release

Andreagit97 avatar Dec 13 '22 13:12 Andreagit97

/unhold

Andreagit97 avatar Dec 19 '22 12:12 Andreagit97

@incertum, @Andreagit97: I rebased the PR, care to take a look?

could we double-check this and cleanup if we don't support <2.6.20?

Looks like we still have <2.6.20 checks so I'd rather remove them all in a separate PR. I don't know if we actually run on <2.6.20 any more but I'd rather not break it on purpose in one place.

gnosek avatar Feb 07 '23 06:02 gnosek

/hold

gnosek avatar Feb 07 '23 06:02 gnosek

Hmm just noticed that the PT_ABSTIME patch that went in in #789 was slightly different so we still have a commit here:

commit 841bd9fd4fb5850a913a38c53b5b0dd4f1e5f8e1
Author: Grzegorz Nosek <[email protected]>
Date:   Wed Dec 7 19:11:27 2022 +0100

    fix(sinsp): format PT_ABSTIME values

    Signed-off-by: Grzegorz Nosek <[email protected]>

diff --git a/userspace/libsinsp/event.cpp b/userspace/libsinsp/event.cpp
index 4dd490e92..69ed1110b 100644
--- a/userspace/libsinsp/event.cpp
+++ b/userspace/libsinsp/event.cpp
@@ -1425,7 +1425,6 @@ Json::Value sinsp_evt::get_param_as_json(uint32_t id, OUT const char** resolved_
                        break;
                }
        case PT_DYN:
-               ASSERT(false);
                snprintf(&m_paramstr_storage[0],
                         m_paramstr_storage.size(),
                         "INVALID DYNAMIC PARAMETER");

Do we want this? @Andreagit97 @incertum (probably with a better commit message if so)

gnosek avatar Feb 07 '23 06:02 gnosek

@gnosek re above question we probably don't need this commit in this PR, ty.

incertum avatar Feb 07 '23 07:02 incertum

Thanks @incertum, dropped the patch.

/unhold

gnosek avatar Feb 07 '23 07:02 gnosek

LGTM label has been added.

Git tree hash: faa1e94d78b3537617e504bce3adc17083f54aa9

poiana avatar Feb 07 '23 08:02 poiana

/hold

FedeDP avatar Feb 07 '23 08:02 FedeDP

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, gnosek, hbrueckner, incertum

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [Andreagit97,FedeDP,gnosek,incertum]

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

poiana avatar Feb 07 '23 08:02 poiana

/unhold

Andreagit97 avatar Feb 07 '23 08:02 Andreagit97