-
Notifications
You must be signed in to change notification settings - Fork 349
feat(query): implements "Beta - SQL DB Instance With Ownership Chaining Enabled" #7787
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
base: master
Are you sure you want to change the base?
Conversation
…ship_chaining'_flag_is_set_to_off
…16631_18_6.3.2_ensure_'cross_db_ownership_chaining'_flag_is_set_to_off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think of my suggestion @cx-andre-pereira .
| "resourceName": tf_lib.get_resource_name(resource, name), | ||
| "searchKey": results.searchKey, | ||
| "issueType": "IncorrectValue", | ||
| "keyExpectedValue": sprintf("'google_sql_database_instance[%s].settings.database_flags' should be defined and set 'cross db ownership chaining' to 'off'", [name]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this expectedValue misleading?
Following the documentation description: "This flag is deprecated for all SQL Server versions in CGP. Going forward, you can't set its value to on. However, if you have this flag enabled, we strongly recommend that you either remove the flag from your database or set it to off", the default value is off, I believe we should say that the expected value "should be defined and set"...
Maybe change the message to something similar to other related case queries:
| "keyExpectedValue": sprintf("'google_sql_database_instance[%s].settings.database_flags' should be defined and set 'cross db ownership chaining' to 'off'", [name]), | |
| "keyExpectedValue": sprintf("'google_sql_database_instance[%s].settings.database_flags' should set 'cross db ownership chaining' to 'off'", [name]), |








Reason for Proposed Changes
Currently there is no query to ensure that a "google_sql_database_instance" resource with a "SQLSERVER" based "database_version" has the 'cross db ownership chaining' flag disabled.
Quoting CIS_Google_Cloud_Platform_Foundation_Benchmark_v4.0.0 page 247: "
This flag is deprecated for all SQL Server versions in CGP. Going forward, you can't set its value to on. However, if you have this flag enabled, we strongly recommend that you either remove the flag from your database or set it to off." and "Enabling cross db ownership is not recommended unless all of the databases hosted by the instance of SQL Server must participate in cross-database ownership chaining and you are aware of the security implications of this setting.Proposed Changes
Tenable reference
I submit this contribution under the Apache-2.0 license.