-
Notifications
You must be signed in to change notification settings - Fork 1.7k
URI validation for winget cli commands#4707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:
- Finalizing strings
- Move to resource file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for PM input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but also, we're still thinking about the scope that this policy should cover (DSC only, or more ... )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Feedback isn't localized, it should probably only be sent to the log and not stdout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All strings are not finalized/localized yet, there's an email thread for deciding on a couple things including localization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there also a Warn response that SmartScreen can return?
https://learn.microsoft.com/en-us/defender-endpoint/web-protection-overview#order-of-precedence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, there's a PUA response as well. However, PUA/Warn will also be treated as Blocked, but the details will be communicated in the logs instead and the logic will be in the injected code. I can potentially reduce this enum to a bool. I will revisit this later once things are a little bit more finalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a default (enpty) constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesnt seem to match the version of cppwinrt in NOTICE.txt. Does the version need to be bumped across all the solution files, or is there something I’m missing?
Line 769 in 2306d08
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding @RDMacLachlan to help with the strings for the new group policies in the ADML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding @RDMacLachlan to help with the displayed messages (I copied the messages from App Installer with some modifications)
src/AppInstallerCLI.sln
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're building for ARM now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need to pass the empty string for m_feedback because that's what the default constructor does
Or you could initialize it to empty in the declaration and not mention it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feedback should probably be a std::string_view or a std::string&& to avoid a copy. Not that it would make much difference in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could ExecuteUriValidation happen after we set up the progress reporting and message? Just in case it takes a while
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message could probably be more specific to zones. I think we already have a generic "not allowed by policy" string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, we should use it everywhere we do this check
florelis
commented
Nov 6, 2024
I think we should add a command line flag to bypass SmartScreen if it fails, and an admin setting to disable the SmartScreen checks without needing to use group policy.
Uh oh!
There was an error while loading. Please reload this page.
Description
flowchart TD %%{init:{'flowchart':{"defaultRenderer": "elk"}}}%% A[winget cli] --> B B{is configuration?} --> |yes| C[Get URI Zone] B --> |no| D{Package catalog trusted?} D --> |no| C D --> |yes| E(Resume operation) C --> F{Zone blocked by policy?} F -->|yes| G(APPINSTALLER_CLI_ERROR_BLOCKED_BY_POLICY) F --> |no| H{Zone Internet or Untrusted?} H --> |yes| I{SmartScreen blocked by policy?} H --> |no| E I --> |no| J{Blocked by SmartScreen?} I --> |yes| E J --> |yes| K(APPINSTALLER_CLI_ERROR_BLOCKED_BY_REPUTATION_SERVICE) J --> |no| E style G fill:red,stroke:darkred,color:white style K fill:red,stroke:darkred,color:white style E fill:green,stroke:darkgreen,color:whiteTODO
Follow ups
Microsoft Reviewers: Open in CodeFlow