Open LaurentLesle opened 1 year ago
@LaurentLesle Thank you for submitting this interesting feature request.
My first implication is maybe we can simply storing the state file to a HSM that comply with the organization's policy. I'm not sure whether http
backend would help.
One challenge for:
Some API returns always an attribute that should not be stored in the tfstate but kept in the HSM. On refresh, if the value of this attribute has changed then it will be updated in the HSM.
This implies that we only store the secret pointer in the state. But the provider can not conditionally wipe attributes on read, i.e. it either always wipe/no wipe an attribute, given how the SDK supports. What is asked here is that we wipe the secret attribute during the read for refresh, but keep it during the read for the follow-up diff against the config.
Hi @magodo this requirement is more to segregate the tfstate store from the secrets that must be stored into an external HSM. The goal is to prevent secrets that would trigger a "non-compliance" or "security breach" because the secret is stored in the tfstate json. Storing the tfstate in an HSM or encryption the HSM would not address the previous statement.
One way to address the challenge provided by the SDK would be to remove always and follow something like that to handle the HSM flow:
@LaurentLesle Do you mean we shall always just ignore the secrest when generating a diff?
Yes for the tfstate flow.
But always run the HSM flow and adjust the response depending on plan, apply or destroy
Customers have some regulated use cases and just marking "secret" attributes as sensitive is a security breach for the organisation as their policy prevent those security tokens, passwords or pass-phrases to be stored outside of a HSM (secret store).
Some API calls are returning sensitive information (passwords, authorisation keys, crypto objects...) that should not be persisted in the tfstate.
Design goals:
Implementation directions:
Challenges:
This issue describes the desired state of that feature.
After apply execution it is expected that the output attribute will have "body.encryption_key" and "body.ipsecpolicy.passphrase" removed from the json.
A new output (read-only) attribute is available with the resource path of the secret