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

add test for security_path_rmdir #938

Merged
merged 1 commit into from Oct 14, 2022

Conversation

achrefbensaad
Copy link
Member

Signed-off-by: Achref ben saad achref@accuknox.com

@codecov-commenter
Copy link

Codecov Report

Merging #938 (290188e) into main (742834c) will decrease coverage by 0.46%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #938      +/-   ##
==========================================
- Coverage   39.45%   38.99%   -0.47%     
==========================================
  Files          31       31              
  Lines        9838     9838              
==========================================
- Hits         3882     3836      -46     
- Misses       5450     5492      +42     
- Partials      506      510       +4     
Impacted Files Coverage Δ
KubeArmor/core/containerdHandler.go 57.67% <0.00%> (-11.24%) ⬇️
KubeArmor/monitor/logUpdate.go 66.85% <0.00%> (-2.79%) ⬇️
KubeArmor/core/dockerHandler.go 44.78% <0.00%> (-2.70%) ⬇️
KubeArmor/monitor/processTree.go 94.62% <0.00%> (-1.08%) ⬇️
KubeArmor/feeder/policyMatcher.go 41.95% <0.00%> (+0.34%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@daemon1024
Copy link
Member

if ! $SUDO ./syscheck $1 ; then
    echo "Disabling $SYSCALL ..."
    echo "$SYSCALL" >> ignore.lst
else
    echo "Enabling syscall $SYSCALL"
    grep "// CFlag=.*$" "$1.c" | sed -E "s/.*?=(.*?)$/\1/" >> cflags.lst
fi

I believe this is the relevant code.
I think We shouldn't have tests like this, like needing to check and every syscall to ignore.lst.
Any bpf program is dependent on a certain kernel features.

Adding a test for each one won't make sense. As we proceed we might need to add 10 more hooks that are related to SECURITY_PATH flag. But in that case we would need to add 10 more test cases here right?

Ignore list check should be based on flags rather than tests for each syscall. WDYT?

Signed-off-by: Achref ben saad <achref@accuknox.com>
@achrefbensaad
Copy link
Member Author

@daemon1024 , I agree. Changes has been made.

@daemon1024 daemon1024 merged commit b0a6a89 into kubearmor:main Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants