From 6f722c269cde6654c89269fb8eddde20a4d0b0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Fabianski?= Date: Thu, 7 Mar 2024 22:06:31 +0100 Subject: [PATCH] chore: update light --- e2e/.snapshots/TestCache | 3 +- .../TestReportFlagsShouldFail-format-jsonv2 | 2 +- .../TestAuxilary-testdata-data-auxilary | 3 +- ...DisabledRules-testdata-data-disabled_rules | 3 +- ...stExpectedRule-testdata-data-expected_rule | 2 +- ...nceFilters-testdata-data-reference_filters | 3 +- ...ta-ruby_rails_default_encryption_schema_rb | 64 ++++++++++++++----- ...uby_rails_default_encryption_structure_sql | 57 +++++++++++++---- .../TestSanitizer-testdata-data-sanitizer | 6 +- e2e/rules/.snapshots/TestSecrets-secrets | 3 +- .../TestSimpleRuby-testdata-data-simple_ruby | 3 +- .../process/settings/policies/common.rego | 3 - .../settings/policies/risk_policy.rego | 1 - internal/detectors/custom/custom.go | 3 - .../.snapshots/TestBuildReportInterfaces | 12 ++-- internal/detectors/simple/simple.go | 1 - .../.snapshots/TestBuildReportDataStores | 8 +-- internal/detectors/spring/spring.go | 1 - .../golang/.snapshots/TestScope--scope.yml | 36 ++++------- .../flow/TestFlow--different-line.yml | 9 +-- .../.snapshots/flow/TestFlow--same-line.yml | 9 +-- .../java/.snapshots/TestScope--scope.yml | 27 +++----- .../flow/TestFlow--different-line.yml | 3 +- .../.snapshots/flow/TestFlow--same-line.yml | 3 +- .../.snapshots/TestPatternVariables--main.yml | 6 +- .../.snapshots/TestScope--scope.yml | 27 +++----- .../flow/TestFlow--assigment-expression.yml | 3 +- .../flow/TestFlow--variable-declarator.yml | 3 +- .../.snapshots/import/TestImport--import.yml | 15 ++--- ...stObjectDeconstructing--deconstructing.yml | 3 +- ...ObjectDeconstructing--multiple_objects.yml | 3 +- .../string/TestString--concatanation.yml | 3 +- .../.snapshots/string/TestString--simple.yml | 3 +- .../string/TestString--single-quotes.yml | 3 +- ...ring--template-variable-reconciliation.yml | 3 +- .../string/TestString--template.yml | 3 +- .../languages/javascript/pattern/pattern.go | 2 +- .../php/.snapshots/TestConst--main.yml | 3 +- .../php/.snapshots/TestScope--scope.yml | 36 ++++------- .../flow/TestFlow--different-line.yml | 3 +- .../.snapshots/flow/TestFlow--same-line.yml | 6 +- .../python/.snapshots/TestScope--scope.yml | 36 ++++------- .../flow/TestFlow--different-line.yml | 3 +- .../.snapshots/flow/TestFlow--same-line.yml | 6 +- .../.snapshots/TestPatternVariables--main.yml | 19 +----- .../ruby/.snapshots/TestRuby--call.yml | 3 +- ...stRuby--object-variable-reconciliation.yml | 3 +- .../ruby/.snapshots/TestScope--scope.yml | 27 +++----- .../report/output/dataflow/risks/risks.go | 2 - .../report/output/privacy/privacy_test.go | 1 - .../security/.snapshots/TestAddReportData | 8 +-- .../.snapshots/TestAddReportDataWithSeverity | 4 +- .../report/output/security/security_test.go | 4 -- internal/report/schema/datatype/datatype.go | 1 - internal/scanner/scanner.go | 8 +-- 55 files changed, 222 insertions(+), 293 deletions(-) diff --git a/e2e/.snapshots/TestCache b/e2e/.snapshots/TestCache index 2134a1daf..64913af18 100644 --- a/e2e/.snapshots/TestCache +++ b/e2e/.snapshots/TestCache @@ -29,9 +29,8 @@ high: column: start: 1 end: 37 - content: logger.info("user info", user.email) + content: "" parent_line_number: 1 - snippet: logger.info("user info", user.email) fingerprint: fa5e03644738e4c17cbbd04a580506b1_0 old_fingerprint: 16c8aedf4ee6fe1f129aec2a9c14310c_0 code_extract: logger.info("user info", user.email) diff --git a/e2e/flags/.snapshots/TestReportFlagsShouldFail-format-jsonv2 b/e2e/flags/.snapshots/TestReportFlagsShouldFail-format-jsonv2 index 393348b95..714bad4cb 100644 --- a/e2e/flags/.snapshots/TestReportFlagsShouldFail-format-jsonv2 +++ b/e2e/flags/.snapshots/TestReportFlagsShouldFail-format-jsonv2 @@ -1,4 +1,4 @@ -{"source":"Bearer","version":"dev","findings":[{"cwe_ids":["42"],"id":"test_ruby_logger","title":"Ruby logger","description":"Ruby logger","documentation_url":"","line_number":1,"full_filename":"e2e/flags/testdata/simple/main.rb","filename":"main.rb","data_type":{"category_uuid":"cef587dd-76db-430b-9e18-7b031e1a193b","name":"Email Address"},"category_groups":["PII","Personal Data"],"source":{"start":1,"end":1,"column":{"start":26,"end":36}},"sink":{"start":1,"end":1,"column":{"start":1,"end":37},"content":"logger.info(\"user info\", user.email)"},"parent_line_number":1,"snippet":"logger.info(\"user info\", user.email)","fingerprint":"fa5e03644738e4c17cbbd04a580506b1_0","old_fingerprint":"8240e1537878783bac845d1163c80555_0","code_extract":"logger.info(\"user info\", user.email)","severity":"high"}]} +{"source":"Bearer","version":"dev","findings":[{"cwe_ids":["42"],"id":"test_ruby_logger","title":"Ruby logger","description":"Ruby logger","documentation_url":"","line_number":1,"full_filename":"e2e/flags/testdata/simple/main.rb","filename":"main.rb","data_type":{"category_uuid":"cef587dd-76db-430b-9e18-7b031e1a193b","name":"Email Address"},"category_groups":["PII","Personal Data"],"source":{"start":1,"end":1,"column":{"start":26,"end":36}},"sink":{"start":1,"end":1,"column":{"start":1,"end":37},"content":""},"parent_line_number":1,"fingerprint":"fa5e03644738e4c17cbbd04a580506b1_0","old_fingerprint":"8240e1537878783bac845d1163c80555_0","code_extract":"logger.info(\"user info\", user.email)","severity":"high"}]} -- Analyzing codebase diff --git a/e2e/rules/.snapshots/TestAuxilary-testdata-data-auxilary b/e2e/rules/.snapshots/TestAuxilary-testdata-data-auxilary index 0fdcc12b5..90e5c793c 100644 --- a/e2e/rules/.snapshots/TestAuxilary-testdata-data-auxilary +++ b/e2e/rules/.snapshots/TestAuxilary-testdata-data-auxilary @@ -39,9 +39,8 @@ low: column: start: 1 end: 44 - content: client.event("user", "logged_in", {}, user) + content: "" parent_line_number: 11 - snippet: client.event("user", "logged_in", {}, user) fingerprint: 68427732321c4df53052a341ac8da647_0 old_fingerprint: 4d54a4b735da21fbdcb2d2662977b033_0 code_extract: client.event("user", "logged_in", {}, user); diff --git a/e2e/rules/.snapshots/TestDisabledRules-testdata-data-disabled_rules b/e2e/rules/.snapshots/TestDisabledRules-testdata-data-disabled_rules index 2e869b19b..47984a6ce 100644 --- a/e2e/rules/.snapshots/TestDisabledRules-testdata-data-disabled_rules +++ b/e2e/rules/.snapshots/TestDisabledRules-testdata-data-disabled_rules @@ -23,9 +23,8 @@ low: column: start: 3 end: 7 - content: sink + content: "" parent_line_number: 7 - snippet: sink fingerprint: eb59f129d5424fb58e3bfcb5bfa83159_0 old_fingerprint: e94b7fee5e58e735f107aa1cb3cfb75b_0 code_extract: ' sink' diff --git a/e2e/rules/.snapshots/TestExpectedRule-testdata-data-expected_rule b/e2e/rules/.snapshots/TestExpectedRule-testdata-data-expected_rule index df0c513f7..837448851 100644 --- a/e2e/rules/.snapshots/TestExpectedRule-testdata-data-expected_rule +++ b/e2e/rules/.snapshots/TestExpectedRule-testdata-data-expected_rule @@ -1,4 +1,4 @@ -{"source":"Bearer","version":"dev","findings":[{"cwe_ids":["319"],"id":"expected_rule","title":"","description":"","documentation_url":"","line_number":3,"full_filename":"e2e/rules/testdata/data/expected_rule/main.rb","filename":"main.rb","source":{"start":3,"end":3,"column":{"start":3,"end":7}},"sink":{"start":3,"end":3,"column":{"start":3,"end":7},"content":"sink"},"parent_line_number":3,"snippet":"sink","fingerprint":"c50ecec7e1fcfba6cce5fcfab129556c_0","old_fingerprint":"6630ae26e5210b1e43bb4c02426e6be7_0","code_extract":" sink","severity":"low"},{"cwe_ids":["319"],"id":"expected_rule","title":"","description":"","documentation_url":"","line_number":8,"full_filename":"e2e/rules/testdata/data/expected_rule/main.rb","filename":"main.rb","source":{"start":8,"end":8,"column":{"start":3,"end":7}},"sink":{"start":8,"end":8,"column":{"start":3,"end":7},"content":"sink"},"parent_line_number":8,"snippet":"sink","fingerprint":"c50ecec7e1fcfba6cce5fcfab129556c_1","old_fingerprint":"6630ae26e5210b1e43bb4c02426e6be7_1","code_extract":" sink","severity":"low"}],"expected_findings":[{"rule_id":"expected_rule","location":{"start":3,"end":3,"column":{"start":3,"end":7}}},{"rule_id":"expected_rule","location":{"start":8,"end":8,"column":{"start":3,"end":7}}}]} +{"source":"Bearer","version":"dev","findings":[{"cwe_ids":["319"],"id":"expected_rule","title":"","description":"","documentation_url":"","line_number":3,"full_filename":"e2e/rules/testdata/data/expected_rule/main.rb","filename":"main.rb","source":{"start":3,"end":3,"column":{"start":3,"end":7}},"sink":{"start":3,"end":3,"column":{"start":3,"end":7},"content":""},"parent_line_number":3,"fingerprint":"c50ecec7e1fcfba6cce5fcfab129556c_0","old_fingerprint":"6630ae26e5210b1e43bb4c02426e6be7_0","code_extract":" sink","severity":"low"},{"cwe_ids":["319"],"id":"expected_rule","title":"","description":"","documentation_url":"","line_number":8,"full_filename":"e2e/rules/testdata/data/expected_rule/main.rb","filename":"main.rb","source":{"start":8,"end":8,"column":{"start":3,"end":7}},"sink":{"start":8,"end":8,"column":{"start":3,"end":7},"content":""},"parent_line_number":8,"fingerprint":"c50ecec7e1fcfba6cce5fcfab129556c_1","old_fingerprint":"6630ae26e5210b1e43bb4c02426e6be7_1","code_extract":" sink","severity":"low"}],"expected_findings":[{"rule_id":"expected_rule","location":{"start":3,"end":3,"column":{"start":3,"end":7}}},{"rule_id":"expected_rule","location":{"start":8,"end":8,"column":{"start":3,"end":7}}}]} -- Analyzing codebase diff --git a/e2e/rules/.snapshots/TestReferenceFilters-testdata-data-reference_filters b/e2e/rules/.snapshots/TestReferenceFilters-testdata-data-reference_filters index d0f6d67d9..017acba9d 100644 --- a/e2e/rules/.snapshots/TestReferenceFilters-testdata-data-reference_filters +++ b/e2e/rules/.snapshots/TestReferenceFilters-testdata-data-reference_filters @@ -23,9 +23,8 @@ high: column: start: 1 end: 6 - content: x.foo + content: "" parent_line_number: 1 - snippet: x.foo fingerprint: df1f6d9ee9f4ee60085d0046163b3701_0 old_fingerprint: 52f7dcd9f1ba09f3a9f8c1ad305c8a89_0 code_extract: x.foo diff --git a/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionSchema-testdata-data-ruby_rails_default_encryption_schema_rb b/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionSchema-testdata-data-ruby_rails_default_encryption_schema_rb index b1339fa73..c2d99290e 100644 --- a/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionSchema-testdata-data-ruby_rails_default_encryption_schema_rb +++ b/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionSchema-testdata-data-ruby_rails_default_encryption_schema_rb @@ -14,7 +14,7 @@ warning: ## Resources - [Ruby on Rails Active Record encryption](https://guides.rubyonrails.org/active_record_encryption.html) documentation_url: "" - line_number: 4 + line_number: 3 full_filename: e2e/rules/testdata/data/ruby_rails_default_encryption_schema_rb/db/schema.rb filename: db/schema.rb category_groups: @@ -22,11 +22,11 @@ warning: - Personal Data source: location: - start: 4 - end: 4 + start: 3 + end: 3 column: start: 14 - end: 20 + end: 21 sink: location: start: 2 @@ -34,25 +34,57 @@ warning: column: start: 3 end: 6 - content: |- - create_table "users", force: :cascade do |t| - t.string "email", null: false - t.string "name" - t.string "encrypted_password", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end + content: "" parent_line_number: 2 - snippet: |- - create_table "users", force: :cascade do |t| + fingerprint: a6e77c6d42db8f03ffbe5acae290f72c_0 + old_fingerprint: 4b6d6e98ae7d9908efdf9a7984c7db05_0 + code_extract: |4- + create_table "users", force: :cascade do |t| t.string "email", null: false t.string "name" t.string "encrypted_password", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end - fingerprint: a6e77c6d42db8f03ffbe5acae290f72c_0 - old_fingerprint: 4b6d6e98ae7d9908efdf9a7984c7db05_0 + - rule: + cwe_ids: + - "312" + id: ruby_rails_default_encryption + title: Missing application-level encryption of sensitive data detected. + description: | + ## Description + Application-level encryption greatly reduces the risk of a data breach or data leak by making data unreadable. This rule checks if sensitive data types found in records are encrypted. + + ## Remediations + Whenever storing sensitive data to a datastore, make sure to encrypt the entire record, or the field itself. + + ## Resources + - [Ruby on Rails Active Record encryption](https://guides.rubyonrails.org/active_record_encryption.html) + documentation_url: "" + line_number: 4 + full_filename: e2e/rules/testdata/data/ruby_rails_default_encryption_schema_rb/db/schema.rb + filename: db/schema.rb + category_groups: + - PII + - Personal Data + source: + location: + start: 4 + end: 4 + column: + start: 14 + end: 20 + sink: + location: + start: 2 + end: 8 + column: + start: 3 + end: 6 + content: "" + parent_line_number: 2 + fingerprint: a6e77c6d42db8f03ffbe5acae290f72c_1 + old_fingerprint: 4b6d6e98ae7d9908efdf9a7984c7db05_1 code_extract: |4- create_table "users", force: :cascade do |t| t.string "email", null: false diff --git a/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionStructure-testdata-data-ruby_rails_default_encryption_structure_sql b/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionStructure-testdata-data-ruby_rails_default_encryption_structure_sql index 0e057532b..8ec2c167c 100644 --- a/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionStructure-testdata-data-ruby_rails_default_encryption_structure_sql +++ b/e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionStructure-testdata-data-ruby_rails_default_encryption_structure_sql @@ -34,17 +34,11 @@ warning: column: start: 1 end: 2 - content: |- - CREATE TABLE public.users ( - id bigint NOT NULL, - name character varying, - password character varying, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - email character varying DEFAULT ''::character varying NOT NULL - ) + content: "" parent_line_number: 1 - snippet: |- + fingerprint: e5e17cede9a731da09a639c9c78af007_0 + old_fingerprint: 86b02d158d5ef7e6b68f6979f4f789aa_0 + code_extract: |- CREATE TABLE public.users ( id bigint NOT NULL, name character varying, @@ -52,9 +46,46 @@ warning: created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, email character varying DEFAULT ''::character varying NOT NULL - ) - fingerprint: e5e17cede9a731da09a639c9c78af007_0 - old_fingerprint: 86b02d158d5ef7e6b68f6979f4f789aa_0 + ); + - rule: + cwe_ids: + - "312" + id: ruby_rails_default_encryption + title: Missing application-level encryption of sensitive data detected. + description: | + ## Description + Application-level encryption greatly reduces the risk of a data breach or data leak by making data unreadable. This rule checks if sensitive data types found in records are encrypted. + + ## Remediations + Whenever storing sensitive data to a datastore, make sure to encrypt the entire record, or the field itself. + + ## Resources + - [Ruby on Rails Active Record encryption](https://guides.rubyonrails.org/active_record_encryption.html) + documentation_url: "" + line_number: 7 + full_filename: e2e/rules/testdata/data/ruby_rails_default_encryption_structure_sql/db/structure.sql + filename: db/structure.sql + category_groups: + - PII + - Personal Data + source: + location: + start: 7 + end: 7 + column: + start: 3 + end: 8 + sink: + location: + start: 1 + end: 8 + column: + start: 1 + end: 2 + content: "" + parent_line_number: 1 + fingerprint: e5e17cede9a731da09a639c9c78af007_1 + old_fingerprint: 86b02d158d5ef7e6b68f6979f4f789aa_1 code_extract: |- CREATE TABLE public.users ( id bigint NOT NULL, diff --git a/e2e/rules/.snapshots/TestSanitizer-testdata-data-sanitizer b/e2e/rules/.snapshots/TestSanitizer-testdata-data-sanitizer index 7f654772f..fafb512ec 100644 --- a/e2e/rules/.snapshots/TestSanitizer-testdata-data-sanitizer +++ b/e2e/rules/.snapshots/TestSanitizer-testdata-data-sanitizer @@ -29,9 +29,8 @@ high: column: start: 1 end: 24 - content: log("abc" + user.email) + content: "" parent_line_number: 4 - snippet: log("abc" + user.email) fingerprint: 6c505050fabde2c4ed17380d19fab254_0 old_fingerprint: d2e829ba86a33c5a52844641617ad8a7_0 code_extract: log("abc" + user.email) @@ -65,9 +64,8 @@ high: column: start: 1 end: 15 - content: log("abc" + x) + content: "" parent_line_number: 5 - snippet: log("abc" + x) fingerprint: 6c505050fabde2c4ed17380d19fab254_1 old_fingerprint: d2e829ba86a33c5a52844641617ad8a7_1 code_extract: log("abc" + x) diff --git a/e2e/rules/.snapshots/TestSecrets-secrets b/e2e/rules/.snapshots/TestSecrets-secrets index fae5375dc..04b882de7 100644 --- a/e2e/rules/.snapshots/TestSecrets-secrets +++ b/e2e/rules/.snapshots/TestSecrets-secrets @@ -33,9 +33,8 @@ high: column: start: 24 end: 60 - content: ' @private_key ||= ''-----BEGIN PGP PRIVATE KEY BLOCK-----asdf-----END PGP PRIVATE KEY BLOCK-----''' + content: "" parent_line_number: 3 - snippet: ' @private_key ||= ''-----BEGIN PGP PRIVATE KEY BLOCK-----asdf-----END PGP PRIVATE KEY BLOCK-----''' fingerprint: d0914f16c16550b40063c4f3fb14839e_0 old_fingerprint: 47146043fab58ba5fc86fd0c716b20d8_0 detailed_context: PGP private key diff --git a/e2e/rules/.snapshots/TestSimpleRuby-testdata-data-simple_ruby b/e2e/rules/.snapshots/TestSimpleRuby-testdata-data-simple_ruby index 018419c6f..c6c3050ea 100644 --- a/e2e/rules/.snapshots/TestSimpleRuby-testdata-data-simple_ruby +++ b/e2e/rules/.snapshots/TestSimpleRuby-testdata-data-simple_ruby @@ -42,9 +42,8 @@ low: column: start: 5 end: 29 - content: config.force_ssl = false + content: "" parent_line_number: 7 - snippet: config.force_ssl = false fingerprint: 52ee98cc601d1c1bd772ff548ee32425_0 old_fingerprint: 28ca51516a8b388cb7065c1f0df8b093_0 code_extract: ' config.force_ssl = false' diff --git a/internal/commands/process/settings/policies/common.rego b/internal/commands/process/settings/policies/common.rego index 702d1c355..8a9bf6d64 100644 --- a/internal/commands/process/settings/policies/common.rego +++ b/internal/commands/process/settings/policies/common.rego @@ -8,7 +8,6 @@ build_item(location) := { "sink": { "start": location.source.start_line_number, "end": location.source.end_line_number, - "content": location.source.content, "column": { "start": location.source.start_column_number, "end": location.source.end_column_number, @@ -49,7 +48,6 @@ build_local_item(location, data_type) := { "sink": { "start": location.source.start_line_number, "end": location.source.end_line_number, - "content": location.source.content, "column": { "start": location.source.start_column_number, "end": location.source.end_column_number, @@ -75,7 +73,6 @@ build_item(location) := { "sink": { "start": location.source.start_line_number, "end": location.source.end_line_number, - "content": location.source.content, "column": { "start": location.source.start_column_number, "end": location.source.end_column_number, diff --git a/internal/commands/process/settings/policies/risk_policy.rego b/internal/commands/process/settings/policies/risk_policy.rego index 8a05d7f85..9f066e22c 100644 --- a/internal/commands/process/settings/policies/risk_policy.rego +++ b/internal/commands/process/settings/policies/risk_policy.rego @@ -155,7 +155,6 @@ policy_failure contains item if { "sink": { "start": location.source.start_line_number, "end": location.source.end_line_number, - "content": location.source.content, "column": { "start": location.source.start_column_number, "end": location.source.end_column_number, diff --git a/internal/detectors/custom/custom.go b/internal/detectors/custom/custom.go index 4e12f029a..e5fa83203 100644 --- a/internal/detectors/custom/custom.go +++ b/internal/detectors/custom/custom.go @@ -307,8 +307,6 @@ func (detector *Detector) extractData(captures []parser.Captures, rule config.Co if rule.DetectPresence { content := capture["rule"].Source(false) - content.Text = &rule.Pattern - var schemaSource *schema.Source var source source.Source if !rule.OmitParent { @@ -318,7 +316,6 @@ func (detector *Detector) extractData(captures []parser.Captures, rule config.Co EndLineNumber: *source.EndLineNumber, StartColumnNumber: *source.StartColumnNumber, EndColumnNumber: *source.EndColumnNumber, - Content: *source.Text, } } else { source = capture["rule"].Source(false) diff --git a/internal/detectors/simple/.snapshots/TestBuildReportInterfaces b/internal/detectors/simple/.snapshots/TestBuildReportInterfaces index 1f131d617..56ed980fd 100644 --- a/internal/detectors/simple/.snapshots/TestBuildReportInterfaces +++ b/internal/detectors/simple/.snapshots/TestBuildReportInterfaces @@ -13,7 +13,7 @@ StartColumnNumber: (*int)(14), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=23) "https://url.example.com") + Text: (*string)() }, Value: (interfaces.Interface) { Type: (interfaces.Type) (len=3) "url", @@ -42,7 +42,7 @@ StartColumnNumber: (*int)(14), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=35) "https://multi-a.example.com/foo?x=1") + Text: (*string)() }, Value: (interfaces.Interface) { Type: (interfaces.Type) (len=3) "url", @@ -71,7 +71,7 @@ StartColumnNumber: (*int)(53), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=31) "https://multi-b.example.com/bar") + Text: (*string)() }, Value: (interfaces.Interface) { Type: (interfaces.Type) (len=3) "url", @@ -100,7 +100,7 @@ StartColumnNumber: (*int)(0), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=38) "https://port1.example.com:3000/foo?x=1") + Text: (*string)() }, Value: (interfaces.Interface) { Type: (interfaces.Type) (len=3) "url", @@ -129,7 +129,7 @@ StartColumnNumber: (*int)(39), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=30) "https://port2.example.com:3000") + Text: (*string)() }, Value: (interfaces.Interface) { Type: (interfaces.Type) (len=3) "url", @@ -158,7 +158,7 @@ StartColumnNumber: (*int)(1), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=23) "http://link.example.com") + Text: (*string)() }, Value: (interfaces.Interface) { Type: (interfaces.Type) (len=3) "url", diff --git a/internal/detectors/simple/simple.go b/internal/detectors/simple/simple.go index 3823cb03c..f80b73b64 100644 --- a/internal/detectors/simple/simple.go +++ b/internal/detectors/simple/simple.go @@ -109,7 +109,6 @@ func extractURLs(fileInfo *file.FileInfo, line string, lineNumber int, report re LanguageType: fileInfo.LanguageTypeString(), StartLineNumber: &lineNumber, StartColumnNumber: pointers.Int(globalOffset + startOffset), - Text: &url, }) } diff --git a/internal/detectors/spring/.snapshots/TestBuildReportDataStores b/internal/detectors/spring/.snapshots/TestBuildReportDataStores index 50c99b500..227e0b511 100644 --- a/internal/detectors/spring/.snapshots/TestBuildReportDataStores +++ b/internal/detectors/spring/.snapshots/TestBuildReportDataStores @@ -13,7 +13,7 @@ StartColumnNumber: (*int)(), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=33) "spring.datasource.url=jdbc:h2:dev") + Text: (*string)() }, Value: (spring.DataStore) { Driver: (string) (len=2) "h2" @@ -53,7 +53,7 @@ StartColumnNumber: (*int)(), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=57) "spring.datasource.driver-class-name=com.mysql.jdbc.Driver") + Text: (*string)() }, Value: (spring.DataStore) { Driver: (string) (len=21) "com.mysql.jdbc.Driver" @@ -93,7 +93,7 @@ StartColumnNumber: (*int)(), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=60) "spring.datasource.driverClassName=com.postgresql.jdbc.Driver") + Text: (*string)() }, Value: (spring.DataStore) { Driver: (string) (len=26) "com.postgresql.jdbc.Driver" @@ -133,7 +133,7 @@ StartColumnNumber: (*int)(), EndLineNumber: (*int)(), EndColumnNumber: (*int)(), - Text: (*string)((len=31) "spring.datasource.url=${DB_URL}") + Text: (*string)() }, Value: (spring.DataStore) { Driver: (string) "" diff --git a/internal/detectors/spring/spring.go b/internal/detectors/spring/spring.go index 7ab81882a..9c6f807fd 100644 --- a/internal/detectors/spring/spring.go +++ b/internal/detectors/spring/spring.go @@ -142,7 +142,6 @@ func extractDataStoresFromProperties(file *file.FileInfo, report report.Report) LanguageType: file.LanguageTypeString(), Filename: file.RelativePath, StartLineNumber: &property.lineNumber, - Text: &property.text, }) return nil diff --git a/internal/languages/golang/.snapshots/TestScope--scope.yml b/internal/languages/golang/.snapshots/TestScope--scope.yml index 91c1dcdc1..51666efd6 100644 --- a/internal/languages/golang/.snapshots/TestScope--scope.yml +++ b/internal/languages/golang/.snapshots/TestScope--scope.yml @@ -23,9 +23,8 @@ high: column: start: 2 end: 40 - content: scopeCursor(request.FormValue("oops")) + content: "" parent_line_number: 15 - snippet: scopeCursor(request.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_0 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 2 end: 40 - content: scopeNested(request.FormValue("oops")) + content: "" parent_line_number: 18 - snippet: scopeNested(request.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_1 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 2 end: 44 - content: scopeNested(x + request.FormValue("oops")) + content: "" parent_line_number: 19 - snippet: scopeNested(x + request.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_2 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 2 end: 43 - content: scopeNested(y[request.FormValue("oops")]) + content: "" parent_line_number: 20 - snippet: scopeNested(y[request.FormValue("oops")]) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_3 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 2 end: 40 - content: scopeResult(request.FormValue("oops")) + content: "" parent_line_number: 22 - snippet: scopeResult(request.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_4 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_4 - rule: @@ -168,9 +163,8 @@ high: column: start: 2 end: 44 - content: scopeResult(x + request.FormValue("oops")) + content: "" parent_line_number: 23 - snippet: scopeResult(x + request.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_5 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_5 - rule: @@ -197,9 +191,8 @@ high: column: start: 2 end: 36 - content: scopeCursor(req.FormValue("oops")) + content: "" parent_line_number: 32 - snippet: scopeCursor(req.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_6 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_6 - rule: @@ -226,9 +219,8 @@ high: column: start: 2 end: 36 - content: scopeNested(req.FormValue("oops")) + content: "" parent_line_number: 35 - snippet: scopeNested(req.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_7 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_7 - rule: @@ -255,9 +247,8 @@ high: column: start: 2 end: 40 - content: scopeNested(x + req.FormValue("oops")) + content: "" parent_line_number: 36 - snippet: scopeNested(x + req.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_8 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_8 - rule: @@ -284,9 +275,8 @@ high: column: start: 2 end: 39 - content: scopeNested(y[req.FormValue("oops")]) + content: "" parent_line_number: 37 - snippet: scopeNested(y[req.FormValue("oops")]) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_9 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_9 - rule: @@ -313,9 +303,8 @@ high: column: start: 2 end: 36 - content: scopeResult(req.FormValue("oops")) + content: "" parent_line_number: 39 - snippet: scopeResult(req.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_10 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_10 - rule: @@ -342,9 +331,8 @@ high: column: start: 2 end: 40 - content: scopeResult(x + req.FormValue("oops")) + content: "" parent_line_number: 40 - snippet: scopeResult(x + req.FormValue("oops")) fingerprint: c87422d3d7e0f39d979f1dd26df088d6_11 old_fingerprint: c87422d3d7e0f39d979f1dd26df088d6_11 diff --git a/internal/languages/golang/.snapshots/flow/TestFlow--different-line.yml b/internal/languages/golang/.snapshots/flow/TestFlow--different-line.yml index 674c727e9..5670980f4 100644 --- a/internal/languages/golang/.snapshots/flow/TestFlow--different-line.yml +++ b/internal/languages/golang/.snapshots/flow/TestFlow--different-line.yml @@ -28,9 +28,8 @@ low: column: start: 2 end: 23 - content: log.Error().Msg(name) + content: "" parent_line_number: 29 - snippet: log.Error().Msg(name) fingerprint: f8cb961f0fc2f87d026bf9f5db408736_0 old_fingerprint: f8cb961f0fc2f87d026bf9f5db408736_0 - rule: @@ -62,9 +61,8 @@ low: column: start: 2 end: 24 - content: log.Error().Msg(other) + content: "" parent_line_number: 30 - snippet: log.Error().Msg(other) fingerprint: f8cb961f0fc2f87d026bf9f5db408736_1 old_fingerprint: f8cb961f0fc2f87d026bf9f5db408736_1 - rule: @@ -96,9 +94,8 @@ low: column: start: 2 end: 23 - content: log.Error().Msg(user) + content: "" parent_line_number: 31 - snippet: log.Error().Msg(user) fingerprint: f8cb961f0fc2f87d026bf9f5db408736_2 old_fingerprint: f8cb961f0fc2f87d026bf9f5db408736_2 diff --git a/internal/languages/golang/.snapshots/flow/TestFlow--same-line.yml b/internal/languages/golang/.snapshots/flow/TestFlow--same-line.yml index fa64148cc..c5ae32d81 100644 --- a/internal/languages/golang/.snapshots/flow/TestFlow--same-line.yml +++ b/internal/languages/golang/.snapshots/flow/TestFlow--same-line.yml @@ -28,9 +28,8 @@ low: column: start: 2 end: 28 - content: log.Error().Msg(user.Name) + content: "" parent_line_number: 19 - snippet: log.Error().Msg(user.Name) fingerprint: 03b8fc38b73518ac9530e238e3db6896_0 old_fingerprint: 03b8fc38b73518ac9530e238e3db6896_0 - rule: @@ -62,9 +61,8 @@ low: column: start: 2 end: 34 - content: log.Error().Msg(user.FullName()) + content: "" parent_line_number: 20 - snippet: log.Error().Msg(user.FullName()) fingerprint: 03b8fc38b73518ac9530e238e3db6896_1 old_fingerprint: 03b8fc38b73518ac9530e238e3db6896_1 - rule: @@ -96,9 +94,8 @@ low: column: start: 2 end: 51 - content: log.Error().Msgf("user info %s", user.FullName()) + content: "" parent_line_number: 21 - snippet: log.Error().Msgf("user info %s", user.FullName()) fingerprint: 03b8fc38b73518ac9530e238e3db6896_2 old_fingerprint: 03b8fc38b73518ac9530e238e3db6896_2 diff --git a/internal/languages/java/.snapshots/TestScope--scope.yml b/internal/languages/java/.snapshots/TestScope--scope.yml index 5b805a515..1ddcbdfc2 100644 --- a/internal/languages/java/.snapshots/TestScope--scope.yml +++ b/internal/languages/java/.snapshots/TestScope--scope.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 42 - content: scopeCursor(request.getParameter("oops")) + content: "" parent_line_number: 1 - snippet: scopeCursor(request.getParameter("oops")) fingerprint: bdbeee20feb34c6881d975716e2fe09f_0 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 50 - content: 'scopeCursor(x ? request.getParameter("oops") : y)' + content: "" parent_line_number: 3 - snippet: 'scopeCursor(x ? request.getParameter("oops") : y)' fingerprint: bdbeee20feb34c6881d975716e2fe09f_1 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 1 end: 42 - content: scopeNested(request.getParameter("oops")) + content: "" parent_line_number: 6 - snippet: scopeNested(request.getParameter("oops")) fingerprint: bdbeee20feb34c6881d975716e2fe09f_2 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 1 end: 46 - content: scopeNested(x + request.getParameter("oops")) + content: "" parent_line_number: 7 - snippet: scopeNested(x + request.getParameter("oops")) fingerprint: bdbeee20feb34c6881d975716e2fe09f_3 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 1 end: 50 - content: 'scopeNested(x ? request.getParameter("oops") : y)' + content: "" parent_line_number: 8 - snippet: 'scopeNested(x ? request.getParameter("oops") : y)' fingerprint: bdbeee20feb34c6881d975716e2fe09f_4 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_4 - rule: @@ -168,9 +163,8 @@ high: column: start: 1 end: 50 - content: 'scopeNested(request.getParameter("oops") ? x : y)' + content: "" parent_line_number: 9 - snippet: 'scopeNested(request.getParameter("oops") ? x : y)' fingerprint: bdbeee20feb34c6881d975716e2fe09f_5 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_5 - rule: @@ -197,9 +191,8 @@ high: column: start: 1 end: 42 - content: scopeResult(request.getParameter("oops")) + content: "" parent_line_number: 11 - snippet: scopeResult(request.getParameter("oops")) fingerprint: bdbeee20feb34c6881d975716e2fe09f_6 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_6 - rule: @@ -226,9 +219,8 @@ high: column: start: 1 end: 46 - content: scopeResult(x + request.getParameter("oops")) + content: "" parent_line_number: 12 - snippet: scopeResult(x + request.getParameter("oops")) fingerprint: bdbeee20feb34c6881d975716e2fe09f_7 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_7 - rule: @@ -255,9 +247,8 @@ high: column: start: 1 end: 50 - content: 'scopeResult(x ? request.getParameter("oops") : y)' + content: "" parent_line_number: 13 - snippet: 'scopeResult(x ? request.getParameter("oops") : y)' fingerprint: bdbeee20feb34c6881d975716e2fe09f_8 old_fingerprint: bdbeee20feb34c6881d975716e2fe09f_8 diff --git a/internal/languages/java/.snapshots/flow/TestFlow--different-line.yml b/internal/languages/java/.snapshots/flow/TestFlow--different-line.yml index 59da85142..51a678eda 100644 --- a/internal/languages/java/.snapshots/flow/TestFlow--different-line.yml +++ b/internal/languages/java/.snapshots/flow/TestFlow--different-line.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 19 - content: logger.error(name) + content: "" parent_line_number: 3 - snippet: logger.error(name) fingerprint: b08f2b317021ef0197dc9286477e251d_0 old_fingerprint: b08f2b317021ef0197dc9286477e251d_0 diff --git a/internal/languages/java/.snapshots/flow/TestFlow--same-line.yml b/internal/languages/java/.snapshots/flow/TestFlow--same-line.yml index cf55c2966..6e76c97b9 100644 --- a/internal/languages/java/.snapshots/flow/TestFlow--same-line.yml +++ b/internal/languages/java/.snapshots/flow/TestFlow--same-line.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 24 - content: logger.error(user.name) + content: "" parent_line_number: 1 - snippet: logger.error(user.name) fingerprint: b000c2a9a82d59a1e826bc709cca9307_0 old_fingerprint: b000c2a9a82d59a1e826bc709cca9307_0 diff --git a/internal/languages/javascript/.snapshots/TestPatternVariables--main.yml b/internal/languages/javascript/.snapshots/TestPatternVariables--main.yml index 53c47a27f..3df2fdc33 100644 --- a/internal/languages/javascript/.snapshots/TestPatternVariables--main.yml +++ b/internal/languages/javascript/.snapshots/TestPatternVariables--main.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 27 - content: const matchedVariable = 42 + content: "" parent_line_number: 1 - snippet: const matchedVariable = 42 fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_0 old_fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 32 - content: import x from "matched_package" + content: "" parent_line_number: 4 - snippet: import x from "matched_package" fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_1 old_fingerprint: 5cac1aedf89257ee57d014d2ccc8d328_1 diff --git a/internal/languages/javascript/.snapshots/TestScope--scope.yml b/internal/languages/javascript/.snapshots/TestScope--scope.yml index 83bb6f378..90d5a4d12 100644 --- a/internal/languages/javascript/.snapshots/TestScope--scope.yml +++ b/internal/languages/javascript/.snapshots/TestScope--scope.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 29 - content: scopeCursor(req.params.oops) + content: "" parent_line_number: 1 - snippet: scopeCursor(req.params.oops) fingerprint: 408407aa362e0520faf6b66c3d59bb8c_0 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 37 - content: 'scopeCursor(x ? req.params.oops : y)' + content: "" parent_line_number: 3 - snippet: 'scopeCursor(x ? req.params.oops : y)' fingerprint: 408407aa362e0520faf6b66c3d59bb8c_1 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 1 end: 29 - content: scopeNested(req.params.oops) + content: "" parent_line_number: 6 - snippet: scopeNested(req.params.oops) fingerprint: 408407aa362e0520faf6b66c3d59bb8c_2 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 1 end: 33 - content: scopeResult(req.params.oops + x) + content: "" parent_line_number: 7 - snippet: scopeResult(req.params.oops + x) fingerprint: 408407aa362e0520faf6b66c3d59bb8c_3 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 1 end: 37 - content: 'scopeNested(x ? req.params.oops : y)' + content: "" parent_line_number: 8 - snippet: 'scopeNested(x ? req.params.oops : y)' fingerprint: 408407aa362e0520faf6b66c3d59bb8c_4 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_4 - rule: @@ -168,9 +163,8 @@ high: column: start: 1 end: 37 - content: 'scopeNested(req.params.oops ? x : y)' + content: "" parent_line_number: 9 - snippet: 'scopeNested(req.params.oops ? x : y)' fingerprint: 408407aa362e0520faf6b66c3d59bb8c_5 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_5 - rule: @@ -197,9 +191,8 @@ high: column: start: 1 end: 29 - content: scopeResult(req.params.oops) + content: "" parent_line_number: 11 - snippet: scopeResult(req.params.oops) fingerprint: 408407aa362e0520faf6b66c3d59bb8c_6 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_6 - rule: @@ -226,9 +219,8 @@ high: column: start: 1 end: 33 - content: scopeResult(req.params.oops + x) + content: "" parent_line_number: 12 - snippet: scopeResult(req.params.oops + x) fingerprint: 408407aa362e0520faf6b66c3d59bb8c_7 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_7 - rule: @@ -255,9 +247,8 @@ high: column: start: 1 end: 37 - content: 'scopeResult(x ? req.params.oops : y)' + content: "" parent_line_number: 13 - snippet: 'scopeResult(x ? req.params.oops : y)' fingerprint: 408407aa362e0520faf6b66c3d59bb8c_8 old_fingerprint: 408407aa362e0520faf6b66c3d59bb8c_8 diff --git a/internal/languages/javascript/.snapshots/flow/TestFlow--assigment-expression.yml b/internal/languages/javascript/.snapshots/flow/TestFlow--assigment-expression.yml index d2e314be1..a1ff6081b 100644 --- a/internal/languages/javascript/.snapshots/flow/TestFlow--assigment-expression.yml +++ b/internal/languages/javascript/.snapshots/flow/TestFlow--assigment-expression.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 18 - content: console.log(user) + content: "" parent_line_number: 2 - snippet: console.log(user) fingerprint: 3c919e47299fa396f901d19edaad859c_0 old_fingerprint: 3c919e47299fa396f901d19edaad859c_0 diff --git a/internal/languages/javascript/.snapshots/flow/TestFlow--variable-declarator.yml b/internal/languages/javascript/.snapshots/flow/TestFlow--variable-declarator.yml index 6ec680157..75ff24e9a 100644 --- a/internal/languages/javascript/.snapshots/flow/TestFlow--variable-declarator.yml +++ b/internal/languages/javascript/.snapshots/flow/TestFlow--variable-declarator.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 18 - content: console.log(user) + content: "" parent_line_number: 2 - snippet: console.log(user) fingerprint: 5d86ec557137111caf0eca9a7d304c91_0 old_fingerprint: 5d86ec557137111caf0eca9a7d304c91_0 diff --git a/internal/languages/javascript/.snapshots/import/TestImport--import.yml b/internal/languages/javascript/.snapshots/import/TestImport--import.yml index acdaa689b..36d6aa118 100644 --- a/internal/languages/javascript/.snapshots/import/TestImport--import.yml +++ b/internal/languages/javascript/.snapshots/import/TestImport--import.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 8 - content: lib.f() + content: "" parent_line_number: 4 - snippet: lib.f() fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_0 old_fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 4 - content: f() + content: "" parent_line_number: 5 - snippet: f() fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_1 old_fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 1 end: 4 - content: x() + content: "" parent_line_number: 6 - snippet: x() fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_2 old_fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 1 end: 6 - content: y.f() + content: "" parent_line_number: 9 - snippet: y.f() fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_3 old_fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 1 end: 4 - content: f() + content: "" parent_line_number: 11 - snippet: f() fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_4 old_fingerprint: 23ce8eb29bdfc7d63841656df3d9ae27_4 diff --git a/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--deconstructing.yml b/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--deconstructing.yml index e5a0aa890..c021aadb1 100644 --- a/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--deconstructing.yml +++ b/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--deconstructing.yml @@ -22,9 +22,8 @@ low: column: start: 9 end: 13 - content: user + content: "" parent_line_number: 1 - snippet: user fingerprint: 391f0431340399f3f30398341feeb70a_0 old_fingerprint: 391f0431340399f3f30398341feeb70a_0 diff --git a/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--multiple_objects.yml b/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--multiple_objects.yml index 922d7ead5..36586b6bf 100644 --- a/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--multiple_objects.yml +++ b/internal/languages/javascript/.snapshots/object-deconstructing/TestObjectDeconstructing--multiple_objects.yml @@ -22,9 +22,8 @@ low: column: start: 9 end: 13 - content: user + content: "" parent_line_number: 1 - snippet: user fingerprint: 83d173c5a31e8a9fc4b42968d18f584f_0 old_fingerprint: 83d173c5a31e8a9fc4b42968d18f584f_0 diff --git a/internal/languages/javascript/.snapshots/string/TestString--concatanation.yml b/internal/languages/javascript/.snapshots/string/TestString--concatanation.yml index d31b75b08..7cad6827c 100644 --- a/internal/languages/javascript/.snapshots/string/TestString--concatanation.yml +++ b/internal/languages/javascript/.snapshots/string/TestString--concatanation.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 39 - content: console.log("ht" + "tp://", user.name) + content: "" parent_line_number: 1 - snippet: console.log("ht" + "tp://", user.name) fingerprint: 272ebbd3e69ab1032f6fb14b69a79ae8_0 old_fingerprint: 272ebbd3e69ab1032f6fb14b69a79ae8_0 diff --git a/internal/languages/javascript/.snapshots/string/TestString--simple.yml b/internal/languages/javascript/.snapshots/string/TestString--simple.yml index a6459e15e..853643f61 100644 --- a/internal/languages/javascript/.snapshots/string/TestString--simple.yml +++ b/internal/languages/javascript/.snapshots/string/TestString--simple.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 34 - content: console.log("http://", user.name) + content: "" parent_line_number: 1 - snippet: console.log("http://", user.name) fingerprint: 971b852ae8266c6d2b25437584017e2c_0 old_fingerprint: 971b852ae8266c6d2b25437584017e2c_0 diff --git a/internal/languages/javascript/.snapshots/string/TestString--single-quotes.yml b/internal/languages/javascript/.snapshots/string/TestString--single-quotes.yml index f3980deaf..3bd0c8d1c 100644 --- a/internal/languages/javascript/.snapshots/string/TestString--single-quotes.yml +++ b/internal/languages/javascript/.snapshots/string/TestString--single-quotes.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 34 - content: console.log('http://', user.name) + content: "" parent_line_number: 2 - snippet: console.log('http://', user.name) fingerprint: d85fed5722eb11c71ff861517e929da1_0 old_fingerprint: d85fed5722eb11c71ff861517e929da1_0 diff --git a/internal/languages/javascript/.snapshots/string/TestString--template-variable-reconciliation.yml b/internal/languages/javascript/.snapshots/string/TestString--template-variable-reconciliation.yml index 95678e6c7..9cb158f13 100644 --- a/internal/languages/javascript/.snapshots/string/TestString--template-variable-reconciliation.yml +++ b/internal/languages/javascript/.snapshots/string/TestString--template-variable-reconciliation.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 51 - content: console.log(`h${path}${config.domain}`, user.name) + content: "" parent_line_number: 3 - snippet: console.log(`h${path}${config.domain}`, user.name) fingerprint: bbac16a148474689a2cb1b5e2d40ada2_0 old_fingerprint: bbac16a148474689a2cb1b5e2d40ada2_0 diff --git a/internal/languages/javascript/.snapshots/string/TestString--template.yml b/internal/languages/javascript/.snapshots/string/TestString--template.yml index fd47b736e..30ede8ea3 100644 --- a/internal/languages/javascript/.snapshots/string/TestString--template.yml +++ b/internal/languages/javascript/.snapshots/string/TestString--template.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 50 - content: console.log(`http://${config.domain}`, user.name) + content: "" parent_line_number: 1 - snippet: console.log(`http://${config.domain}`, user.name) fingerprint: 5f1137c9ab0489aed97dddee99bff779_0 old_fingerprint: 5f1137c9ab0489aed97dddee99bff779_0 diff --git a/internal/languages/javascript/pattern/pattern.go b/internal/languages/javascript/pattern/pattern.go index 97bba6abb..40d086938 100644 --- a/internal/languages/javascript/pattern/pattern.go +++ b/internal/languages/javascript/pattern/pattern.go @@ -65,7 +65,7 @@ func (*Pattern) ExtractVariables(input string) (string, []language.PatternVariab return replaced, params, nil } -func produceDummyValue(i int, nodeType string) string { +func produceDummyValue(i int, _ string) string { return "BearerVar" + fmt.Sprint(i) } diff --git a/internal/languages/php/.snapshots/TestConst--main.yml b/internal/languages/php/.snapshots/TestConst--main.yml index 27d00153f..a86d4ddd5 100644 --- a/internal/languages/php/.snapshots/TestConst--main.yml +++ b/internal/languages/php/.snapshots/TestConst--main.yml @@ -22,9 +22,8 @@ low: column: start: 10 end: 38 - content: hash( self::ALGO, $content ) + content: "" parent_line_number: 9 - snippet: hash( self::ALGO, $content ) fingerprint: b1e6825cdfdbf302da0f7c9887efd995_0 old_fingerprint: b1e6825cdfdbf302da0f7c9887efd995_0 diff --git a/internal/languages/php/.snapshots/TestScope--scope.yml b/internal/languages/php/.snapshots/TestScope--scope.yml index 5ce3bb43c..49e974cea 100644 --- a/internal/languages/php/.snapshots/TestScope--scope.yml +++ b/internal/languages/php/.snapshots/TestScope--scope.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 27 - content: scopeCursor($_GET["oops"]) + content: "" parent_line_number: 2 - snippet: scopeCursor($_GET["oops"]) fingerprint: d065246ff18b050df029893f5d9a667b_0 old_fingerprint: d065246ff18b050df029893f5d9a667b_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 35 - content: 'scopeCursor(x ? $_GET["oops"] : y)' + content: "" parent_line_number: 4 - snippet: 'scopeCursor(x ? $_GET["oops"] : y)' fingerprint: d065246ff18b050df029893f5d9a667b_1 old_fingerprint: d065246ff18b050df029893f5d9a667b_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 1 end: 32 - content: 'scopeCursor($_GET["oops"] ?: y)' + content: "" parent_line_number: 6 - snippet: 'scopeCursor($_GET["oops"] ?: y)' fingerprint: d065246ff18b050df029893f5d9a667b_2 old_fingerprint: d065246ff18b050df029893f5d9a667b_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 1 end: 27 - content: scopeNested($_GET["oops"]) + content: "" parent_line_number: 8 - snippet: scopeNested($_GET["oops"]) fingerprint: d065246ff18b050df029893f5d9a667b_3 old_fingerprint: d065246ff18b050df029893f5d9a667b_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 1 end: 31 - content: scopeNested(x . $_GET["oops"]) + content: "" parent_line_number: 9 - snippet: scopeNested(x . $_GET["oops"]) fingerprint: d065246ff18b050df029893f5d9a667b_4 old_fingerprint: d065246ff18b050df029893f5d9a667b_4 - rule: @@ -168,9 +163,8 @@ high: column: start: 1 end: 35 - content: 'scopeNested(x ? $_GET["oops"] : y)' + content: "" parent_line_number: 10 - snippet: 'scopeNested(x ? $_GET["oops"] : y)' fingerprint: d065246ff18b050df029893f5d9a667b_5 old_fingerprint: d065246ff18b050df029893f5d9a667b_5 - rule: @@ -197,9 +191,8 @@ high: column: start: 1 end: 35 - content: 'scopeNested($_GET["oops"] ? x : y)' + content: "" parent_line_number: 11 - snippet: 'scopeNested($_GET["oops"] ? x : y)' fingerprint: d065246ff18b050df029893f5d9a667b_6 old_fingerprint: d065246ff18b050df029893f5d9a667b_6 - rule: @@ -226,9 +219,8 @@ high: column: start: 1 end: 32 - content: 'scopeNested($_GET["oops"] ?: y)' + content: "" parent_line_number: 12 - snippet: 'scopeNested($_GET["oops"] ?: y)' fingerprint: d065246ff18b050df029893f5d9a667b_7 old_fingerprint: d065246ff18b050df029893f5d9a667b_7 - rule: @@ -255,9 +247,8 @@ high: column: start: 1 end: 27 - content: scopeResult($_GET["oops"]) + content: "" parent_line_number: 14 - snippet: scopeResult($_GET["oops"]) fingerprint: d065246ff18b050df029893f5d9a667b_8 old_fingerprint: d065246ff18b050df029893f5d9a667b_8 - rule: @@ -284,9 +275,8 @@ high: column: start: 1 end: 31 - content: scopeResult(x . $_GET["oops"]) + content: "" parent_line_number: 15 - snippet: scopeResult(x . $_GET["oops"]) fingerprint: d065246ff18b050df029893f5d9a667b_9 old_fingerprint: d065246ff18b050df029893f5d9a667b_9 - rule: @@ -313,9 +303,8 @@ high: column: start: 1 end: 35 - content: 'scopeResult(x ? $_GET["oops"] : y)' + content: "" parent_line_number: 16 - snippet: 'scopeResult(x ? $_GET["oops"] : y)' fingerprint: d065246ff18b050df029893f5d9a667b_10 old_fingerprint: d065246ff18b050df029893f5d9a667b_10 - rule: @@ -342,9 +331,8 @@ high: column: start: 1 end: 32 - content: 'scopeResult($_GET["oops"] ?: y)' + content: "" parent_line_number: 18 - snippet: 'scopeResult($_GET["oops"] ?: y)' fingerprint: d065246ff18b050df029893f5d9a667b_11 old_fingerprint: d065246ff18b050df029893f5d9a667b_11 diff --git a/internal/languages/php/.snapshots/flow/TestFlow--different-line.yml b/internal/languages/php/.snapshots/flow/TestFlow--different-line.yml index cb28c4002..b09c541e0 100644 --- a/internal/languages/php/.snapshots/flow/TestFlow--different-line.yml +++ b/internal/languages/php/.snapshots/flow/TestFlow--different-line.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 17 - content: error_log($name) + content: "" parent_line_number: 4 - snippet: error_log($name) fingerprint: 22040fe52a02f18aa1f791dfddc636dd_0 old_fingerprint: 22040fe52a02f18aa1f791dfddc636dd_0 diff --git a/internal/languages/php/.snapshots/flow/TestFlow--same-line.yml b/internal/languages/php/.snapshots/flow/TestFlow--same-line.yml index 470406204..35b03c626 100644 --- a/internal/languages/php/.snapshots/flow/TestFlow--same-line.yml +++ b/internal/languages/php/.snapshots/flow/TestFlow--same-line.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 23 - content: error_log($user->name) + content: "" parent_line_number: 2 - snippet: error_log($user->name) fingerprint: c8260222d1f52cc14a35ce6ba7d9ec70_0 old_fingerprint: c8260222d1f52cc14a35ce6ba7d9ec70_0 - rule: @@ -62,9 +61,8 @@ low: column: start: 1 end: 25 - content: error_log($user->name()) + content: "" parent_line_number: 3 - snippet: error_log($user->name()) fingerprint: c8260222d1f52cc14a35ce6ba7d9ec70_1 old_fingerprint: c8260222d1f52cc14a35ce6ba7d9ec70_1 diff --git a/internal/languages/python/.snapshots/TestScope--scope.yml b/internal/languages/python/.snapshots/TestScope--scope.yml index 8174cba47..313d0c77c 100644 --- a/internal/languages/python/.snapshots/TestScope--scope.yml +++ b/internal/languages/python/.snapshots/TestScope--scope.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 37 - content: scopeCursor(request.GET.get('oops')) + content: "" parent_line_number: 1 - snippet: scopeCursor(request.GET.get('oops')) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_0 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 49 - content: scopeCursor(request.GET.get('oops') if x else y) + content: "" parent_line_number: 3 - snippet: scopeCursor(request.GET.get('oops') if x else y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_1 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 1 end: 42 - content: scopeCursor(request.GET.get('oops') or y) + content: "" parent_line_number: 5 - snippet: scopeCursor(request.GET.get('oops') or y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_2 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 1 end: 37 - content: scopeNested(request.GET.get('oops')) + content: "" parent_line_number: 7 - snippet: scopeNested(request.GET.get('oops')) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_3 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 1 end: 41 - content: scopeNested(x + request.GET.get('oops')) + content: "" parent_line_number: 8 - snippet: scopeNested(x + request.GET.get('oops')) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_4 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_4 - rule: @@ -168,9 +163,8 @@ high: column: start: 1 end: 49 - content: scopeNested(request.GET.get('oops') if x else y) + content: "" parent_line_number: 9 - snippet: scopeNested(request.GET.get('oops') if x else y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_5 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_5 - rule: @@ -197,9 +191,8 @@ high: column: start: 1 end: 49 - content: scopeNested(x if request.GET.get('oops') else y) + content: "" parent_line_number: 10 - snippet: scopeNested(x if request.GET.get('oops') else y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_6 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_6 - rule: @@ -226,9 +219,8 @@ high: column: start: 1 end: 42 - content: scopeNested(request.GET.get('oops') or y) + content: "" parent_line_number: 11 - snippet: scopeNested(request.GET.get('oops') or y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_7 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_7 - rule: @@ -255,9 +247,8 @@ high: column: start: 1 end: 37 - content: scopeResult(request.GET.get('oops')) + content: "" parent_line_number: 13 - snippet: scopeResult(request.GET.get('oops')) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_8 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_8 - rule: @@ -284,9 +275,8 @@ high: column: start: 1 end: 41 - content: scopeResult(x + request.GET.get('oops')) + content: "" parent_line_number: 14 - snippet: scopeResult(x + request.GET.get('oops')) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_9 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_9 - rule: @@ -313,9 +303,8 @@ high: column: start: 1 end: 49 - content: scopeResult(request.GET.get('oops') if x else y) + content: "" parent_line_number: 15 - snippet: scopeResult(request.GET.get('oops') if x else y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_10 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_10 - rule: @@ -342,9 +331,8 @@ high: column: start: 1 end: 42 - content: scopeResult(request.GET.get('oops') or y) + content: "" parent_line_number: 17 - snippet: scopeResult(request.GET.get('oops') or y) fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_11 old_fingerprint: bf75ffc19e7352a46ad95a1ad74cedb9_11 diff --git a/internal/languages/python/.snapshots/flow/TestFlow--different-line.yml b/internal/languages/python/.snapshots/flow/TestFlow--different-line.yml index d22572e62..cdc2fef46 100644 --- a/internal/languages/python/.snapshots/flow/TestFlow--different-line.yml +++ b/internal/languages/python/.snapshots/flow/TestFlow--different-line.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 20 - content: logging.error(name) + content: "" parent_line_number: 3 - snippet: logging.error(name) fingerprint: c94602447d6771c00b72425485a6cf6c_0 old_fingerprint: c94602447d6771c00b72425485a6cf6c_0 diff --git a/internal/languages/python/.snapshots/flow/TestFlow--same-line.yml b/internal/languages/python/.snapshots/flow/TestFlow--same-line.yml index 8d0500556..91b49264c 100644 --- a/internal/languages/python/.snapshots/flow/TestFlow--same-line.yml +++ b/internal/languages/python/.snapshots/flow/TestFlow--same-line.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 25 - content: logging.error(user.name) + content: "" parent_line_number: 1 - snippet: logging.error(user.name) fingerprint: 4b26059938bf9c55dcda8d08bcf6a4bd_0 old_fingerprint: 4b26059938bf9c55dcda8d08bcf6a4bd_0 - rule: @@ -62,9 +61,8 @@ low: column: start: 1 end: 27 - content: logging.error(user.name()) + content: "" parent_line_number: 2 - snippet: logging.error(user.name()) fingerprint: 4b26059938bf9c55dcda8d08bcf6a4bd_1 old_fingerprint: 4b26059938bf9c55dcda8d08bcf6a4bd_1 diff --git a/internal/languages/ruby/.snapshots/TestPatternVariables--main.yml b/internal/languages/ruby/.snapshots/TestPatternVariables--main.yml index d030036ba..e310a8d19 100644 --- a/internal/languages/ruby/.snapshots/TestPatternVariables--main.yml +++ b/internal/languages/ruby/.snapshots/TestPatternVariables--main.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 22 - content: matched_variable = 42 + content: "" parent_line_number: 1 - snippet: matched_variable = 42 fingerprint: 514e95a40b868d7341016d3fa344513d_0 old_fingerprint: 514e95a40b868d7341016d3fa344513d_0 - rule: @@ -52,13 +51,8 @@ high: column: start: 1 end: 4 - content: |- - class MatchedClass - end + content: "" parent_line_number: 4 - snippet: |- - class MatchedClass - end fingerprint: 514e95a40b868d7341016d3fa344513d_1 old_fingerprint: 514e95a40b868d7341016d3fa344513d_1 - rule: @@ -85,15 +79,8 @@ high: column: start: 1 end: 4 - content: |- - class MatchedClass - validates :password, length: { minimum: 2 } - end + content: "" parent_line_number: 7 - snippet: |- - class MatchedClass - validates :password, length: { minimum: 2 } - end fingerprint: 514e95a40b868d7341016d3fa344513d_2 old_fingerprint: 514e95a40b868d7341016d3fa344513d_2 diff --git a/internal/languages/ruby/.snapshots/TestRuby--call.yml b/internal/languages/ruby/.snapshots/TestRuby--call.yml index c7e7681ff..1641827e6 100644 --- a/internal/languages/ruby/.snapshots/TestRuby--call.yml +++ b/internal/languages/ruby/.snapshots/TestRuby--call.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 23 - content: logger.info(user.name) + content: "" parent_line_number: 1 - snippet: logger.info(user.name) fingerprint: e61c5d04fc38732e3374bc499d4daec1_0 old_fingerprint: e61c5d04fc38732e3374bc499d4daec1_0 diff --git a/internal/languages/ruby/.snapshots/TestRuby--object-variable-reconciliation.yml b/internal/languages/ruby/.snapshots/TestRuby--object-variable-reconciliation.yml index 87a725ed8..243b74926 100644 --- a/internal/languages/ruby/.snapshots/TestRuby--object-variable-reconciliation.yml +++ b/internal/languages/ruby/.snapshots/TestRuby--object-variable-reconciliation.yml @@ -28,9 +28,8 @@ low: column: start: 1 end: 18 - content: logger.info(user) + content: "" parent_line_number: 2 - snippet: logger.info(user) fingerprint: 50cde2c647d72172d49858483ecb0b57_0 old_fingerprint: 50cde2c647d72172d49858483ecb0b57_0 diff --git a/internal/languages/ruby/.snapshots/TestScope--scope.yml b/internal/languages/ruby/.snapshots/TestScope--scope.yml index d04dd7f6c..88139d968 100644 --- a/internal/languages/ruby/.snapshots/TestScope--scope.yml +++ b/internal/languages/ruby/.snapshots/TestScope--scope.yml @@ -23,9 +23,8 @@ high: column: start: 1 end: 28 - content: scope_cursor(params[:oops]) + content: "" parent_line_number: 1 - snippet: scope_cursor(params[:oops]) fingerprint: 23e17866f80f43957a84e824da9ce255_0 old_fingerprint: 23e17866f80f43957a84e824da9ce255_0 - rule: @@ -52,9 +51,8 @@ high: column: start: 1 end: 36 - content: 'scope_cursor(x ? params[:oops] : y)' + content: "" parent_line_number: 3 - snippet: 'scope_cursor(x ? params[:oops] : y)' fingerprint: 23e17866f80f43957a84e824da9ce255_1 old_fingerprint: 23e17866f80f43957a84e824da9ce255_1 - rule: @@ -81,9 +79,8 @@ high: column: start: 1 end: 28 - content: scope_nested(params[:oops]) + content: "" parent_line_number: 6 - snippet: scope_nested(params[:oops]) fingerprint: 23e17866f80f43957a84e824da9ce255_2 old_fingerprint: 23e17866f80f43957a84e824da9ce255_2 - rule: @@ -110,9 +107,8 @@ high: column: start: 1 end: 32 - content: scope_nested(params[:oops] + x) + content: "" parent_line_number: 7 - snippet: scope_nested(params[:oops] + x) fingerprint: 23e17866f80f43957a84e824da9ce255_3 old_fingerprint: 23e17866f80f43957a84e824da9ce255_3 - rule: @@ -139,9 +135,8 @@ high: column: start: 1 end: 36 - content: 'scope_nested(x ? params[:oops] : y)' + content: "" parent_line_number: 8 - snippet: 'scope_nested(x ? params[:oops] : y)' fingerprint: 23e17866f80f43957a84e824da9ce255_4 old_fingerprint: 23e17866f80f43957a84e824da9ce255_4 - rule: @@ -168,9 +163,8 @@ high: column: start: 1 end: 36 - content: 'scope_nested(params[:oops] ? x : y)' + content: "" parent_line_number: 9 - snippet: 'scope_nested(params[:oops] ? x : y)' fingerprint: 23e17866f80f43957a84e824da9ce255_5 old_fingerprint: 23e17866f80f43957a84e824da9ce255_5 - rule: @@ -197,9 +191,8 @@ high: column: start: 1 end: 28 - content: scope_result(params[:oops]) + content: "" parent_line_number: 11 - snippet: scope_result(params[:oops]) fingerprint: 23e17866f80f43957a84e824da9ce255_6 old_fingerprint: 23e17866f80f43957a84e824da9ce255_6 - rule: @@ -226,9 +219,8 @@ high: column: start: 1 end: 32 - content: scope_result(params[:oops] + x) + content: "" parent_line_number: 12 - snippet: scope_result(params[:oops] + x) fingerprint: 23e17866f80f43957a84e824da9ce255_7 old_fingerprint: 23e17866f80f43957a84e824da9ce255_7 - rule: @@ -255,9 +247,8 @@ high: column: start: 1 end: 36 - content: 'scope_result(x ? params[:oops] : y)' + content: "" parent_line_number: 13 - snippet: 'scope_result(x ? params[:oops] : y)' fingerprint: 23e17866f80f43957a84e824da9ce255_8 old_fingerprint: 23e17866f80f43957a84e824da9ce255_8 diff --git a/internal/report/output/dataflow/risks/risks.go b/internal/report/output/dataflow/risks/risks.go index 79155cec4..483e4a1bc 100644 --- a/internal/report/output/dataflow/risks/risks.go +++ b/internal/report/output/dataflow/risks/risks.go @@ -85,12 +85,10 @@ func (holder *Holder) AddRiskPresence(detection detections.Detection) { StartColumnNumber: *detection.Source.StartColumnNumber, EndLineNumber: *detection.Source.EndLineNumber, EndColumnNumber: *detection.Source.EndColumnNumber, - Content: *detection.Source.Text, } } else { // parent can be nil source = extractCustomRiskParent(detection.Value) - content = *detection.Source.Text } holder.addDatatype( diff --git a/internal/report/output/privacy/privacy_test.go b/internal/report/output/privacy/privacy_test.go index cb0ca1125..af94697e1 100644 --- a/internal/report/output/privacy/privacy_test.go +++ b/internal/report/output/privacy/privacy_test.go @@ -91,7 +91,6 @@ func dummyDataflow() *outputtypes.DataFlow { StartColumnNumber: 10, EndLineNumber: 38, EndColumnNumber: 28, - Content: "Sentry.set_user(email: current_user.email)", }, DataTypes: []types.RiskDatatype{ { diff --git a/internal/report/output/security/.snapshots/TestAddReportData b/internal/report/output/security/.snapshots/TestAddReportData index 9b39434fb..6e752461e 100644 --- a/internal/report/output/security/.snapshots/TestAddReportData +++ b/internal/report/output/security/.snapshots/TestAddReportData @@ -42,10 +42,10 @@ End: (int) 28 } }), - Content: (string) (len=38) "Rails.logger.info(user.biometric_data)" + Content: (string) "" }, ParentLineNumber: (int) 1, - ParentContent: (string) (len=38) "Rails.logger.info(user.biometric_data)", + ParentContent: (string) "", Fingerprint: (string) (len=34) "375d7c2e9977cf2ce5dbf04b04237bea_0", OldFingerprint: (string) (len=34) "80ce0185374c0975a9b2a71e9d11a4f0_0", DetailedContext: (string) "", @@ -101,10 +101,10 @@ End: (int) 28 } }), - Content: (string) (len=44) "http.verify_mode = OpenSSL::SSL::VERIFY_NONE" + Content: (string) "" }, ParentLineNumber: (int) 2, - ParentContent: (string) (len=44) "http.verify_mode = OpenSSL::SSL::VERIFY_NONE", + ParentContent: (string) "", Fingerprint: (string) (len=34) "9005ef3db844b32c1a0317e032f4a16a_0", OldFingerprint: (string) (len=34) "dcc50aebb6a6da7f0a8cb06e071f2af2_0", DetailedContext: (string) "", diff --git a/internal/report/output/security/.snapshots/TestAddReportDataWithSeverity b/internal/report/output/security/.snapshots/TestAddReportDataWithSeverity index c6664b552..d6344a5d0 100644 --- a/internal/report/output/security/.snapshots/TestAddReportDataWithSeverity +++ b/internal/report/output/security/.snapshots/TestAddReportDataWithSeverity @@ -42,10 +42,10 @@ End: (int) 28 } }), - Content: (string) (len=38) "Rails.logger.info(user.biometric_data)" + Content: (string) "" }, ParentLineNumber: (int) 1, - ParentContent: (string) (len=38) "Rails.logger.info(user.biometric_data)", + ParentContent: (string) "", Fingerprint: (string) (len=34) "375d7c2e9977cf2ce5dbf04b04237bea_0", OldFingerprint: (string) (len=34) "80ce0185374c0975a9b2a71e9d11a4f0_0", DetailedContext: (string) "", diff --git a/internal/report/output/security/security_test.go b/internal/report/output/security/security_test.go index cf3a9c9cd..1434a2732 100644 --- a/internal/report/output/security/security_test.go +++ b/internal/report/output/security/security_test.go @@ -226,7 +226,6 @@ func TestFingerprintIsStableWithBaseBranchFindings(t *testing.T) { StartColumnNumber: 1, EndLineNumber: 1, EndColumnNumber: 44, - Content: "http.verify_mode = OpenSSL::SSL::VERIFY_NONE", }, PresenceMatches: []dataflowtypes.RiskPresence{ { @@ -247,7 +246,6 @@ func TestFingerprintIsStableWithBaseBranchFindings(t *testing.T) { StartColumnNumber: 1, EndLineNumber: 2, EndColumnNumber: 44, - Content: "http.verify_mode = OpenSSL::SSL::VERIFY_NONE", }, PresenceMatches: []dataflowtypes.RiskPresence{ { @@ -341,7 +339,6 @@ func dummyDataflowData() *outputtypes.ReportData { StartColumnNumber: 10, EndLineNumber: 2, EndColumnNumber: 28, - Content: "http.verify_mode = OpenSSL::SSL::VERIFY_NONE", }, PresenceMatches: []dataflowtypes.RiskPresence{ { @@ -363,7 +360,6 @@ func dummyDataflowData() *outputtypes.ReportData { StartColumnNumber: 10, EndLineNumber: 2, EndColumnNumber: 28, - Content: "Rails.logger.info(user.biometric_data)", }, DataTypes: []dataflowtypes.RiskDatatype{ { diff --git a/internal/report/schema/datatype/datatype.go b/internal/report/schema/datatype/datatype.go index fee135fca..859fc0d73 100644 --- a/internal/report/schema/datatype/datatype.go +++ b/internal/report/schema/datatype/datatype.go @@ -207,7 +207,6 @@ func dataTypeToSchema[D DataTypable](report detections.ReportDetection, detectio if parent != nil { sourceSchema = &schema.Source{ - Content: parent.Content(), StartLineNumber: parent.StartLineNumber(), StartColumnNumber: parent.StartColumnNumber(), EndLineNumber: parent.EndLineNumber(), diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index b22235ed9..21421ac4e 100644 --- a/internal/scanner/scanner.go +++ b/internal/scanner/scanner.go @@ -84,14 +84,14 @@ func (scanner *Scanner) Scan( detection.MatchNode.ContentStart.Column, detection.MatchNode.ContentEnd.Line, detection.MatchNode.ContentEnd.Column, - fmt.Sprintf("bearer:expected %s", detection.RuleID), + "", ), reportschema.Source{ StartLineNumber: detection.MatchNode.ContentStart.Line, EndLineNumber: detection.MatchNode.ContentEnd.Line, StartColumnNumber: detection.MatchNode.ContentStart.Column, EndColumnNumber: detection.MatchNode.ContentEnd.Column, - Content: detection.MatchNode.Content(), + Content: "", }) } @@ -109,14 +109,14 @@ func (scanner *Scanner) Scan( detection.MatchNode.ContentStart.Column, detection.MatchNode.ContentEnd.Line, detection.MatchNode.ContentEnd.Column, - data.Pattern, + "", ), reportschema.Source{ StartLineNumber: detection.MatchNode.ContentStart.Line, EndLineNumber: detection.MatchNode.ContentEnd.Line, StartColumnNumber: detection.MatchNode.ContentStart.Column, EndColumnNumber: detection.MatchNode.ContentEnd.Column, - Content: detection.MatchNode.Content(), + Content: "", }) }