<PackageReference Include="System.Security.Permissions" Version="10.0.0-rc.1.25451.107" />

EnvironmentPermissionAttribute

Allows security actions for EnvironmentPermission to be applied to code using declarative security. This class cannot be inherited.
public string All { get; set; }

Sets full access for the environment variables specified by the string value.

public string Read { get; set; }

Gets or sets read access for the environment variables specified by the string value.

public string Write { get; set; }

Gets or sets write access for the environment variables specified by the string value.

Initializes a new instance of the EnvironmentPermissionAttribute class with the specified SecurityAction.