-
Notifications
You must be signed in to change notification settings - Fork 34
Need a common way to declare a property is sensitive #71
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
Comments
For a configuration, you could specify the parameter type like ARM templates do: I'm hesitant to try to set a flag for the resource to know, since its up to the resource to handle it correctly. It might give users a false sense that the value is somehow protected by DSC, but we have no control over what the resource does with it. |
We could pass the sensitive value in via environment variables named "SENSITIVE_PARAMETERNAME". The json payload would need to reference this variable. |
I think we do need a way to declare in a manifest whether the resource (and especially the arbitrary caller) can/should treat a value as sensitive for redaction. It's not a guarantee of redaction - that always depends on the implementation of the resource/caller - but without it there's just no way for a caller to know whether or not to apply special handling to a value. |
Agree with @michaeltlombardi on a way to make it obvious to the resource author. I also could see an integration point with machine config where we refer to the name and path of a secret in KeyVault via the SecretManagement module. |
Note that I expect actual secrets to be passed as parameters to the configuration. For PS users, they can certainly use SecretManagement module to do this, but we may need equivalent created for non-PS scenarios. |
It may make sense to have a special identifier for getting secrets by name (using ARM-like syntax): resources:
- name: myTest
type: Microsoft.Azure/VM
properties:
name: myVM
user: foo
password: [secret('fooPassword')] In this case, we'd extend ARM to have a |
I want to make sure that we keep consistency with ARM as a top priority. Here is some "prior art" to think about regarding passing sensitive settings to VM extensions: |
There's at least three different but related requirements here:
Footnotes
|
After consideration, I think the simplest way forward for this is to define and advise the use of the custom keyword The updated schema for the title: Instance Properties
description: >-
Defines the properties that DSC can retrieve and manage for the resource's instances.
This keyword must define at least one property as a key-value pair. The key is the
property's name. The value is a subschema that validates the property.
type: object
minProperties: 1
unevaluatedProperties:
anyOf:
- $ref: https://json-schema.org/draft/2020-12/schema
- $ref: https://json-schema.org/draft/2019-09/schema
- $ref: http://json-schema.org/draft-07/schema# To: title: Instance Properties
description: >-
Defines the properties that DSC can retrieve and manage for the resource's instances.
This keyword must define at least one property as a key-value pair. The key is the
property's name. The value is a subschema that validates the property.
type: object
minProperties: 1
unevaluatedProperties:
anyOf:
- $ref: https://json-schema.org/draft/2020-12/schema
- $ref: https://json-schema.org/draft/2019-09/schema
- $ref: http://json-schema.org/draft-07/schema#
properties:
x-sensitive:
type: boolean
default: false
title: Value is sensitive
description: >-
Defines whether the property value should be handled as sensitive data. If the value is
sensitive, like an API token, DSC and higher order tools should redact the value in any
logs or messages. By default, property values aren't considered sensitive. The Markdown documentation for this property would be:
This same pattern could be used for other cases where we need to introduce annotations for DSC Resource properties, like whether a property requires elevation/root. |
With PR #364 it describes a way to pass sensitive strings and objects. |
Summary of the new feature / enhancement
There may be a need to pass sensitive information (like an api key) to a resource that may be retrieved from AKV, for example. DSC itself needs to know this is sensitive so it doesn't log it or emit to console and resources also need to know it's sensitive for the same reasons.
It could be as simple as a common prefix:
_sensitive
so resources can themselves decide if it's_sensitiveString
,_sensitiveKey
, etc...Proposed technical implementation details (optional)
No response
The text was updated successfully, but these errors were encountered: