Skip to content

Commit 8f3578c

Browse files
committed
Ruby: Include query results in test
1 parent ae60d40 commit 8f3578c

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
failures
2+
#select
3+
| Gemfile:2:8:2:28 | "http://rubygems.org" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
4+
| Gemfile:3:8:3:27 | "ftp://rubygems.org" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |
5+
| Gemfile:8:18:8:36 | "http://github.com" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
6+
| Gemfile:9:18:9:35 | "ftp://github.com" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |
7+
| Gemfile:14:25:14:51 | "http://github.com/#{...}" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
8+
| Gemfile:15:25:15:50 | "ftp://github.com/#{...}" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |
9+
| Gemfile:25:5:25:31 | "http://github.com/#{...}" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
10+
| Gemfile:29:5:29:30 | "ftp://github.com/#{...}" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |
11+
| Gemfile:41:26:41:57 | "http://github.com/jwt/ruby-jwt" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
12+
| Gemfile:42:26:42:56 | "ftp://github.com/jwt/ruby-jwt" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |
13+
| Gemfile:47:29:47:60 | "http://github.com/jwt/ruby-jwt" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
14+
| Gemfile:48:29:48:59 | "ftp://github.com/jwt/ruby-jwt" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |
15+
| Gemfile:53:29:53:49 | "http://rubygems.org" | Dependency source URL uses the unencrypted protocol HTTP. Use HTTPS instead. |
16+
| Gemfile:54:29:54:48 | "ftp://rubygems.org" | Dependency source URL uses the unencrypted protocol FTP. Use FTPS or SFTP instead. |

ruby/ql/test/query-tests/security/cwe-300/InsecureDependencyResolution.ql renamed to ruby/ql/test/query-tests/security/cwe-300/InsecureDependency.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import ruby
22
import TestUtilities.InlineExpectationsTest
33
import codeql.ruby.security.InsecureDependencyQuery
44

5-
class InsecureDependencyResolutionTest extends InlineExpectationsTest {
6-
InsecureDependencyResolutionTest() { this = "InsecureDependencyResolutionTest" }
5+
class InsecureDependencyTest extends InlineExpectationsTest {
6+
InsecureDependencyTest() { this = "InsecureDependencyTest" }
77

88
override string getARelevantTag() { result = "BAD" }
99

@@ -17,3 +17,7 @@ class InsecureDependencyResolutionTest extends InlineExpectationsTest {
1717
)
1818
}
1919
}
20+
21+
from Expr url, string msg
22+
where insecureDependencyUrl(url, msg)
23+
select url, msg

ruby/ql/test/query-tests/security/cwe-300/InsecureDependencyResolution.expected

Whitespace-only changes.

0 commit comments

Comments
 (0)