You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I deploy a filtered filename monitoring namespace scoped policy in Tetragon v1.0.0, it does not generate Tetragon events for long file paths. However, this bug does not exist in Tetragon v0.11.0.
Bug Repro steps for Tetragon v1.0.0
Deploy Tetragon v1.0.0 with enablePolicyFilter set to true.
kubectl run debugpod --image=golang -i --tty -- /bin/bash
apt update
apt install vim
vim test_script.sh
# Paste the following content in test_script.sh#!/bin/bash# Function to create directory and filecreate_dir_and_file() {
local dir_path=$1local file_num=$2# Create directory
mkdir -p "$dir_path"echo"Directory created: $dir_path"# Create file with content "test"echo"test">"$dir_path/$file_num.txt"echo"File created: $dir_path/$file_num.txt"
}
# Function to delete created directories and filesdelete_dir() {
local dir_path=$1echo"Deleting: $dir_path"
rm -rf "$dir_path"
}
# Main script starts here# Check if a path is providedif [ -z"$1" ];thenecho"No path provided. Exiting."exit 1
fi
input_path=$1
current_path=""
counter=1
# Split path and iterate over each part
IFS='/'read -ra ADDR <<<"$input_path"foriin"${ADDR[@]}";do# Skip empty elementsif [ -z"$i" ];thencontinuefi# Construct the current path
current_path="$current_path/$i"
create_dir_and_file "$current_path"$counterlet counter+=1
done# Deleting created directories and files in reverse orderfor(( j=counter-1; j>=1; j--));do
dir_to_delete=$(dirname "$current_path")
delete_dir "$dir_to_delete"
current_path="$dir_to_delete"doneecho"All created directories and files have been deleted."
In another bash console, run tetra to observe Tetragon events
In the test pod, run test_script.sh. This script progressively creates directories based on the path input and creates a file inside. For example, if you pass "/rootdirtomonitor/firstdir/seconddir/thirddir" to the script, it would create /rootdirtomonitor dir, /rootdirtomonitor/1.txt file, /rootdirtomonitor/firstdir dir, /rootdirtomonitor/firstdir/2.txt file, /rootdirtomonitor/firstdir/seconddir dir, /rootdirtomonitor/firstdir/seconddir/3.txt file, and so on.
In tetra console window, you would observed that Tetragon does not catch file write events after a particular length. For me, it stopped after .../homedr/_work/ directory as shown by 📝 write events below.
Repeat steps 2 to 6. You would see all Tetragon events this time in tetra console window (unlike Tetragon v1.0.0, you would see write events for 11.txt, 12.txt and 13.txt). For me, it produced the following output:
This bug exists only in v1.0.0. The events are generated as expected in v0.11.
Kernel Version
I reproed the issue on an AWS EKS cluster.
Linux ip-10-0-55-186.us-west-2.compute.internal 5.10.198-187.748.amzn2.x86_64 #1 SMP Tue Oct 24 19:49:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Kubernetes Version
kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3", GitCommit:"25b4e43193bcda6c7328a6d147b1fb73a33f1598", GitTreeState:"clean", BuildDate:"2023-06-14T09:47:38Z", GoVersion:"go1.20.5", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"28+", GitVersion:"v1.28.3-eks-4f4795d", GitCommit:"e77944ea667aee90c84c48a74a2a0da7a23e0508", GitTreeState:"clean", BuildDate:"2023-10-20T23:21:39Z", GoVersion:"go1.20.10", Compiler:"gc", Platform:"linux/amd64"}
Bugtool
No response
Relevant log output
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
The prefix provided in the policy is shorter than the max prefix length, so the policy was accepted as usual. It also worked fine for paths shorter than the max prefix length. Where it failed, was when the actual path accessed was longer than the max prefix length – i.e. a runtime issue, not a policy loading issue. I'll make a PR that addresses this.
What happened?
When I deploy a filtered filename monitoring namespace scoped policy in Tetragon v1.0.0, it does not generate Tetragon events for long file paths. However, this bug does not exist in Tetragon v0.11.0.
Bug Repro steps for Tetragon v1.0.0
enablePolicyFilter
set to true.cat tetragon_values.yaml tetragon: enablePolicyFilter: "true" helm install tetragon cilium/tetragon -n kube-system -f tetragon_values.yaml
default
namespacetetra
to observe Tetragon eventskubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact -n default
/rootdirtomonitor
dir,/rootdirtomonitor/1.txt
file,/rootdirtomonitor/firstdir
dir,/rootdirtomonitor/firstdir/2.txt
file,/rootdirtomonitor/firstdir/seconddir
dir,/rootdirtomonitor/firstdir/seconddir/3.txt
file, and so on.tetra
console window, you would observed that Tetragon does not catch file write events after a particular length. For me, it stopped after.../homedr/_work/
directory as shown by 📝 write events below.Please follow these steps to confirm that the bug does not exist in Tetragon v0.11.0
7. Uninstall Tetragon v1.0.0 and install Tetragon v0.11.0
tetra
console window (unlike Tetragon v1.0.0, you would see write events for11.txt
,12.txt
and13.txt
). For me, it produced the following output:Tetragon Version
This bug exists only in v1.0.0. The events are generated as expected in v0.11.
Kernel Version
I reproed the issue on an AWS EKS cluster.
Linux ip-10-0-55-186.us-west-2.compute.internal 5.10.198-187.748.amzn2.x86_64 #1 SMP Tue Oct 24 19:49:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Kubernetes Version
kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3", GitCommit:"25b4e43193bcda6c7328a6d147b1fb73a33f1598", GitTreeState:"clean", BuildDate:"2023-06-14T09:47:38Z", GoVersion:"go1.20.5", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"28+", GitVersion:"v1.28.3-eks-4f4795d", GitCommit:"e77944ea667aee90c84c48a74a2a0da7a23e0508", GitTreeState:"clean", BuildDate:"2023-10-20T23:21:39Z", GoVersion:"go1.20.10", Compiler:"gc", Platform:"linux/amd64"}
Bugtool
No response
Relevant log output
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: