Skip to content

C#: Add local filesystem writes as External Location sinks #12658

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

Merged
merged 9 commits into from
Apr 25, 2023

Conversation

joefarebrother
Copy link
Contributor

Adds sinks for local filesystem writes to ExternalLocationSink (used by the cs/cleartext-storage and cs/exposure-of-sensitive-information queries).

@github-actions github-actions bot added the C# label Mar 24, 2023
@joefarebrother joefarebrother force-pushed the csharp-sensitive-data branch from b67c8f1 to 37f1770 Compare April 5, 2023 12:57
@joefarebrother joefarebrother marked this pull request as ready for review April 5, 2023 13:43
@joefarebrother joefarebrother requested a review from a team as a code owner April 5, 2023 13:43
@joefarebrother joefarebrother changed the title [Draft] C#: Add local filesystem writes as External Location sinks C#: Add local filesystem writes as External Location sinks Apr 5, 2023
@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

csharp

Generated file changes for csharp

  • Changes to framework-coverage-csharp.rst:
-    System,"``System.*``, ``System``",8,12154,65,7
+    System,"``System.*``, ``System``",18,12154,65,7
-    Totals,,8,12717,397,7
+    Totals,,18,12717,397,7
  • Changes to framework-coverage-csharp.csv:
- package,sink,source,summary,sink:code,sink:encryption-decryptor,sink:encryption-encryptor,sink:encryption-keyprop,sink:encryption-symmetrickey,sink:html,sink:remote,sink:sql,sink:xss,source:file,source:local,source:remote,summary:taint,summary:value
+ package,sink,source,summary,sink:code,sink:encryption-decryptor,sink:encryption-encryptor,sink:encryption-keyprop,sink:encryption-symmetrickey,sink:html,sink:remote,sink:sql,sink:xss,source:file,source:file-write,source:local,source:remote,summary:taint,summary:value
- Dapper,55,,,,,,,,,,55,,,,,,
+ Dapper,55,,,,,,,,,,55,,,,,,,
- JsonToItemsTaskFactory,,,7,,,,,,,,,,,,,7,
+ JsonToItemsTaskFactory,,,7,,,,,,,,,,,,,,7,
- Microsoft.ApplicationBlocks.Data,28,,,,,,,,,,28,,,,,,
+ Microsoft.ApplicationBlocks.Data,28,,,,,,,,,,28,,,,,,,
- Microsoft.CSharp,,,24,,,,,,,,,,,,,24,
+ Microsoft.CSharp,,,24,,,,,,,,,,,,,,24,
- Microsoft.EntityFrameworkCore,6,,,,,,,,,,6,,,,,,
+ Microsoft.EntityFrameworkCore,6,,,,,,,,,,6,,,,,,,
- Microsoft.Extensions.Caching.Distributed,,,15,,,,,,,,,,,,,15,
+ Microsoft.Extensions.Caching.Distributed,,,15,,,,,,,,,,,,,,15,
- Microsoft.Extensions.Caching.Memory,,,46,,,,,,,,,,,,,45,1
+ Microsoft.Extensions.Caching.Memory,,,46,,,,,,,,,,,,,,45,1
- Microsoft.Extensions.Configuration,,,83,,,,,,,,,,,,,80,3
+ Microsoft.Extensions.Configuration,,,83,,,,,,,,,,,,,,80,3
- Microsoft.Extensions.DependencyInjection,,,62,,,,,,,,,,,,,62,
+ Microsoft.Extensions.DependencyInjection,,,62,,,,,,,,,,,,,,62,
- Microsoft.Extensions.DependencyModel,,,12,,,,,,,,,,,,,12,
+ Microsoft.Extensions.DependencyModel,,,12,,,,,,,,,,,,,,12,
- Microsoft.Extensions.FileProviders,,,16,,,,,,,,,,,,,16,
+ Microsoft.Extensions.FileProviders,,,16,,,,,,,,,,,,,,16,
- Microsoft.Extensions.FileSystemGlobbing,,,15,,,,,,,,,,,,,13,2
+ Microsoft.Extensions.FileSystemGlobbing,,,15,,,,,,,,,,,,,,13,2
- Microsoft.Extensions.Hosting,,,17,,,,,,,,,,,,,16,1
+ Microsoft.Extensions.Hosting,,,17,,,,,,,,,,,,,,16,1
- Microsoft.Extensions.Http,,,10,,,,,,,,,,,,,10,
+ Microsoft.Extensions.Http,,,10,,,,,,,,,,,,,,10,
- Microsoft.Extensions.Logging,,,37,,,,,,,,,,,,,37,
+ Microsoft.Extensions.Logging,,,37,,,,,,,,,,,,,,37,
- Microsoft.Extensions.Options,,,8,,,,,,,,,,,,,8,
+ Microsoft.Extensions.Options,,,8,,,,,,,,,,,,,,8,
- Microsoft.Extensions.Primitives,,,63,,,,,,,,,,,,,63,
+ Microsoft.Extensions.Primitives,,,63,,,,,,,,,,,,,,63,
- Microsoft.Interop,,,27,,,,,,,,,,,,,27,
+ Microsoft.Interop,,,27,,,,,,,,,,,,,,27,
- Microsoft.NET.Build.Tasks,,,1,,,,,,,,,,,,,1,
+ Microsoft.NET.Build.Tasks,,,1,,,,,,,,,,,,,,1,
- Microsoft.NETCore.Platforms.BuildTasks,,,4,,,,,,,,,,,,,4,
+ Microsoft.NETCore.Platforms.BuildTasks,,,4,,,,,,,,,,,,,,4,
- Microsoft.VisualBasic,,,10,,,,,,,,,,,,,5,5
+ Microsoft.VisualBasic,,,10,,,,,,,,,,,,,,5,5
- Microsoft.Win32,,,8,,,,,,,,,,,,,8,
+ Microsoft.Win32,,,8,,,,,,,,,,,,,,8,
- MySql.Data.MySqlClient,48,,,,,,,,,,48,,,,,,
+ MySql.Data.MySqlClient,48,,,,,,,,,,48,,,,,,,
- Newtonsoft.Json,,,91,,,,,,,,,,,,,73,18
+ Newtonsoft.Json,,,91,,,,,,,,,,,,,,73,18
- ServiceStack,194,,7,27,,,,,,75,92,,,,,7,
+ ServiceStack,194,,7,27,,,,,,75,92,,,,,,7,
- System,65,8,12154,,8,8,9,,4,,33,3,1,3,4,10163,1991
+ System,65,18,12154,,8,8,9,,4,,33,3,1,10,3,4,10163,1991
- Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,
+ Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,,

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This involves some learning for me - so I have added a couple of clarifying questions 😄

@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

csharp

Generated file changes for csharp

  • Changes to framework-coverage-csharp.rst:
-    System,"``System.*``, ``System``",8,12154,65,7
+    System,"``System.*``, ``System``",25,12154,65,7
-    Totals,,8,12717,397,7
+    Totals,,25,12717,397,7
  • Changes to framework-coverage-csharp.csv:
- package,sink,source,summary,sink:code,sink:encryption-decryptor,sink:encryption-encryptor,sink:encryption-keyprop,sink:encryption-symmetrickey,sink:html,sink:remote,sink:sql,sink:xss,source:file,source:local,source:remote,summary:taint,summary:value
+ package,sink,source,summary,sink:code,sink:encryption-decryptor,sink:encryption-encryptor,sink:encryption-keyprop,sink:encryption-symmetrickey,sink:html,sink:remote,sink:sql,sink:xss,source:file,source:file-write,source:local,source:remote,summary:taint,summary:value
- Dapper,55,,,,,,,,,,55,,,,,,
+ Dapper,55,,,,,,,,,,55,,,,,,,
- JsonToItemsTaskFactory,,,7,,,,,,,,,,,,,7,
+ JsonToItemsTaskFactory,,,7,,,,,,,,,,,,,,7,
- Microsoft.ApplicationBlocks.Data,28,,,,,,,,,,28,,,,,,
+ Microsoft.ApplicationBlocks.Data,28,,,,,,,,,,28,,,,,,,
- Microsoft.CSharp,,,24,,,,,,,,,,,,,24,
+ Microsoft.CSharp,,,24,,,,,,,,,,,,,,24,
- Microsoft.EntityFrameworkCore,6,,,,,,,,,,6,,,,,,
+ Microsoft.EntityFrameworkCore,6,,,,,,,,,,6,,,,,,,
- Microsoft.Extensions.Caching.Distributed,,,15,,,,,,,,,,,,,15,
+ Microsoft.Extensions.Caching.Distributed,,,15,,,,,,,,,,,,,,15,
- Microsoft.Extensions.Caching.Memory,,,46,,,,,,,,,,,,,45,1
+ Microsoft.Extensions.Caching.Memory,,,46,,,,,,,,,,,,,,45,1
- Microsoft.Extensions.Configuration,,,83,,,,,,,,,,,,,80,3
+ Microsoft.Extensions.Configuration,,,83,,,,,,,,,,,,,,80,3
- Microsoft.Extensions.DependencyInjection,,,62,,,,,,,,,,,,,62,
+ Microsoft.Extensions.DependencyInjection,,,62,,,,,,,,,,,,,,62,
- Microsoft.Extensions.DependencyModel,,,12,,,,,,,,,,,,,12,
+ Microsoft.Extensions.DependencyModel,,,12,,,,,,,,,,,,,,12,
- Microsoft.Extensions.FileProviders,,,16,,,,,,,,,,,,,16,
+ Microsoft.Extensions.FileProviders,,,16,,,,,,,,,,,,,,16,
- Microsoft.Extensions.FileSystemGlobbing,,,15,,,,,,,,,,,,,13,2
+ Microsoft.Extensions.FileSystemGlobbing,,,15,,,,,,,,,,,,,,13,2
- Microsoft.Extensions.Hosting,,,17,,,,,,,,,,,,,16,1
+ Microsoft.Extensions.Hosting,,,17,,,,,,,,,,,,,,16,1
- Microsoft.Extensions.Http,,,10,,,,,,,,,,,,,10,
+ Microsoft.Extensions.Http,,,10,,,,,,,,,,,,,,10,
- Microsoft.Extensions.Logging,,,37,,,,,,,,,,,,,37,
+ Microsoft.Extensions.Logging,,,37,,,,,,,,,,,,,,37,
- Microsoft.Extensions.Options,,,8,,,,,,,,,,,,,8,
+ Microsoft.Extensions.Options,,,8,,,,,,,,,,,,,,8,
- Microsoft.Extensions.Primitives,,,63,,,,,,,,,,,,,63,
+ Microsoft.Extensions.Primitives,,,63,,,,,,,,,,,,,,63,
- Microsoft.Interop,,,27,,,,,,,,,,,,,27,
+ Microsoft.Interop,,,27,,,,,,,,,,,,,,27,
- Microsoft.NET.Build.Tasks,,,1,,,,,,,,,,,,,1,
+ Microsoft.NET.Build.Tasks,,,1,,,,,,,,,,,,,,1,
- Microsoft.NETCore.Platforms.BuildTasks,,,4,,,,,,,,,,,,,4,
+ Microsoft.NETCore.Platforms.BuildTasks,,,4,,,,,,,,,,,,,,4,
- Microsoft.VisualBasic,,,10,,,,,,,,,,,,,5,5
+ Microsoft.VisualBasic,,,10,,,,,,,,,,,,,,5,5
- Microsoft.Win32,,,8,,,,,,,,,,,,,8,
+ Microsoft.Win32,,,8,,,,,,,,,,,,,,8,
- MySql.Data.MySqlClient,48,,,,,,,,,,48,,,,,,
+ MySql.Data.MySqlClient,48,,,,,,,,,,48,,,,,,,
- Newtonsoft.Json,,,91,,,,,,,,,,,,,73,18
+ Newtonsoft.Json,,,91,,,,,,,,,,,,,,73,18
- ServiceStack,194,,7,27,,,,,,75,92,,,,,7,
+ ServiceStack,194,,7,27,,,,,,75,92,,,,,,7,
- System,65,8,12154,,8,8,9,,4,,33,3,1,3,4,10163,1991
+ System,65,25,12154,,8,8,9,,4,,33,3,1,17,3,4,10163,1991
- Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,
+ Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,,

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@michaelnebel
Copy link
Contributor

Great work @joefarebrother ! Thank you!

@joefarebrother joefarebrother merged commit a9d3445 into github:main Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants