File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed
swift/ql/src/queries/Summary Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @name Flow Sources
3+ * @description List all flow sources found in the database. Flow sources
4+ * indicate data that originates from an untrusted source, such
5+ * as as untrusted remote data.
6+ * @kind problem
7+ * @problem.severity info
8+ * @id swift/summary/flow-sources
9+ * @tags summary
10+ */
11+
12+ import swift
13+ import codeql.swift.dataflow.FlowSources
14+
15+ from RemoteFlowSource s
16+ select s , "Flow source: " + s .getSourceType ( )
Original file line number Diff line number Diff line change 1+ /**
2+ * @name Sensitive Expressions
3+ * @description List all sensitive expressions found in the database.
4+ * Sensitive expressions are expressions that have been
5+ * identified as potentially containing data that should not be
6+ * leaked to an attacker.
7+ * @kind problem
8+ * @problem.severity info
9+ * @id swift/summary/sensitive-expressions
10+ * @tags summary
11+ */
12+
13+ import swift
14+ import codeql.swift.security.SensitiveExprs
15+
16+ from SensitiveExpr e
17+ select e , "Sensitive expression: " + e .getSensitiveType ( )
Original file line number Diff line number Diff line change 1+ /**
2+ * @name Summary statistics
3+ * @description A table of summary statistics about a database.
4+ * @kind table
5+ * @id swift/summary/summary-statistics
6+ * @tags summary
7+ */
8+
9+ import swift
10+ import codeql.swift.dataflow.FlowSources
11+ import codeql.swift.security.SensitiveExprs
12+
13+ predicate statistic ( string what , int value ) {
14+ what = "Files" and value = count ( File f )
15+ or
16+ what = "Expressions" and value = count ( Expr e | not e .getFile ( ) instanceof UnknownFile )
17+ or
18+ what = "Remote flow sources" and value = count ( RemoteFlowSource s )
19+ or
20+ what = "Sensitive expressions" and value = count ( SensitiveExpr e )
21+ }
22+
23+ from string what , int value
24+ where statistic ( what , value )
25+ select what , value
You can’t perform that action at this time.
0 commit comments