Skip to content

Conversation

@cx-andre-pereira
Copy link
Contributor

@cx-andre-pereira cx-andre-pereira commented Oct 22, 2025

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 'user connections' flag set to 0.

  • Quoting CIS_Google_Cloud_Platform_Foundation_Benchmark_v4.0.0 page 250: "The user connections option specifies the maximum number of simultaneous user connections that are allowed on an instance of SQL Server. ... SQL Server allows a maximum of 32,767 user connections. Because user connections is by default a self-configuring value, with SQL Server adjusting the maximum number of user connections automatically as needed, up to the maximum value allowable. ... The default is 0, which means that the maximum (32,767) user connections are allowed. However if there is a number defined here that limits connections, SQL Server will not allow anymore above this limit. If the connections are at the limit, any new requests will be dropped, potentially causing lost data or outages for those using the database.

Proposed Changes

  • Implemented the missing query.
  • The query will flag for a specific instance : (after ensuring "database_version" is SQLSERVER based (possible values list))
    • Setting the "user connections" flag to a value that is not "0" (default value is 0)

Tenable reference

I submit this contribution under the Apache-2.0 license.

@cx-andre-pereira cx-andre-pereira changed the title initial implementation feat(query): implements "Beta - SQL DB Instance With Limited User Connections" Oct 22, 2025
@Checkmarx Checkmarx deleted a comment from kicsbot Oct 22, 2025
@github-actions
Copy link
Contributor

kics-logo

KICS version: v2.1.13

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

@github-actions github-actions bot added feature New feature query New query feature terraform Terraform query labels Oct 22, 2025
@cx-andre-pereira cx-andre-pereira marked this pull request as ready for review October 22, 2025 16:13
@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner October 22, 2025 16:13
Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Choose a reason for hiding this comment

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

Hey André, can you check my comment please?

@gitguardian
Copy link

gitguardian bot commented Nov 6, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
21271469 Triggered Generic Password badc40a assets/queries/terraform/azure/unrestricted_sql_server_access/test/negative4.tf View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@cx-andre-pereira cx-andre-pereira merged commit 6997291 into master Nov 6, 2025
28 checks passed
@cx-andre-pereira cx-andre-pereira deleted the AST-116632_19_6.3.3_ensure_'user_Connections'_flag_is_set_to_non_limiting_value branch November 6, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants