Skip to content

How can I disable PSAMSIMethodInvocationLogging #21491

Closed

Description

@rhubarb-geek-nz

Summary of the new feature / enhancement

As a user I do not want any logging or tracing of invocations of .NET methods either collected or passed to other components.

Proposed technical implementation details (optional)

In order to comply with How the Antimalware Scan Interface (AMSI) helps you defend against malware it should be restricted to those mechanisms that take an entire script or string and either execute it or create a script block.

It should not log every single method, passing private data to 2nd or 3rd party dlls.

It should at most scan the script itself, not the expanded variable values.

It should only deal with fileless threats.

It should not log/scan anything that comes from a script read from the file system - that is considered already trusted

Neither should it need to scan signed scripts, again that should already be trusted

Activity

  1. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Apr 17, 2024
  2. SteveL-MSFT commented on Apr 22, 2024

    @SteveL-MSFT
    Member

    WG reviewed this and this logging is required on Windows to provide protection via Windows Defender (or possibly other AMSI compliant scanners).

  3. added
    WG-ReviewedA Working Group has reviewed this and made a recommendation
    and removed
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    WG-NeedsReviewNeeds a review by the labeled Working Group
    on Apr 22, 2024
  4. SteveL-MSFT commented on Apr 23, 2024

    @SteveL-MSFT
    Member

    In your first case, I believe the actual script block to be executed (meaning variable expansion) is sent to AMSI so you can't hide executable code within a variable.

    in your second case, those reports appears to be due to the large script for the Concise ErrorView formatting. So any script executed during formatting would also be sent to AMSI since 3rd parties can add their own scripts during formatting.

  5. microsoft-github-policy-service commented on Apr 25, 2024

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as by-design and has not had any activity for 1 day. It has been closed for housekeeping purposes.

  6. microsoft-github-policy-service commented on Apr 25, 2024

    @microsoft-github-policy-service
    Contributor

    📣 Hey rhubarb-geek-nz, how did we do? We would love to hear your feedback with the link below! 🗣️

    🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-By DesignThe reported behavior is by design.WG-ReviewedA Working Group has reviewed this and made a recommendationWG-Securitysecurity related areas such as JEA

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions