fix: Database_observability: allow setting limit for mysql query_details#5314
Conversation
|
|
||
| func (c *QueryDetails) tablesFromEventsStatements(ctx context.Context) error { | ||
| rs, err := c.dbConnection.QueryContext(ctx, selectQueryTablesSamples) | ||
| query := fmt.Sprintf(selectQueryTablesSamples, EXCLUDED_SCHEMAS, c.statementsLimit) |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
String-formatted SQL query detected. This could lead to SQL injection if the string is not sanitized properly. Audit this call to ensure the SQL is not manipulable by external data.
To resolve this comment:
🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by string-formatted-query.
We're currently testing semgrep's diff-aware PR comment feature on a subset of our repos-- if you run into issues or find this spammy, please reach out to @danny.cooper in slack and give feedback.
For backwards compatability with gosec, its best to use polyglot suppression comments of the following format for false positives:
// #nosec <gosec rule ID> nosemgrep: <semgrep rule ID>
You can view more details about this finding in the Semgrep AppSec Platform.
Allow limiting the number of recent queries collected in the mysql `query_details` collector. Default to 250 to match mysqld_exporter's behavior.
974a681 to
52cdbca
Compare
|
💻 Deploy preview deleted (fix: Database_observability: allow setting limit for mysql query_details). |
Brief description of Pull Request
Allow limiting the number of recent queries collected in the mysql
query_detailscollector. Default to 250 to match mysqld_exporter's behavior.Pull Request Details
Issue(s) fixed by this Pull Request
Notes to the Reviewer
PR Checklist