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

[ASM] Restrict RASP Lfi operations to read operation only #6221

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,28 +349,15 @@ internal static partial class AspectDefinitions
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::CreateText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Delete(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenRead(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenWrite(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllBytes(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllLines(System.String,System.Collections.Generic.IEnumerable`1<System.String>)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllLines(System.String,System.Collections.Generic.IEnumerable`1<System.String>,System.Text.Encoding)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllText(System.String,System.String)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllText(System.String,System.String,System.Text.Encoding)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String,System.Int32)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String,System.Int32,System.IO.FileOptions)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String,System.Int32,System.IO.FileOptions,System.Security.AccessControl.FileSecurity)\",\"\",[3],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)\",\"\",[3],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::SetAttributes(System.String,System.IO.FileAttributes)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::WriteAllBytes(System.String,System.Byte[])\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::WriteAllLines(System.String,System.String[])\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
Expand All @@ -384,6 +371,19 @@ internal static partial class AspectDefinitions
" [AspectMethodInsertBefore(\"System.IO.File::Move(System.String,System.String)\",\"\",[0,1],[False,False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Replace(System.String,System.String,System.String)\",\"\",[0,1,2],[False,False,False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Replace(System.String,System.String,System.String,System.Boolean)\",\"\",[1,2,3],[False,False,False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess)\",\"\",[2],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)\",\"\",[3],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllBytes(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenRead(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
"[AspectClass(\"mscorlib,System.IO.FileSystem,System.Runtime\",[None],Sink,[PathTraversal])] Datadog.Trace.Iast.Aspects.FileInfoAspect",
" [AspectMethodInsertBefore(\"System.IO.FileInfo::.ctor(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.FileInfo::CopyTo(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
Expand Down Expand Up @@ -742,28 +742,15 @@ internal static partial class AspectDefinitions
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::CreateText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Delete(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenRead(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenWrite(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllBytes(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllLines(System.String,System.Collections.Generic.IEnumerable`1<System.String>)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllLines(System.String,System.Collections.Generic.IEnumerable`1<System.String>,System.Text.Encoding)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllText(System.String,System.String)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendAllText(System.String,System.String,System.Text.Encoding)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::AppendText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String,System.Int32)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String,System.Int32,System.IO.FileOptions)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Create(System.String,System.Int32,System.IO.FileOptions,System.Security.AccessControl.FileSecurity)\",\"\",[3],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess)\",\"\",[2],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)\",\"\",[3],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::SetAttributes(System.String,System.IO.FileAttributes)\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::WriteAllBytes(System.String,System.Byte[])\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::WriteAllLines(System.String,System.String[])\",\"\",[1],[False],[None],Default,[])] ReviewPath(System.String)",
Expand All @@ -777,6 +764,19 @@ internal static partial class AspectDefinitions
" [AspectMethodInsertBefore(\"System.IO.File::Move(System.String,System.String)\",\"\",[0,1],[False,False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Replace(System.String,System.String,System.String)\",\"\",[0,1,2],[False,False,False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Replace(System.String,System.String,System.String,System.Boolean)\",\"\",[1,2,3],[False,False,False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess)\",\"\",[2],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::Open(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)\",\"\",[3],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllBytes(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllLines(System.String,System.Text.Encoding)\",\"\",[1],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadAllText(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::ReadLines(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
" [AspectMethodInsertBefore(\"System.IO.File::OpenRead(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPathRead(System.String)",
"[AspectClass(\"mscorlib,System.IO.FileSystem,System.Runtime\",[None],Sink,[PathTraversal])] Datadog.Trace.Iast.Aspects.FileInfoAspect",
" [AspectMethodInsertBefore(\"System.IO.FileInfo::.ctor(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
" [AspectMethodInsertBefore(\"System.IO.FileInfo::CopyTo(System.String)\",\"\",[0],[False],[None],Default,[])] ReviewPath(System.String)",
Expand Down
Loading
Loading