Skip to content

Commit e1e980c

Browse files
committed
Rust: Add sensitive data to summary queries.
1 parent 821eb4f commit e1e980c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Diff for: rust/ql/src/queries/summary/SensitiveData.ql

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @name Sensitive Data
3+
* @description List all sensitive data found in the database. Sensitive data is anything that
4+
* should not be sent in unencrypted form.
5+
* @kind problem
6+
* @problem.severity info
7+
* @id rust/summary/sensitive-data
8+
* @tags summary
9+
*/
10+
11+
import rust
12+
import codeql.rust.security.SensitiveData
13+
14+
from SensitiveData d
15+
select d, "Sensitive data (" + d.getClassification() + "): " + d.toString()

Diff for: rust/ql/src/queries/summary/SummaryStats.ql

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import rust
1010
import codeql.rust.Concepts
11+
import codeql.rust.security.SensitiveData
1112
import codeql.rust.Diagnostics
1213
import Stats
1314

@@ -56,4 +57,6 @@ where
5657
key = "Taint sources - total" and value = count(ThreatModelSource s)
5758
or
5859
key = "Taint sources - active" and value = count(ActiveThreatModelSource s)
60+
or
61+
key = "Sensitive data" and value = count(SensitiveData d)
5962
select key, value order by key

Diff for: rust/ql/test/query-tests/diagnostics/SummaryStats.expected

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
| Macro calls - resolved | 8 |
1515
| Macro calls - total | 9 |
1616
| Macro calls - unresolved | 1 |
17+
| Sensitive data | 0 |
1718
| Taint sources - active | 0 |
1819
| Taint sources - total | 0 |

0 commit comments

Comments
 (0)