Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions swift/ql/src/queries/Summary/FlowSources.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @name Flow Sources
* @description List all flow sources found in the database. Flow sources
* indicate data that originates from an untrusted source, such
* as as untrusted remote data.
* @kind problem
* @problem.severity info
* @id swift/summary/flow-sources
* @tags summary
*/

import swift
import codeql.swift.dataflow.FlowSources

from RemoteFlowSource s
select s, "Flow source: " + s.getSourceType()
17 changes: 17 additions & 0 deletions swift/ql/src/queries/Summary/SensitiveExprs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @name Sensitive Expressions
* @description List all sensitive expressions found in the database.
* Sensitive expressions are expressions that have been
* identified as potentially containing data that should not be
* leaked to an attacker.
* @kind problem
* @problem.severity info
* @id swift/summary/sensitive-expressions
* @tags summary
*/

import swift
import codeql.swift.security.SensitiveExprs

from SensitiveExpr e
select e, "Sensitive expression: " + e.getSensitiveType()
25 changes: 25 additions & 0 deletions swift/ql/src/queries/Summary/SummaryStats.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @name Summary statistics
* @description A table of summary statistics about a database.
* @kind table
* @id swift/summary/summary-statistics
* @tags summary
*/

import swift
import codeql.swift.dataflow.FlowSources
import codeql.swift.security.SensitiveExprs

predicate statistic(string what, int value) {
what = "Files" and value = count(File f)
or
what = "Expressions" and value = count(Expr e | e.getFile().getName() != "")
or
what = "Remote flow sources" and value = count(RemoteFlowSource s)
or
what = "Sensitive expressions" and value = count(SensitiveExpr e)
}

from string what, int value
where statistic(what, value)
select what, value