Skip to content
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

chore: do not show sensitive certificate details in Terraform cmd out… #9684

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

feng-zhe
Copy link
Contributor

@feng-zhe feng-zhe commented Dec 20, 2023

Mark some certificate-related information as sensitive so that they wouldn't be shown in the Terraform cmd output like terraform destroy.

Release Note Template for Downstream PRs (will be copied)

sql: update `replica_configuration`, `ca_cert`, and `server_ca_cert` fields to be flagged sensitive in `google_sql_instance` and `google_sql_ssl_cert` resources

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3310
Passed tests 2973
Skipped tests: 336
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDataprocClusterIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataprocClusterIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 7 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 3 files changed, 12 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 92
Passed tests 78
Skipped tests: 14
Affected tests: 0

Click here to see the affected service packages
  • sql

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@feng-zhe
Copy link
Contributor Author

feng-zhe commented Jan 3, 2024

Gentle ping. Thanks.

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marked a couple needed changes for this implementation

// Returned from API on all replicas
Computed: true,
Computed: true,
Sensitive: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The individual sub fields that specifically contain the encrypted data should be flagged sensitive for this update, not the entire list object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Nick. Unfortunately this is a limitation of TF for these nested messages. Please see hashicorp/terraform-plugin-sdk#201. So I have to mark the whole message as sensitive.

I've tested the version which only marks the sensitive fields in the nested message. TF failed to hide them

Computed: true,
Type: schema.TypeList,
Computed: true,
Sensitive: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Nick. Unfortunately this is a limitation of TF for these nested messages. Please see this issue. So I have to mark the whole message as sensitive.

I've tested the version which only marks the sensitive fields in the nested message. TF failed to hide them.

@feng-zhe
Copy link
Contributor Author

feng-zhe commented Jan 8, 2024

Friendly ping. Thanks.

@NickElliot NickElliot self-requested a review January 8, 2024 22:09
Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM then!

@NickElliot NickElliot merged commit ec0b194 into GoogleCloudPlatform:main Jan 8, 2024
12 checks passed
bskaplan pushed a commit to bskaplan/magic-modules that referenced this pull request Jan 17, 2024
…oogleCloudPlatform#9684)

* chore: do not show sensitive certificate details in Terraform cmd output.

* Mark the whole replica_configuration as sensitive due to the private keys.
kylase pushed a commit to yuanchuankee/magic-modules that referenced this pull request Jan 21, 2024
…oogleCloudPlatform#9684)

* chore: do not show sensitive certificate details in Terraform cmd output.

* Mark the whole replica_configuration as sensitive due to the private keys.
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…oogleCloudPlatform#9684)

* chore: do not show sensitive certificate details in Terraform cmd output.

* Mark the whole replica_configuration as sensitive due to the private keys.
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
…oogleCloudPlatform#9684)

* chore: do not show sensitive certificate details in Terraform cmd output.

* Mark the whole replica_configuration as sensitive due to the private keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants