Skip to content

Commit

Permalink
ci: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cfabianski committed Aug 17, 2023
1 parent 60f82f3 commit c492606
Show file tree
Hide file tree
Showing 26 changed files with 319 additions and 0 deletions.
8 changes: 8 additions & 0 deletions e2e/rules/.snapshots/TestAuxilary-testdata-data-auxilary
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ high:
- [Datadog docs](https://docs.datadoghq.com)
- [Scrubbing data](https://docs.datadoghq.com/tracing/configure_data_security/?tab=mongodb#scrub-sensitive-data-from-your-spans)
documentation_url: ""
severity: low
line_number: 3
full_filename: e2e/rules/testdata/data/auxilary/unsecure.js
filename: unsecure.js
Expand Down Expand Up @@ -45,6 +46,13 @@ high:
fingerprint: 68427732321c4df53052a341ac8da647_0
old_fingerprint: 4d54a4b735da21fbdcb2d2662977b033_0
code_extract: client.event("user", "logged_in", {}, user);
severity:
rule_severity: low
display_severity: high
sensitive_data_category_weighting: 2
rule_severity_weighting: 2
trigger_weighting: true
final_weighting: 6


--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ high:
title: Test rule reference filters
description: Test rule reference filters
documentation_url: ""
severity: high
line_number: 1
full_filename: e2e/rules/testdata/data/reference_filters/main.rb
filename: main.rb
Expand All @@ -29,6 +30,11 @@ high:
fingerprint: df1f6d9ee9f4ee60085d0046163b3701_0
old_fingerprint: 52f7dcd9f1ba09f3a9f8c1ad305c8a89_0
code_extract: x.foo
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5


--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ warning:
## Resources
- [Ruby on Rails Active Record encryption](https://guides.rubyonrails.org/active_record_encryption.html)
documentation_url: ""
severity: warning
line_number: 4
full_filename: e2e/rules/testdata/data/ruby_rails_default_encryption_schema_rb/db/schema.rb
filename: db/schema.rb
Expand Down Expand Up @@ -61,6 +62,9 @@ warning:
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
severity:
rule_severity: warning
display_severity: warning


--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ warning:
## Resources
- [Ruby on Rails Active Record encryption](https://guides.rubyonrails.org/active_record_encryption.html)
documentation_url: ""
severity: warning
line_number: 3
full_filename: e2e/rules/testdata/data/ruby_rails_default_encryption_structure_sql/db/structure.sql
filename: db/structure.sql
Expand Down Expand Up @@ -64,6 +65,9 @@ warning:
updated_at timestamp(6) without time zone NOT NULL,
email character varying DEFAULT ''::character varying NOT NULL
);
severity:
rule_severity: warning
display_severity: warning


--
Expand Down
16 changes: 16 additions & 0 deletions e2e/rules/.snapshots/TestSanitizer-testdata-data-sanitizer
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ critical:
title: Test sanitizer
description: Test sanitizer
documentation_url: ""
severity: high
line_number: 1
full_filename: e2e/rules/testdata/data/sanitizer/sanitizer.rb
filename: sanitizer.rb
Expand Down Expand Up @@ -35,13 +36,21 @@ critical:
fingerprint: 6c505050fabde2c4ed17380d19fab254_0
old_fingerprint: d2e829ba86a33c5a52844641617ad8a7_0
code_extract: log("abc" + x)
severity:
rule_severity: high
display_severity: critical
sensitive_data_category_weighting: 2
rule_severity_weighting: 5
trigger_weighting: true
final_weighting: 9
- rule:
cwe_ids:
- "42"
id: sanitizer_test
title: Test sanitizer
description: Test sanitizer
documentation_url: ""
severity: high
line_number: 4
full_filename: e2e/rules/testdata/data/sanitizer/sanitizer.rb
filename: sanitizer.rb
Expand Down Expand Up @@ -71,6 +80,13 @@ critical:
fingerprint: 6c505050fabde2c4ed17380d19fab254_2
old_fingerprint: d2e829ba86a33c5a52844641617ad8a7_2
code_extract: log("abc" + user.email)
severity:
rule_severity: high
display_severity: critical
sensitive_data_category_weighting: 2
rule_severity_weighting: 5
trigger_weighting: true
final_weighting: 9


--
Expand Down
6 changes: 6 additions & 0 deletions e2e/rules/.snapshots/TestSecrets-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ high:
## Resources
- [Gitleaks](https://gitleaks.io/)
documentation_url: ""
severity: high
line_number: 3
full_filename: e2e/rules/testdata/data/secrets/leaked.rb
filename: leaked.rb
Expand All @@ -40,6 +41,11 @@ high:
old_fingerprint: 47146043fab58ba5fc86fd0c716b20d8_0
detailed_context: PGP private key
code_extract: ' @private_key ||= ''-----BEGIN PGP PRIVATE KEY BLOCK-----asdf-----END PGP PRIVATE KEY BLOCK-----'''
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5


--
Expand Down
7 changes: 7 additions & 0 deletions e2e/rules/.snapshots/TestSimpleRuby-testdata-data-simple_ruby
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ medium:
## Resources
- [Configuring Rails Applications - Ruby on Rails Guides](https://guides.rubyonrails.org/configuring.html#config-force-ssl)
documentation_url: ""
severity: low
line_number: 7
full_filename: e2e/rules/testdata/data/simple_ruby/unsecure.rb
filename: unsecure.rb
Expand All @@ -48,6 +49,12 @@ medium:
fingerprint: 52ee98cc601d1c1bd772ff548ee32425_0
old_fingerprint: 28ca51516a8b388cb7065c1f0df8b093_0
code_extract: ' config.force_ssl = false'
severity:
rule_severity: low
display_severity: medium
sensitive_data_category_weighting: 2
rule_severity_weighting: 2
final_weighting: 4


--
Expand Down
36 changes: 36 additions & 0 deletions new/detector/composition/java/.snapshots/TestScope--scope.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ high:
title: Test detection filter scopes
description: Test detection filter scopes
documentation_url: ""
severity: high
line_number: 1
full_filename: scope.java
filename: scope.java
Expand All @@ -28,13 +29,19 @@ high:
snippet: scopeCursor(request.getParameter("oops"))
fingerprint: bdbeee20feb34c6881d975716e2fe09f_0
old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_0
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5
- rule:
cwe_ids:
- "42"
id: scope_test
title: Test detection filter scopes
description: Test detection filter scopes
documentation_url: ""
severity: high
line_number: 5
full_filename: scope.java
filename: scope.java
Expand All @@ -57,13 +64,19 @@ high:
snippet: scopeNested(request.getParameter("oops"))
fingerprint: bdbeee20feb34c6881d975716e2fe09f_1
old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_1
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5
- rule:
cwe_ids:
- "42"
id: scope_test
title: Test detection filter scopes
description: Test detection filter scopes
documentation_url: ""
severity: high
line_number: 6
full_filename: scope.java
filename: scope.java
Expand All @@ -86,13 +99,19 @@ high:
snippet: 'scopeNested(x ? request.getParameter("oops") : y)'
fingerprint: bdbeee20feb34c6881d975716e2fe09f_2
old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_2
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5
- rule:
cwe_ids:
- "42"
id: scope_test
title: Test detection filter scopes
description: Test detection filter scopes
documentation_url: ""
severity: high
line_number: 7
full_filename: scope.java
filename: scope.java
Expand All @@ -115,13 +134,19 @@ high:
snippet: 'scopeNested(request.getParameter("oops") ? x : y)'
fingerprint: bdbeee20feb34c6881d975716e2fe09f_3
old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_3
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5
- rule:
cwe_ids:
- "42"
id: scope_test
title: Test detection filter scopes
description: Test detection filter scopes
documentation_url: ""
severity: high
line_number: 9
full_filename: scope.java
filename: scope.java
Expand All @@ -144,13 +169,19 @@ high:
snippet: scopeResult(request.getParameter("oops"))
fingerprint: bdbeee20feb34c6881d975716e2fe09f_4
old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_4
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5
- rule:
cwe_ids:
- "42"
id: scope_test
title: Test detection filter scopes
description: Test detection filter scopes
documentation_url: ""
severity: high
line_number: 10
full_filename: scope.java
filename: scope.java
Expand All @@ -173,4 +204,9 @@ high:
snippet: 'scopeResult(x ? request.getParameter("oops") : y)'
fingerprint: bdbeee20feb34c6881d975716e2fe09f_5
old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_5
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ high:
title: ""
description: ""
documentation_url: ""
severity: ""
line_number: 2
full_filename: different-line.java
filename: different-line.java
Expand Down Expand Up @@ -33,4 +34,11 @@ high:
snippet: logger.error(name)
fingerprint: b08f2b317021ef0197dc9286477e251d_0
old_fingerprint: b08f2b317021ef0197dc9286477e251d_0
severity:
rule_severity: ""
display_severity: high
sensitive_data_category_weighting: 2
rule_severity_weighting: 2
trigger_weighting: true
final_weighting: 6

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ high:
title: ""
description: ""
documentation_url: ""
severity: ""
line_number: 1
full_filename: same-line.java
filename: same-line.java
Expand Down Expand Up @@ -33,4 +34,11 @@ high:
snippet: logger.error(user.name)
fingerprint: b000c2a9a82d59a1e826bc709cca9307_0
old_fingerprint: b000c2a9a82d59a1e826bc709cca9307_0
severity:
rule_severity: ""
display_severity: high
sensitive_data_category_weighting: 2
rule_severity_weighting: 2
trigger_weighting: true
final_weighting: 6

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ high:
title: Test pattern variable tree sitter node types/fixups
description: Test pattern variable tree sitter node types/fixups
documentation_url: ""
severity: high
line_number: 1
full_filename: main.js
filename: main.js
Expand All @@ -28,13 +29,19 @@ high:
snippet: const matchedVariable = 42
fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_0
old_fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_0
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5
- rule:
cwe_ids:
- "42"
id: pattern_variables_test
title: Test pattern variable tree sitter node types/fixups
description: Test pattern variable tree sitter node types/fixups
documentation_url: ""
severity: high
line_number: 4
full_filename: main.js
filename: main.js
Expand All @@ -57,4 +64,9 @@ high:
snippet: import x from "matched_package"
fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_1
old_fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_1
severity:
rule_severity: high
display_severity: high
rule_severity_weighting: 5
final_weighting: 5

Loading

0 comments on commit c492606

Please sign in to comment.