Skip to content

Commit e708167

Browse files
committed
Rust: Add the sinks to metrics.
1 parent 59c3ac6 commit e708167

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

rust/ql/src/queries/summary/Stats.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ private import codeql.rust.AstConsistency as AstConsistency
1010
private import codeql.rust.controlflow.internal.CfgConsistency as CfgConsistency
1111
private import codeql.rust.dataflow.internal.DataFlowConsistency as DataFlowConsistency
1212
private import codeql.rust.security.SqlInjectionExtensions
13+
private import codeql.rust.security.CleartextLoggingExtensions
1314

1415
/**
1516
* Gets a count of the total number of lines of code in the database.
@@ -58,7 +59,9 @@ int getTaintEdgesCount() {
5859
* Gets a kind of query for which `n` is a sink (if any).
5960
*/
6061
string getAQuerySinkKind(DataFlow::Node n) {
61-
(n instanceof SqlInjection::Sink and result = "SqlInjection")
62+
n instanceof SqlInjection::Sink and result = "SqlInjection"
63+
or
64+
n instanceof CleartextLogging::Sink and result = "CleartextLogging"
6265
}
6366

6467
/**

rust/ql/test/query-tests/diagnostics/SummaryStats.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
| Macro calls - resolved | 8 |
1515
| Macro calls - total | 9 |
1616
| Macro calls - unresolved | 1 |
17-
| Taint edges - number of edges | 2 |
17+
| Taint edges - number of edges | 3 |
1818
| Taint reach - nodes tainted | 0 |
1919
| Taint reach - per million nodes | 0 |
2020
| Taint sinks - cryptographic operations | 0 |
21-
| Taint sinks - query sinks | 0 |
21+
| Taint sinks - query sinks | 3 |
2222
| Taint sources - active | 0 |
2323
| Taint sources - disabled | 0 |
2424
| Taint sources - sensitive data | 0 |

0 commit comments

Comments
 (0)