Projects STRLCPY bearer Commits d0e97c5c
🤬
  • refactor: output processing (#809)

    * refactor: output processing
    
    * chore: rewrite helper_test for integration
    
    following the separation of concerns of GetOutput, things needed to be
    updated.
    Also, updated the snapshots to reflect the update in yaml (parent_content -> snippet)
    
    * fix: update snapshots
    
    * chore: address privacy report
    
    * chore: disable api key for now
  • Loading...
  • Cédric Fabianski committed with GitHub 1 year ago
    d0e97c5c
    1 parent 12b8d797
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
Showing first 200 files as there are too many
  • ■ ■ ■ ■
    e2e/rules/.snapshots/TestAuxilary-testdata-data-auxilary
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 11
    13  - parent_content: client.event("user", "logged_in", {}, user)
     13 + snippet: client.event("user", "logged_in", {}, user)
    14 14   
    15 15   
    16 16  --
    skipped 2 lines
  • ■ ■ ■ ■
    e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionSchema-testdata-data-ruby_rails_default_encryption_schema_rb
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: |-
     13 + snippet: |-
    14 14   create_table "users", force: :cascade do |t|
    15 15   t.string "email", null: false
    16 16   t.string "name"
    skipped 9 lines
  • ■ ■ ■ ■
    e2e/rules/.snapshots/TestRubyRailsDefaultEncryptionStructure-testdata-data-ruby_rails_default_encryption_structure_sql
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   CREATE TABLE public.users (
    15 15   id bigint NOT NULL,
    16 16   name character varying,
    skipped 10 lines
  • ■ ■ ■ ■
    e2e/rules/.snapshots/TestSimpleRuby-testdata-data-simple_ruby
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 7
    13  - parent_content: config.force_ssl = false
     13 + snippet: config.force_ssl = false
    14 14   
    15 15   
    16 16  --
    skipped 2 lines
  • ■ ■ ■ ■ ■ ■
    integration/rules/helper_test.go
    1 1  package integration_test
    2 2   
    3 3  import (
    4  - "bytes"
    5 4   "os"
    6 5   "path/filepath"
    7 6   "strings"
    skipped 6 lines
    14 13   "github.com/bearer/bearer/pkg/commands/process/worker"
    15 14   "github.com/bearer/bearer/pkg/commands/process/worker/work"
    16 15   "github.com/bearer/bearer/pkg/flag"
     16 + "github.com/bearer/bearer/pkg/report/output"
    17 17   reportoutput "github.com/bearer/bearer/pkg/report/output"
    18 18   "github.com/bearer/bearer/pkg/types"
    19  - "github.com/bearer/bearer/pkg/util/output"
    20 19   "github.com/bradleyjkemp/cupaloy"
    21 20  )
    22 21   
    skipped 91 lines
    114 113   t.Fatalf("failed to do scan %s", err)
    115 114   }
    116 115   
    117  - outputBuffer := bytes.NewBuffer(nil)
    118  - logger := output.PlainLogger(outputBuffer)
     116 + runner.config.Scan.Target = testDataPath
     117 + detections, _, _, _ := output.GetOutput(
     118 + types.Report{
     119 + Path: detectorsReportPath,
     120 + },
     121 + runner.config,
     122 + )
    119 123   
    120  - err = reportoutput.ReportYAML(types.Report{
    121  - Path: detectorsReportPath,
    122  - }, logger, runner.config)
    123  - if err != nil {
    124  - t.Fatalf("failed to generate report yaml: %s", err)
    125  - }
     124 + report, _ := reportoutput.ReportYAML(
     125 + detections,
     126 + runner.config,
     127 + )
    126 128   
    127 129   cupaloyCopy := cupaloy.NewDefaultConfig().WithOptions(cupaloy.SnapshotSubdirectory(snapshotsPath))
    128  - cupaloyCopy.SnapshotT(t, outputBuffer.String())
     130 + cupaloyCopy.SnapshotT(t, *report)
    129 131  }
    130 132   
  • ■ ■ ■ ■ ■
    pkg/commands/artifact/run.go
    skipped 12 lines
    13 13   "strings"
    14 14   
    15 15   "github.com/google/uuid"
     16 + "github.com/hhatto/gocloc"
    16 17   "github.com/rs/zerolog/log"
    17 18   
    18 19   "golang.org/x/xerrors"
    skipped 4 lines
    23 24   "github.com/bearer/bearer/pkg/commands/process/worker/work"
    24 25   "github.com/bearer/bearer/pkg/flag"
    25 26   reportoutput "github.com/bearer/bearer/pkg/report/output"
     27 + "github.com/bearer/bearer/pkg/report/output/security"
     28 + "github.com/bearer/bearer/pkg/report/output/stats"
    26 29   "github.com/bearer/bearer/pkg/util/output"
    27 30   outputhandler "github.com/bearer/bearer/pkg/util/output"
    28 31   
    skipped 258 lines
    287 290   outputhandler.StdErrLogger().Msg("Using cached data")
    288 291   }
    289 292   
     293 + detections, lineOfCodeOutput, dataflow, err := reportoutput.GetOutput(report, config)
     294 + if err != nil {
     295 + return false, err
     296 + }
     297 + 
     298 + reportSupported, err := anySupportedLanguagesPresent(lineOfCodeOutput, config)
     299 + if err != nil {
     300 + return false, err
     301 + }
     302 + 
     303 + if !reportSupported && config.Report.Report != flag.ReportPrivacy {
     304 + var placeholderStr *strings.Builder
     305 + placeholderStr, err = getPlaceholderOutput(report, config, lineOfCodeOutput)
     306 + if err != nil {
     307 + return false, err
     308 + }
     309 + 
     310 + output.StdOutLogger().Msg(placeholderStr.String())
     311 + return true, nil
     312 + }
     313 + 
    290 314   if config.Report.Format == flag.FormatEmpty {
    291 315   if config.Report.Report == flag.ReportSecurity {
    292  - // for policy report, default report format is NOT JSON
    293  - reportPassed, err := reportoutput.ReportSecurity(report, logger, config)
    294  - if err != nil {
    295  - return false, fmt.Errorf("error generating report %w", err)
    296  - }
    297  - outputCachedDataWarning(cacheUsed, config.Scan.Quiet)
     316 + // for security report, default report format is Table
     317 + report := detections.(*security.Results)
     318 + reportStr, reportPassed := security.BuildReportString(config, report, lineOfCodeOutput, dataflow)
     319 + 
     320 + output.StdOutLogger().Msg(reportStr.String())
     321 + 
    298 322   return reportPassed, nil
    299  - }
    300  - if config.Report.Report == flag.ReportPrivacy {
     323 + } else if config.Report.Report == flag.ReportPrivacy {
    301 324   // for privacy report, default report format is CSV
    302  - err := reportoutput.ReportCSV(report, logger, config)
     325 + content, err := reportoutput.GetPrivacyReportCSVOutput(report, lineOfCodeOutput, dataflow, config)
    303 326   if err != nil {
    304  - return false, fmt.Errorf("error generating report %w", err)
     327 + return false, fmt.Errorf("error generating report %s", err)
    305 328   }
    306  - outputCachedDataWarning(cacheUsed, config.Scan.Quiet)
     329 + 
     330 + output.StdOutLogger().Msg(*content)
     331 + 
    307 332   return true, nil
    308 333   }
    309 334   }
    skipped 1 lines
    311 336   switch config.Report.Format {
    312 337   case flag.FormatEmpty, flag.FormatJSON:
    313 338   // default report format for is JSON
    314  - err := reportoutput.ReportJSON(report, logger, config)
     339 + content, err := reportoutput.ReportJSON(detections, config)
    315 340   if err != nil {
    316  - return false, fmt.Errorf("error generating report %w", err)
     341 + return false, fmt.Errorf("error generating report %s", err)
    317 342   }
     343 + 
     344 + logger.Msg(*content)
    318 345   case flag.FormatYAML:
    319  - err := reportoutput.ReportYAML(report, logger, config)
     346 + content, err := reportoutput.ReportYAML(detections, config)
    320 347   if err != nil {
    321  - return false, fmt.Errorf("error generating report %w", err)
     348 + return false, fmt.Errorf("error generating report %s", err)
    322 349   }
     350 + 
     351 + logger.Msg(*content)
    323 352   }
     353 + 
    324 354   outputCachedDataWarning(cacheUsed, config.Scan.Quiet)
    325 355   return true, nil
    326 356  }
    skipped 6 lines
    333 363   outputhandler.StdErrLogger().Msg("Cached data used (no code changes detected). Unexpected? Use --force to force a re-scan.\n")
    334 364  }
    335 365   
     366 +func anySupportedLanguagesPresent(inputgocloc *gocloc.Result, config settings.Config) (bool, error) {
     367 + if inputgocloc == nil {
     368 + return true, nil
     369 + }
     370 + 
     371 + ruleLanguages := make(map[string]bool)
     372 + for _, rule := range config.Rules {
     373 + for _, language := range rule.Languages {
     374 + ruleLanguages[language] = true
     375 + }
     376 + }
     377 + 
     378 + foundLanguages := make(map[string]bool)
     379 + for _, language := range inputgocloc.Languages {
     380 + foundLanguages[strings.ToLower(language.Name)] = true
     381 + }
     382 + 
     383 + _, rubyPresent := foundLanguages["ruby"]
     384 + if rubyPresent {
     385 + return true, nil
     386 + }
     387 + 
     388 + _, javascriptPresent := foundLanguages["javascript"]
     389 + if javascriptPresent {
     390 + return true, nil
     391 + }
     392 + 
     393 + log.Debug().Msg("No language found for which rules are applicable")
     394 + return false, nil
     395 +}
     396 + 
     397 +func getPlaceholderOutput(report types.Report, config settings.Config, inputgocloc *gocloc.Result) (outputStr *strings.Builder, err error) {
     398 + dataflowOutput, _, _, err := reportoutput.GetDataflow(report, config, true)
     399 + if err != nil {
     400 + return
     401 + }
     402 + 
     403 + return stats.GetPlaceholderOutput(inputgocloc, dataflowOutput, config)
     404 +}
     405 + 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/code_injection/.snapshots/TestJavascriptAwsLambdaCodeInjection--code_injection.yml
    skipped 8 lines
    9 9   line_number: 5
    10 10   filename: code_injection.js
    11 11   parent_line_number: 5
    12  - parent_content: vm.createContext(context)
     12 + snippet: vm.createContext(context)
    13 13   - rule:
    14 14   cwe_ids:
    15 15   - "94"
    skipped 4 lines
    20 20   line_number: 7
    21 21   filename: code_injection.js
    22 22   parent_line_number: 7
    23  - parent_content: new vm.Script(event["query"])
    24  - 
     23 + snippet: new vm.Script(event["query"])
    25 24   
    26 25   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/code_injection/.snapshots/TestJavascriptAwsLambdaCodeInjection--ok_no_code_injection.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/os_command_injection/.snapshots/TestJavascriptAwsLambdaOsCommandInjection--ok_no_os_command_injection.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/os_command_injection/.snapshots/TestJavascriptAwsLambdaOsCommandInjection--os_command_injection.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: os_command_injection.js
    10 10   parent_line_number: 4
    11  - parent_content: |-
     11 + snippet: |-
    12 12   exec("ls "+event["user_dir"]+"| wc -l", (err, stdout, stderr) => {
    13 13   // do something
    14 14   })
    skipped 6 lines
    21 21   line_number: 8
    22 22   filename: os_command_injection.js
    23 23   parent_line_number: 8
    24  - parent_content: |-
     24 + snippet: |-
    25 25   execSync("ls "+event["user"]+"| wc -l", (err, stdout, stderr) => {
    26 26   // do something
    27 27   })
    skipped 6 lines
    34 34   line_number: 12
    35 35   filename: os_command_injection.js
    36 36   parent_line_number: 12
    37  - parent_content: spawn(event["query"])
     37 + snippet: spawn(event["query"])
    38 38   - rule:
    39 39   cwe_ids:
    40 40   - "78"
    skipped 3 lines
    44 44   line_number: 14
    45 45   filename: os_command_injection.js
    46 46   parent_line_number: 14
    47  - parent_content: spawnSync("grep " + event["tmp"])
    48  - 
     47 + snippet: spawnSync("grep " + event["tmp"])
    49 48   
    50 49   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/query_injection/.snapshots/TestJavascriptAwsLambdaQueryInjection--dynamodb_query_injection.yml
    skipped 7 lines
    8 8   line_number: 10
    9 9   filename: dynamodb_query_injection.js
    10 10   parent_line_number: 10
    11  - parent_content: new QueryCommand(params)
     11 + snippet: new QueryCommand(params)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "89"
    skipped 3 lines
    18 18   line_number: 18
    19 19   filename: dynamodb_query_injection.js
    20 20   parent_line_number: 18
    21  - parent_content: docClient.query(event["query"]["params"], function(err, data) {})
     21 + snippet: docClient.query(event["query"]["params"], function(err, data) {})
    22 22   - rule:
    23 23   cwe_ids:
    24 24   - "89"
    skipped 3 lines
    28 28   line_number: 32
    29 29   filename: dynamodb_query_injection.js
    30 30   parent_line_number: 32
    31  - parent_content: new QueryCommand(params)
    32  - 
     31 + snippet: new QueryCommand(params)
    33 32   
    34 33   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/query_injection/.snapshots/TestJavascriptAwsLambdaQueryInjection--ok_no_injection.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/sql_injection/.snapshots/TestJavascriptAwsLambdaSqlInjection--knex_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 6
    9 9   filename: knex_sql_injection.js
    10 10   parent_line_number: 6
    11  - parent_content: |-
     11 + snippet: |-
    12 12   knex.select('user.cart_details')
    13 13   .from('users')
    14 14   .whereRaw('name = '+ event.user.name)
    15  - 
    16 15   
    17 16   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/sql_injection/.snapshots/TestJavascriptAwsLambdaSqlInjection--mysql2_sql_injection.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: connection.query("SELECT * FROM `user` WHERE name = " + event.customer.name)
     13 + snippet: connection.query("SELECT * FROM `user` WHERE name = " + event.customer.name)
    14 14   - rule:
    15 15   cwe_ids:
    16 16   - "89"
    skipped 5 lines
    22 22   category_groups:
    23 23   - PII
    24 24   parent_line_number: 7
    25  - parent_content: asyncConn.execute("SELECT * FROM `admin_users` WHERE ID = " + event.admin.id)
     25 + snippet: asyncConn.execute("SELECT * FROM `admin_users` WHERE ID = " + event.admin.id)
    26 26   - rule:
    27 27   cwe_ids:
    28 28   - "89"
    skipped 5 lines
    34 34   category_groups:
    35 35   - PII
    36 36   parent_line_number: 11
    37  - parent_content: |-
     37 + snippet: |-
    38 38   pool.query("SELECT * FROM users WHERE name = " + event.user_name, function() {
    39 39   // do something
    40 40   })
    skipped 8 lines
    49 49   category_groups:
    50 50   - PII
    51 51   parent_line_number: 15
    52  - parent_content: |-
     52 + snippet: |-
    53 53   conn.query("SELECT * FROM users WHERE name = " + event.user_name, function() {
    54 54   // do something
    55 55   })
    56  - 
    57 56   
    58 57   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/sql_injection/.snapshots/TestJavascriptAwsLambdaSqlInjection--ok_no_injection.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/sql_injection/.snapshots/TestJavascriptAwsLambdaSqlInjection--pg_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 8
    9 9   filename: pg_sql_injection.js
    10 10   parent_line_number: 8
    11  - parent_content: client.query('SELECT * FROM users WHERE user.name = ' + event.user.name)
    12  - 
     11 + snippet: client.query('SELECT * FROM users WHERE user.name = ' + event.user.name)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/aws_lambda/sql_injection/.snapshots/TestJavascriptAwsLambdaSqlInjection--sequelize_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 6
    9 9   filename: sequelize_sql_injection.js
    10 10   parent_line_number: 6
    11  - parent_content: sqlite.query(customerQuery)
    12  - 
     11 + snippet: sqlite.query(customerQuery)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/cross_site_scripting/.snapshots/TestJavascriptExpressCrossSiteScripting--no_xss.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/cross_site_scripting/.snapshots/TestJavascriptExpressCrossSiteScripting--res_send_xss.yml
    skipped 7 lines
    8 8   line_number: 9
    9 9   filename: res_send_xss.js
    10 10   parent_line_number: 9
    11  - parent_content: res.send("<p>" + req.body.customer.name + "</p>")
     11 + snippet: res.send("<p>" + req.body.customer.name + "</p>")
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "79"
    skipped 3 lines
    18 18   line_number: 13
    19 19   filename: res_send_xss.js
    20 20   parent_line_number: 13
    21  - parent_content: res.send("<p>" + req.body["user_id"] + "</p>")
    22  - 
     21 + snippet: res.send("<p>" + req.body["user_id"] + "</p>")
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/cross_site_scripting/.snapshots/TestJavascriptExpressCrossSiteScripting--res_write_xss.yml
    skipped 7 lines
    8 8   line_number: 10
    9 9   filename: res_write_xss.js
    10 10   parent_line_number: 10
    11  - parent_content: res.write("<h3> Greetings " + customerName + "</h3>")
    12  - 
     11 + snippet: res.write("<h3> Greetings " + customerName + "</h3>")
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/default_session_config/.snapshots/TestJavascriptExpressDefaultSessionConfig--default_session_config.yml
    skipped 8 lines
    9 9   line_number: 9
    10 10   filename: default_session_config.js
    11 11   parent_line_number: 9
    12  - parent_content: '{}'
    13  - 
     12 + snippet: '{}'
    14 13   
    15 14   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/default_session_config/.snapshots/TestJavascriptExpressDefaultSessionConfig--ok_session_configured.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/eval_user_input/.snapshots/TestJavascriptExpressEvalUserInput--eval.yml
    skipped 8 lines
    9 9   line_number: 11
    10 10   filename: eval.js
    11 11   parent_line_number: 11
    12  - parent_content: eval(command)
    13  - 
     12 + snippet: eval(command)
    14 13   
    15 14   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/eval_user_input/.snapshots/TestJavascriptExpressEvalUserInput--new_function.yml
    skipped 8 lines
    9 9   line_number: 11
    10 10   filename: new_function.js
    11 11   parent_line_number: 11
    12  - parent_content: new Function(command)
    13  - 
     12 + snippet: new Function(command)
    14 13   
    15 14   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/eval_user_input/.snapshots/TestJavascriptExpressEvalUserInput--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/eval_user_input/.snapshots/TestJavascriptExpressEvalUserInput--set_interval.yml
    skipped 8 lines
    9 9   line_number: 11
    10 10   filename: set_interval.js
    11 11   parent_line_number: 11
    12  - parent_content: setInterval(command)
    13  - 
     12 + snippet: setInterval(command)
    14 13   
    15 14   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/eval_user_input/.snapshots/TestJavascriptExpressEvalUserInput--set_timeout.yml
    skipped 8 lines
    9 9   line_number: 11
    10 10   filename: set_timeout.js
    11 11   parent_line_number: 11
    12  - parent_content: setTimeout(command)
    13  - 
     12 + snippet: setTimeout(command)
    14 13   
    15 14   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/exposed_dir_listing/.snapshots/TestJavascriptExpressExposedDirListing--ok_app_use.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/exposed_dir_listing/.snapshots/TestJavascriptExpressExposedDirListing--serve_index_in_app_use.yml
    skipped 7 lines
    8 8   line_number: 9
    9 9   filename: serve_index_in_app_use.js
    10 10   parent_line_number: 9
    11  - parent_content: app.use("/public", serveIndex(__dirname + "files"))
    12  - 
     11 + snippet: app.use("/public", serveIndex(__dirname + "files"))
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/external_file_upload/.snapshots/TestJavascriptExpressExternalFileUpload--ok_send_file.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/external_file_upload/.snapshots/TestJavascriptExpressExternalFileUpload--send_file_with_external_input.yml
    skipped 7 lines
    8 8   line_number: 13
    9 9   filename: send_file_with_external_input.js
    10 10   parent_line_number: 13
    11  - parent_content: path.resolve(file)
     11 + snippet: path.resolve(file)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "22"
    skipped 3 lines
    18 18   line_number: 15
    19 19   filename: send_file_with_external_input.js
    20 20   parent_line_number: 15
    21  - parent_content: path.join(__dirname, req.params.root)
     21 + snippet: path.join(__dirname, req.params.root)
    22 22  low:
    23 23   - rule:
    24 24   cwe_ids:
    skipped 4 lines
    29 29   line_number: 12
    30 30   filename: send_file_with_external_input.js
    31 31   parent_line_number: 12
    32  - parent_content: res.sendFile(file)
     32 + snippet: res.sendFile(file)
    33 33   - rule:
    34 34   cwe_ids:
    35 35   - "73"
    skipped 3 lines
    39 39   line_number: 13
    40 40   filename: send_file_with_external_input.js
    41 41   parent_line_number: 13
    42  - parent_content: res.sendFile(path.resolve(file))
     42 + snippet: res.sendFile(path.resolve(file))
    43 43   - rule:
    44 44   cwe_ids:
    45 45   - "73"
    skipped 3 lines
    49 49   line_number: 14
    50 50   filename: send_file_with_external_input.js
    51 51   parent_line_number: 14
    52  - parent_content: res.sendFile(req.params.file, {}, () => {})
     52 + snippet: res.sendFile(req.params.file, {}, () => {})
    53 53   - rule:
    54 54   cwe_ids:
    55 55   - "73"
    skipped 3 lines
    59 59   line_number: 15
    60 60   filename: send_file_with_external_input.js
    61 61   parent_line_number: 15
    62  - parent_content: 'res.sendFile("file.txt", { root: path.join(__dirname, req.params.root) })'
    63  - 
     62 + snippet: 'res.sendFile("file.txt", { root: path.join(__dirname, req.params.root) })'
    64 63   
    65 64   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/external_resource/.snapshots/TestJavascriptExpressExternalResource--ok_known_resource.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/external_resource/.snapshots/TestJavascriptExpressExternalResource--render_external_resource.yml
    skipped 7 lines
    8 8   line_number: 9
    9 9   filename: render_external_resource.js
    10 10   parent_line_number: 9
    11  - parent_content: 'res.render(req.query.path + "/results", { page: 1 })'
    12  - 
     11 + snippet: 'res.render(req.query.path + "/results", { page: 1 })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/external_resource/.snapshots/TestJavascriptExpressExternalResource--require_destructured_resource.yml
    skipped 7 lines
    8 8   line_number: 7
    9 9   filename: require_destructured_resource.js
    10 10   parent_line_number: 7
    11  - parent_content: require(path)
    12  - 
     11 + snippet: require(path)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/external_resource/.snapshots/TestJavascriptExpressExternalResource--require_external_resource.yml
    skipped 7 lines
    8 8   line_number: 10
    9 9   filename: require_external_resource.js
    10 10   parent_line_number: 10
    11  - parent_content: require(req.query.user.path)
    12  - 
     11 + snippet: require(req.query.user.path)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/hardcoded_secret/.snapshots/TestJavascriptExpressHardCodedSecret--hardcoded_secret_in_jwt.yml
    skipped 7 lines
    8 8   line_number: 13
    9 9   filename: hardcoded_secret_in_jwt.js
    10 10   parent_line_number: 13
    11  - parent_content: 'expressjwt({ secret: "my-hardcoded-secret" })'
     11 + snippet: 'expressjwt({ secret: "my-hardcoded-secret" })'
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "798"
    skipped 3 lines
    18 18   line_number: 21
    19 19   filename: hardcoded_secret_in_jwt.js
    20 20   parent_line_number: 21
    21  - parent_content: 'jwt({ secret: secret })'
    22  - 
     21 + snippet: 'jwt({ secret: secret })'
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/hardcoded_secret/.snapshots/TestJavascriptExpressHardCodedSecret--hardcoded_secret_in_session.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: hardcoded_secret_in_session.js
    10 10   parent_line_number: 12
    11  - parent_content: |-
     11 + snippet: |-
    12 12   session({
    13 13   name: "my-custom-session-name",
    14 14   secret: "my-hardcoded-secret",
    skipped 7 lines
    22 22   line_number: 23
    23 23   filename: hardcoded_secret_in_session.js
    24 24   parent_line_number: 23
    25  - parent_content: session(sessionConfig)
    26  - 
     25 + snippet: session(sessionConfig)
    27 26   
    28 27   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/hardcoded_secret/.snapshots/TestJavascriptExpressHardCodedSecret--ok_no_hardcoded_secrets.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/helmet_missing/.snapshots/TestJavascriptHelmetMissing--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/helmet_missing/.snapshots/TestJavascriptHelmetMissing--unsecure.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: unsecure.js
    10 10   parent_line_number: 4
    11  - parent_content: express()
    12  - 
     11 + snippet: express()
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/https_protocol_missing/.snapshots/TestJavascriptExpressHttpsProtocolMissing--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/https_protocol_missing/.snapshots/TestJavascriptExpressHttpsProtocolMissing--unsecure.yml
    skipped 7 lines
    8 8   line_number: 1
    9 9   filename: unsecure.js
    10 10   parent_line_number: 1
    11  - parent_content: http.createServer(app)
    12  - 
     11 + snippet: http.createServer(app)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_allow_origin/.snapshots/TestJavascriptExpressInsecureAllowOrigin--insecure_allow_origin.yml
    skipped 7 lines
    8 8   line_number: 10
    9 9   filename: insecure_allow_origin.js
    10 10   parent_line_number: 10
    11  - parent_content: 'res.writeHead(200, { "Access-Control-Allow-Origin": req.params.origin })'
     11 + snippet: 'res.writeHead(200, { "Access-Control-Allow-Origin": req.params.origin })'
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "346"
    skipped 3 lines
    18 18   line_number: 11
    19 19   filename: insecure_allow_origin.js
    20 20   parent_line_number: 11
    21  - parent_content: res.set("access-control-allow-origin", origin)
    22  - 
     21 + snippet: res.set("access-control-allow-origin", origin)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_allow_origin/.snapshots/TestJavascriptExpressInsecureAllowOrigin--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_dot_template.yml
    skipped 7 lines
    8 8   line_number: 11
    9 9   filename: insecure_dot_template.js
    10 10   parent_line_number: 11
    11  - parent_content: doT.template(req.params.template)
    12  - 
     11 + snippet: doT.template(req.params.template)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_ejs_template.yml
    skipped 7 lines
    8 8   line_number: 11
    9 9   filename: insecure_ejs_template.js
    10 10   parent_line_number: 11
    11  - parent_content: ejs.compile(req.body.user, options)
     11 + snippet: ejs.compile(req.body.user, options)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "1336"
    skipped 3 lines
    18 18   line_number: 16
    19 19   filename: insecure_ejs_template.js
    20 20   parent_line_number: 16
    21  - parent_content: ejs.render(req.params.name, data, options)
    22  - 
     21 + snippet: ejs.render(req.params.name, data, options)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_eta_template.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: insecure_eta_template.js
    10 10   parent_line_number: 12
    11  - parent_content: 'Eta.render(req.params, { name: "insecure" })'
    12  - 
     11 + snippet: 'Eta.render(req.params, { name: "insecure" })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_express_hbs_template.yml
    skipped 7 lines
    8 8   line_number: 13
    9 9   filename: insecure_express_hbs_template.js
    10 10   parent_line_number: 13
    11  - parent_content: hbs.renderView(req.params.viewPath, options, (err) => {})
    12  - 
     11 + snippet: hbs.renderView(req.params.viewPath, options, (err) => {})
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_handlebars_template.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: insecure_handlebars_template.js
    10 10   parent_line_number: 12
    11  - parent_content: Handlebars.precompile(req.body.user, options)
     11 + snippet: Handlebars.precompile(req.body.user, options)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "1336"
    skipped 3 lines
    18 18   line_number: 13
    19 19   filename: insecure_handlebars_template.js
    20 20   parent_line_number: 13
    21  - parent_content: Handlebars.compile(req.body.user, options)
    22  - 
     21 + snippet: Handlebars.compile(req.body.user, options)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_hoganjs_template.yml
    skipped 7 lines
    8 8   line_number: 13
    9 9   filename: insecure_hoganjs_template.js
    10 10   parent_line_number: 13
    11  - parent_content: 'Hogan.compile(template, { name: "insecure" })'
    12  - 
     11 + snippet: 'Hogan.compile(template, { name: "insecure" })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_liquid_template.yml
    skipped 7 lines
    8 8   line_number: 13
    9 9   filename: insecure_liquid_template.js
    10 10   parent_line_number: 13
    11  - parent_content: 'engine.render(req.params.text, { hello: "world" })'
    12  - 
     11 + snippet: 'engine.render(req.params.text, { hello: "world" })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_lodash_template.yml
    skipped 7 lines
    8 8   line_number: 11
    9 9   filename: insecure_lodash_template.js
    10 10   parent_line_number: 11
    11  - parent_content: _.template(req.params.body)
    12  - 
     11 + snippet: _.template(req.params.body)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_mustache_template.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: insecure_mustache_template.js
    10 10   parent_line_number: 12
    11  - parent_content: 'Mustache.render(req.params, { name: "insecure" })'
    12  - 
     11 + snippet: 'Mustache.render(req.params, { name: "insecure" })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_nunjucks_template.yml
    skipped 7 lines
    8 8   line_number: 11
    9 9   filename: insecure_nunjucks_template.js
    10 10   parent_line_number: 11
    11  - parent_content: nunjucks.render(req.params.body)
     11 + snippet: nunjucks.render(req.params.body)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "1336"
    skipped 3 lines
    18 18   line_number: 12
    19 19   filename: insecure_nunjucks_template.js
    20 20   parent_line_number: 12
    21  - parent_content: nunjucks.renderString(req.params.body)
    22  - 
     21 + snippet: nunjucks.renderString(req.params.body)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_pug_template.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: insecure_pug_template.js
    10 10   parent_line_number: 12
    11  - parent_content: pug.render(req.params.name, merge(options, locals))
     11 + snippet: pug.render(req.params.name, merge(options, locals))
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "1336"
    skipped 3 lines
    18 18   line_number: 16
    19 19   filename: insecure_pug_template.js
    20 20   parent_line_number: 16
    21  - parent_content: pug.compile(req.params.name)
    22  - 
     21 + snippet: pug.compile(req.params.name)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_squirrelly_template.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: insecure_squirrelly_template.js
    10 10   parent_line_number: 12
    11  - parent_content: 'Sqrl.render(req.params.text, { name: "alvin" })'
    12  - 
     11 + snippet: 'Sqrl.render(req.params.text, { name: "alvin" })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--insecure_whiskers_template.yml
    skipped 7 lines
    8 8   line_number: 13
    9 9   filename: insecure_whiskers_template.js
    10 10   parent_line_number: 13
    11  - parent_content: whiskers.render(req.params.text, context)
    12  - 
     11 + snippet: whiskers.render(req.params.text, context)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/insecure_template_rendering/.snapshots/TestJavascriptExpressInsecureTemplateRendering--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/jwt_not_revoked/.snapshots/TestJavascriptExpressJwtNotRevoked--express_jwt_not_revoked.yml
    skipped 7 lines
    8 8   line_number: 11
    9 9   filename: express_jwt_not_revoked.js
    10 10   parent_line_number: 11
    11  - parent_content: 'expressjwt({ secret: config.secret, algorithms: ["HS256"] })'
    12  - 
     11 + snippet: 'expressjwt({ secret: config.secret, algorithms: ["HS256"] })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/jwt_not_revoked/.snapshots/TestJavascriptExpressJwtNotRevoked--ok_express_jwt_revoked.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/open_redirect/.snapshots/TestJavascriptExpressOpenRedirect--ok_no_open_redirect.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/open_redirect/.snapshots/TestJavascriptExpressOpenRedirect--open_redirect.yml
    skipped 7 lines
    8 8   line_number: 2
    9 9   filename: open_redirect.js
    10 10   parent_line_number: 2
    11  - parent_content: res.redirect(req.params.url)
     11 + snippet: res.redirect(req.params.url)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "601"
    skipped 3 lines
    18 18   line_number: 3
    19 19   filename: open_redirect.js
    20 20   parent_line_number: 3
    21  - parent_content: res.redirect(req.query.url + "/bar")
     21 + snippet: res.redirect(req.query.url + "/bar")
    22 22   - rule:
    23 23   cwe_ids:
    24 24   - "601"
    skipped 3 lines
    28 28   line_number: 4
    29 29   filename: open_redirect.js
    30 30   parent_line_number: 4
    31  - parent_content: res.redirect("https://" + req.params.url + "/bar")
     31 + snippet: res.redirect("https://" + req.params.url + "/bar")
    32 32   - rule:
    33 33   cwe_ids:
    34 34   - "601"
    skipped 3 lines
    38 38   line_number: 5
    39 39   filename: open_redirect.js
    40 40   parent_line_number: 5
    41  - parent_content: res.redirect("http://" + req.params.path + "/bar")
    42  - 
     41 + snippet: res.redirect("http://" + req.params.path + "/bar")
    43 42   
    44 43   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/path_traversal/.snapshots/TestJavascriptExpressPathTraversal--ok_no_path_traversal_vulnerability.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/path_traversal/.snapshots/TestJavascriptExpressPathTraversal--path_traversal_vulnerability.yml
    skipped 7 lines
    8 8   line_number: 9
    9 9   filename: path_traversal_vulnerability.js
    10 10   parent_line_number: 9
    11  - parent_content: path.join("/public/", req.query.path)
     11 + snippet: path.join("/public/", req.query.path)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "22"
    skipped 3 lines
    18 18   line_number: 10
    19 19   filename: path_traversal_vulnerability.js
    20 20   parent_line_number: 10
    21  - parent_content: path.resolve(req.query.path)
    22  - 
     21 + snippet: path.resolve(req.query.path)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/reduce_fingerprint/.snapshots/TestJavascriptReduceFingerprint--secure_app_disable.yml
    skipped 7 lines
    8 8   line_number: 3
    9 9   filename: secure_app_disable.js
    10 10   parent_line_number: 3
    11  - parent_content: express()
    12  - 
     11 + snippet: express()
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/reduce_fingerprint/.snapshots/TestJavascriptReduceFingerprint--secure_helmet.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/reduce_fingerprint/.snapshots/TestJavascriptReduceFingerprint--unsecure.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: unsecure.js
    10 10   parent_line_number: 4
    11  - parent_content: express()
     11 + snippet: express()
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "693"
    skipped 3 lines
    18 18   line_number: 4
    19 19   filename: unsecure.js
    20 20   parent_line_number: 4
    21  - parent_content: express()
    22  - 
     21 + snippet: express()
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/server_side_request_forgery/.snapshots/TestJavascriptExpressServerSideRequestForgery--axios_ssrf_injection.yml
    skipped 7 lines
    8 8   line_number: 10
    9 9   filename: axios_ssrf_injection.js
    10 10   parent_line_number: 10
    11  - parent_content: axios.get(req.query.path)
    12  - 
     11 + snippet: axios.get(req.query.path)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/server_side_request_forgery/.snapshots/TestJavascriptExpressServerSideRequestForgery--node_fetch_ssrf_injection.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: node_fetch_ssrf_injection.js
    10 10   parent_line_number: 12
    11  - parent_content: fetch("https://" + req.query.path)
    12  - 
     11 + snippet: fetch("https://" + req.query.path)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/server_side_request_forgery/.snapshots/TestJavascriptExpressServerSideRequestForgery--ok_no_ssrf.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/server_side_request_forgery/.snapshots/TestJavascriptExpressServerSideRequestForgery--puppeteer_ssrf_injection.yml
    skipped 7 lines
    8 8   line_number: 15
    9 9   filename: puppeteer_ssrf_injection.js
    10 10   parent_line_number: 15
    11  - parent_content: page.setContent(content)
     11 + snippet: page.setContent(content)
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "918"
    skipped 3 lines
    18 18   line_number: 16
    19 19   filename: puppeteer_ssrf_injection.js
    20 20   parent_line_number: 16
    21  - parent_content: page.goto("https://" + req.query.path)
    22  - 
     21 + snippet: page.goto("https://" + req.query.path)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/sql_injection/.snapshots/TestJavascriptExpressSqlInjection--knex_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 11
    9 9   filename: knex_sql_injection.js
    10 10   parent_line_number: 11
    11  - parent_content: res.send(prepareJson(cartDetails))
    12  - 
     11 + snippet: res.send(prepareJson(cartDetails))
    13 12   
    14 13   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/sql_injection/.snapshots/TestJavascriptExpressSqlInjection--mysql2_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 12
    9 9   filename: mysql2_sql_injection.js
    10 10   parent_line_number: 12
    11  - parent_content: |-
     11 + snippet: |-
    12 12   connection.query(
    13 13   "SELECT * FROM `user` WHERE name = " + req.params.customer.name
    14 14   )
    skipped 6 lines
    21 21   line_number: 18
    22 22   filename: mysql2_sql_injection.js
    23 23   parent_line_number: 18
    24  - parent_content: |-
     24 + snippet: |-
    25 25   pool.query(
    26 26   "SELECT * FROM users WHERE name = " + req.params.user_name,
    27 27   function () {}
    skipped 7 lines
    35 35   line_number: 23
    36 36   filename: mysql2_sql_injection.js
    37 37   parent_line_number: 23
    38  - parent_content: conn.query("SELECT * FROM users WHERE name = " + req.params.user_name, function () {})
    39  - 
     38 + snippet: conn.query("SELECT * FROM users WHERE name = " + req.params.user_name, function () {})
    40 39   
    41 40   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/sql_injection/.snapshots/TestJavascriptExpressSqlInjection--ok_no_sql_injection.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/sql_injection/.snapshots/TestJavascriptExpressSqlInjection--pg_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 8
    9 9   filename: pg_sql_injection.js
    10 10   parent_line_number: 8
    11  - parent_content: |-
     11 + snippet: |-
    12 12   client.query(
    13 13   "SELECT * FROM users WHERE user.name = " + req.params.user.name
    14 14   )
    15  - 
    16 15   
    17 16   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/sql_injection/.snapshots/TestJavascriptExpressSqlInjection--sequelize_sql_injection.yml
    skipped 7 lines
    8 8   line_number: 7
    9 9   filename: sequelize_sql_injection.js
    10 10   parent_line_number: 7
    11  - parent_content: sqlite.query(customerQuery)
    12  - 
     11 + snippet: sqlite.query(customerQuery)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/static_asset_with_session/.snapshots/TestJavascriptExpressStaticAssetWithSession--ok.yml
    skipped 8 lines
    9 9   line_number: 2
    10 10   filename: ok.js
    11 11   parent_line_number: 2
    12  - parent_content: '{}'
    13  - 
     12 + snippet: '{}'
    14 13   
    15 14   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/static_asset_with_session/.snapshots/TestJavascriptExpressStaticAssetWithSession--unsafe.yml
    skipped 8 lines
    9 9   line_number: 3
    10 10   filename: unsafe.js
    11 11   parent_line_number: 3
    12  - parent_content: app.use(express.static(__dirname + "/public"))
     12 + snippet: app.use(express.static(__dirname + "/public"))
    13 13  medium:
    14 14   - rule:
    15 15   cwe_ids:
    skipped 5 lines
    21 21   line_number: 1
    22 22   filename: unsafe.js
    23 23   parent_line_number: 1
    24  - parent_content: '{}'
    25  - 
     24 + snippet: '{}'
    26 25   
    27 26   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/ui_redress/.snapshots/TestJavascriptExpressUiRedress--ok_no_ui_redress.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/ui_redress/.snapshots/TestJavascriptExpressUiRedress--ui_redress_vulnerability.yml
    skipped 7 lines
    8 8   line_number: 9
    9 9   filename: ui_redress_vulnerability.js
    10 10   parent_line_number: 9
    11  - parent_content: res.set("X-Frame-Options", req.query.options)
    12  - 
     11 + snippet: res.set("X-Frame-Options", req.query.options)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/unsafe_deserialization/.snapshots/TestJavascriptExpressUnsafeDeserialization--node_serialize.yml
    skipped 7 lines
    8 8   line_number: 5
    9 9   filename: node_serialize.js
    10 10   parent_line_number: 5
    11  - parent_content: nodeSerialize.unserialize(userStr)
    12  - 
     11 + snippet: nodeSerialize.unserialize(userStr)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/unsafe_deserialization/.snapshots/TestJavascriptExpressUnsafeDeserialization--ok_safe_deserialization.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/unsafe_deserialization/.snapshots/TestJavascriptExpressUnsafeDeserialization--serialize_error.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: serialize_error.js
    10 10   parent_line_number: 4
    11  - parent_content: |-
     11 + snippet: |-
    12 12   deserializeError({
    13 13   name: "MyCustomError",
    14 14   message: req.params.error
    15 15   })
    16  - 
    17 16   
    18 17   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/xml_external_entity_vulnerability/.snapshots/TestJavascriptExpressXXEVulnerability--lib_xml_with_noent_true.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: lib_xml_with_noent_true.js
    10 10   parent_line_number: 4
    11  - parent_content: 'noent: true'
    12  - 
     11 + snippet: 'noent: true'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/xml_external_entity_vulnerability/.snapshots/TestJavascriptExpressXXEVulnerability--ok_lib_xml_with_noent_false.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/xml_external_entity_vulnerability/.snapshots/TestJavascriptExpressXXEVulnerability--ok_no_xxe_vuln_present.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/xml_external_entity_vulnerability/.snapshots/TestJavascriptExpressXXEVulnerability--xxe_vuln_with_node_expat.yml
    skipped 7 lines
    8 8   line_number: 6
    9 9   filename: xxe_vuln_with_node_expat.js
    10 10   parent_line_number: 6
    11  - parent_content: parser.parse(req.body.user, false)
    12  - 
     11 + snippet: parser.parse(req.body.user, false)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/xml_external_entity_vulnerability/.snapshots/TestJavascriptExpressXXEVulnerability--xxe_vuln_with_xml2js.yml
    skipped 7 lines
    8 8   line_number: 5
    9 9   filename: xxe_vuln_with_xml2js.js
    10 10   parent_line_number: 5
    11  - parent_content: parser.parseString(req.body.data, function(_err, _result) {})
    12  - 
     11 + snippet: parser.parseString(req.body.data, function(_err, _result) {})
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/express/xml_external_entity_vulnerability/.snapshots/TestJavascriptExpressXXEVulnerability--xxe_vuln_with_xml2json.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: xxe_vuln_with_xml2json.js
    10 10   parent_line_number: 4
    11  - parent_content: 'parser.toXml(req.body, { ignoreNull: true })'
    12  - 
     11 + snippet: 'parser.toXml(req.body, { ignoreNull: true })'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/dangerous_insert_html/.snapshots/TestJavascriptDangeoursInsertHTML--secure-sanitzed.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/dangerous_insert_html/.snapshots/TestJavascriptDangeoursInsertHTML--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/dangerous_insert_html/.snapshots/TestJavascriptDangeoursInsertHTML--unsecure-document_write.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/dangerous_insert_html/.snapshots/TestJavascriptDangeoursInsertHTML--unsecure-element_ref.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/dangerous_insert_html/.snapshots/TestJavascriptDangeoursInsertHTML--unsecure-property_assigment.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/exception/.snapshots/TestJavascriptLangException--promise_reject.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: Promise.reject(new PermissionDenied("fail" + user.email))
    14  - 
     13 + snippet: Promise.reject(new PermissionDenied("fail" + user.email))
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/exception/.snapshots/TestJavascriptLangException--reject.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 7
    13  - parent_content: reject("Error with user " + user)
     13 + snippet: reject("Error with user " + user)
    14 14   - rule:
    15 15   cwe_ids:
    16 16   - "210"
    skipped 5 lines
    22 22   category_groups:
    23 23   - PII
    24 24   parent_line_number: 16
    25  - parent_content: reject("Error with user " + user)
    26  - 
     25 + snippet: reject("Error with user " + user)
    27 26   
    28 27   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/exception/.snapshots/TestJavascriptLangException--throw_custom_exception.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: throw new PermissionDenied(`Error with ${current_user.email}`)
    14  - 
     13 + snippet: throw new PermissionDenied(`Error with ${current_user.email}`)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/exception/.snapshots/TestJavascriptLangException--throw_string.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: throw `${user.email}`
    14  - 
     13 + snippet: throw `${user.email}`
    15 14   
    16 15   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/file_generation/.snapshots/TestJavascriptLangFileGeneration--file_generation.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 18
    13  - parent_content: |-
     13 + snippet: |-
    14 14   fs.writeFile("data.csv", JSON.stringify(users), "utf-8", (err) => {
    15 15   if (err) console.log(err)
    16 16   else console.log("Data saved")
    skipped 9 lines
    26 26   category_groups:
    27 27   - PII
    28 28   parent_line_number: 18
    29  - parent_content: |-
     29 + snippet: |-
    30 30   fs.writeFile("data.csv", JSON.stringify(users), "utf-8", (err) => {
    31 31   if (err) console.log(err)
    32 32   else console.log("Data saved")
    skipped 9 lines
    42 42   category_groups:
    43 43   - PII
    44 44   parent_line_number: 18
    45  - parent_content: |-
     45 + snippet: |-
    46 46   fs.writeFile("data.csv", JSON.stringify(users), "utf-8", (err) => {
    47 47   if (err) console.log(err)
    48 48   else console.log("Data saved")
    49 49   })
    50  - 
    51 50   
    52 51   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/hardcoded_secret/.snapshots/TestJavascriptHardcodedSecret--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/hardcoded_secret/.snapshots/TestJavascriptHardcodedSecret--unsecure_assigment.yml
    skipped 7 lines
    8 8   line_number: 2
    9 9   filename: unsecure_assigment.js
    10 10   parent_line_number: 2
    11  - parent_content: config.clientSecret = "secretHardcodedString"
    12  - 
     11 + snippet: config.clientSecret = "secretHardcodedString"
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/hardcoded_secret/.snapshots/TestJavascriptHardcodedSecret--unsecure_object.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   {
    15 15   clientID: process.env["GOOGLE_CLIENT_ID"],
    16 16   clientSecret: "secretHardcodedString",
    17 17   callbackURL: "/oauth2/redirect/google",
    18 18   scope: ["profile"],
    19 19   }
    20  - 
    21 20   
    22 21   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--axios_insecure.yml
    skipped 7 lines
    8 8   line_number: 2
    9 9   filename: axios_insecure.js
    10 10   parent_line_number: 2
    11  - parent_content: axios.get(insecure_url)
    12  - 
     11 + snippet: axios.get(insecure_url)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--axios_secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--axios_with_config_insecure.yml
    skipped 7 lines
    8 8   line_number: 7
    9 9   filename: axios_with_config_insecure.js
    10 10   parent_line_number: 7
    11  - parent_content: axios(config)
    12  - 
     11 + snippet: axios(config)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--fetch_insecure.yml
    skipped 7 lines
    8 8   line_number: 3
    9 9   filename: fetch_insecure.js
    10 10   parent_line_number: 3
    11  - parent_content: fetch(insecure_url)
    12  - 
     11 + snippet: fetch(insecure_url)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--fetch_secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--request_insecure.yml
    skipped 7 lines
    8 8   line_number: 5
    9 9   filename: request_insecure.js
    10 10   parent_line_number: 5
    11  - parent_content: xhttp.open("GET", insecure_url, true)
    12  - 
     11 + snippet: xhttp.open("GET", insecure_url, true)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/http_insecure/.snapshots/TestJavascriptHTTPInsecure--request_secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt/.snapshots/TestJavascriptJWT--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt/.snapshots/TestJavascriptJWT--unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: |-
     13 + snippet: |-
    14 14   jwt.sign(
    15 15   { user: { email: "[email protected]" } },
    16 16   process.env.JWT_SECRET
    17 17   )
    18  - 
    19 18   
    20 19   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt_hardcoded_secret/.snapshots/TestJavascriptJWTHardcodedSecret--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt_hardcoded_secret/.snapshots/TestJavascriptJWTHardcodedSecret--unsecure.yml
    skipped 7 lines
    8 8   line_number: 3
    9 9   filename: unsecure.js
    10 10   parent_line_number: 3
    11  - parent_content: 'jwt.sign({ foo: "bar" }, "someSecret")'
    12  - 
     11 + snippet: 'jwt.sign({ foo: "bar" }, "someSecret")'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt_hardcoded_secret/.snapshots/TestJavascriptJWTHardcodedSecret--unsecure_jose_jwt.yml
    skipped 7 lines
    8 8   line_number: 5
    9 9   filename: unsecure_jose_jwt.js
    10 10   parent_line_number: 5
    11  - parent_content: |-
     11 + snippet: |-
    12 12   new jose.SignJWT({ 'urn:example:claim': true })
    13 13   .setIssuedAt()
    14 14   .setExpirationTime('2h')
    15 15   .sign(secret)
    16  - 
    17 16   
    18 17   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt_weak_encryption/.snapshots/TestJavascriptJWTWeakEncryption--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/jwt_weak_encryption/.snapshots/TestJavascriptJWTWeakEncryption--unsecure.yml
    skipped 7 lines
    8 8   line_number: 3
    9 9   filename: unsecure.js
    10 10   parent_line_number: 3
    11  - parent_content: |-
     11 + snippet: |-
    12 12   jwt.sign({ foo: "bar" }, process.env.JWT_SECRET, {
    13 13   algorithm: "none",
    14 14   })
    15  - 
    16 15   
    17 16   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/logger/.snapshots/TestJavascriptLangLogger--child.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 7
    14  - parent_content: logger.child(ctx)
    15  - 
     14 + snippet: logger.child(ctx)
    16 15   
    17 16   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/logger/.snapshots/TestJavascriptLangLogger--child_level.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 7
    14  - parent_content: logger.child(ctx)
     14 + snippet: logger.child(ctx)
    15 15   - rule:
    16 16   cwe_ids:
    17 17   - "1295"
    skipped 6 lines
    24 24   category_groups:
    25 25   - PII
    26 26   parent_line_number: 7
    27  - parent_content: logger.child(ctx).info(user.name)
    28  - 
     27 + snippet: logger.child(ctx).info(user.name)
    29 28   
    30 29   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/logger/.snapshots/TestJavascriptLangLogger--console.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 1
    14  - parent_content: console.log(user.name)
     14 + snippet: console.log(user.name)
    15 15   - rule:
    16 16   cwe_ids:
    17 17   - "1295"
    skipped 6 lines
    24 24   category_groups:
    25 25   - PII
    26 26   parent_line_number: 2
    27  - parent_content: console.log("user email is", user.email)
    28  - 
     27 + snippet: console.log("user email is", user.email)
    29 28   
    30 29   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/logger/.snapshots/TestJavascriptLangLogger--datatype_leak.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 1
    14  - parent_content: logger.info(user.email)
    15  - 
     14 + snippet: logger.info(user.email)
    16 15   
    17 16   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/logger/.snapshots/TestJavascriptLangLogger--log.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 1
    14  - parent_content: log.info(user.name)
    15  - 
     14 + snippet: log.info(user.name)
    16 15   
    17 16   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/logger/.snapshots/TestJavascriptLangLogger--ok_no_datatypes.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/open_redirect/.snapshots/TestJavascriptOpenRedirect--insecure.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: insecure.js
    10 10   parent_line_number: 4
    11  - parent_content: window.location.href = myPath
     11 + snippet: window.location.href = myPath
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "601"
    skipped 3 lines
    18 18   line_number: 5
    19 19   filename: insecure.js
    20 20   parent_line_number: 5
    21  - parent_content: location.href = myPath2
    22  - 
     21 + snippet: location.href = myPath2
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/open_redirect/.snapshots/TestJavascriptOpenRedirect--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/session/.snapshots/TestJavascriptLangSession--not_session_leak.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/session/.snapshots/TestJavascriptLangSession--session_leak.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: localStorage.setItem("user", user)
    14  - 
     13 + snippet: localStorage.setItem("user", user)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_encryption/.snapshots/TestJavascriptWeakEncryption--des.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: CryptoJS.DES.encrypt(user.email, "secret key")
    14  - 
     13 + snippet: CryptoJS.DES.encrypt(user.email, "secret key")
    15 14   
    16 15   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_encryption/.snapshots/TestJavascriptWeakEncryption--md5.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 4
    13  - parent_content: crypto.createHmac("md5", key).update(user.email)
     13 + snippet: crypto.createHmac("md5", key).update(user.email)
    14 14   - rule:
    15 15   cwe_ids:
    16 16   - "327"
    skipped 5 lines
    22 22   category_groups:
    23 23   - PII
    24 24   parent_line_number: 5
    25  - parent_content: crypto.createHash("md5").update(user.email)
     25 + snippet: crypto.createHash("md5").update(user.email)
    26 26   - rule:
    27 27   cwe_ids:
    28 28   - "327"
    skipped 5 lines
    34 34   category_groups:
    35 35   - PII
    36 36   parent_line_number: 9
    37  - parent_content: CryptoJS.MD5(user.email)
    38  - 
     37 + snippet: CryptoJS.MD5(user.email)
    39 38   
    40 39   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_encryption/.snapshots/TestJavascriptWeakEncryption--rc4.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: CryptoJS.RC4.encrypt(user.email, "secret key")
    14  - 
     13 + snippet: CryptoJS.RC4.encrypt(user.email, "secret key")
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_encryption/.snapshots/TestJavascriptWeakEncryption--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_encryption/.snapshots/TestJavascriptWeakEncryption--sha1.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: crypto.createHmac("sha1", key).update(user.email)
     13 + snippet: crypto.createHmac("sha1", key).update(user.email)
    14 14   - rule:
    15 15   cwe_ids:
    16 16   - "327"
    skipped 5 lines
    22 22   category_groups:
    23 23   - PII
    24 24   parent_line_number: 6
    25  - parent_content: crypto.createHash("sha1").update(user.email)
     25 + snippet: crypto.createHash("sha1").update(user.email)
    26 26   - rule:
    27 27   cwe_ids:
    28 28   - "327"
    skipped 5 lines
    34 34   category_groups:
    35 35   - PII
    36 36   parent_line_number: 8
    37  - parent_content: CryptoJS.HmacSHA1(user.email, "Key")
     37 + snippet: CryptoJS.HmacSHA1(user.email, "Key")
    38 38   - rule:
    39 39   cwe_ids:
    40 40   - "327"
    skipped 5 lines
    46 46   category_groups:
    47 47   - PII
    48 48   parent_line_number: 9
    49  - parent_content: CryptoJS.SHA1(user.email)
    50  - 
     49 + snippet: CryptoJS.SHA1(user.email)
    51 50   
    52 51   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--argon2i.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 4
    14  - parent_content: |-
     14 + snippet: |-
    15 15   argon2.hash(currentUser.password, {
    16 16   type: argon2.argon2i,
    17 17   memoryCost: 2 ** 16,
    18 18   hashLength: 50,
    19 19   })
    20  - 
    21 20   
    22 21   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--des_password.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 3
    14  - parent_content: CryptoJS.DES.encrypt(user.password, "secret key")
    15  - 
     14 + snippet: CryptoJS.DES.encrypt(user.password, "secret key")
    16 15   
    17 16   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--md5_password.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 4
    14  - parent_content: crypto.createHmac("md5", key).update(user.password)
     14 + snippet: crypto.createHmac("md5", key).update(user.password)
    15 15   - rule:
    16 16   cwe_ids:
    17 17   - "327"
    skipped 6 lines
    24 24   category_groups:
    25 25   - PII
    26 26   parent_line_number: 5
    27  - parent_content: crypto.createHash("md5").update(user.password)
     27 + snippet: crypto.createHash("md5").update(user.password)
    28 28   - rule:
    29 29   cwe_ids:
    30 30   - "327"
    skipped 6 lines
    37 37   category_groups:
    38 38   - PII
    39 39   parent_line_number: 9
    40  - parent_content: CryptoJS.MD5(user.password)
    41  - 
     40 + snippet: CryptoJS.MD5(user.password)
    42 41   
    43 42   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--ok_encryption.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--ok_not_a_password.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: CryptoJS.MD5(user.email)
     13 + snippet: CryptoJS.MD5(user.email)
    14 14   - rule:
    15 15   cwe_ids:
    16 16   - "327"
    skipped 5 lines
    22 22   category_groups:
    23 23   - PII
    24 24   parent_line_number: 4
    25  - parent_content: CryptoJS.DES.encrypt(customer.email, "secret key")
    26  - 
     25 + snippet: CryptoJS.DES.encrypt(customer.email, "secret key")
    27 26   
    28 27   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--rc4_password.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 3
    14  - parent_content: CryptoJS.RC4.encrypt(user.password, "secret key")
    15  - 
     14 + snippet: CryptoJS.RC4.encrypt(user.password, "secret key")
    16 15   
    17 16   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/lang/weak_password_encryption/.snapshots/TestJavascriptWeakPasswordEncryption--sha1_password.yml
    skipped 10 lines
    11 11   category_groups:
    12 12   - PII
    13 13   parent_line_number: 4
    14  - parent_content: crypto.createHmac("sha1", key).update(user.password)
     14 + snippet: crypto.createHmac("sha1", key).update(user.password)
    15 15   - rule:
    16 16   cwe_ids:
    17 17   - "327"
    skipped 6 lines
    24 24   category_groups:
    25 25   - PII
    26 26   parent_line_number: 5
    27  - parent_content: crypto.createHash("sha1").update(user.password)
     27 + snippet: crypto.createHash("sha1").update(user.password)
    28 28   - rule:
    29 29   cwe_ids:
    30 30   - "327"
    skipped 6 lines
    37 37   category_groups:
    38 38   - PII
    39 39   parent_line_number: 7
    40  - parent_content: CryptoJS.HmacSHA1(user.password, "Key")
     40 + snippet: CryptoJS.HmacSHA1(user.password, "Key")
    41 41   - rule:
    42 42   cwe_ids:
    43 43   - "327"
    skipped 6 lines
    50 50   category_groups:
    51 51   - PII
    52 52   parent_line_number: 8
    53  - parent_content: CryptoJS.SHA1(user.password)
    54  - 
     53 + snippet: CryptoJS.SHA1(user.password)
    55 54   
    56 55   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/react/dangerously_set_inner_html/.snapshots/TestJavascriptReactDangerouslySetInnerHTML--secure-sanitize.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/react/dangerously_set_inner_html/.snapshots/TestJavascriptReactDangerouslySetInnerHTML--secure-template_string.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/react/dangerously_set_inner_html/.snapshots/TestJavascriptReactDangerouslySetInnerHTML--unsecure-raw_input.yml
    skipped 7 lines
    8 8   line_number: 2
    9 9   filename: unsecure-raw_input.js
    10 10   parent_line_number: 2
    11  - parent_content: '{ __html: input }'
    12  - 
     11 + snippet: '{ __html: input }'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/react/dangerously_set_inner_html/.snapshots/TestJavascriptReactDangerouslySetInnerHTML--unsecure-template_string.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: unsecure-template_string.js
    10 10   parent_line_number: 4
    11  - parent_content: '{ __html: `<a href=${input}>home page</a>` }'
    12  - 
     11 + snippet: '{ __html: `<a href=${input}>home page</a>` }'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/react/google_analytics/.snapshots/TestJavascriptReactGoogleAnalytics--insecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: |-
     13 + snippet: |-
    14 14   ReactGA.event({
    15 15   category: "user",
    16 16   action: "logged_in",
    skipped 10 lines
    27 27   category_groups:
    28 28   - PII
    29 29   parent_line_number: 2
    30  - parent_content: |-
     30 + snippet: |-
    31 31   ReactGA.event({
    32 32   category: "user",
    33 33   action: "logged_in",
    34 34   value: user.email,
    35 35   })
    36  - 
    37 36   
    38 37   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/react/google_analytics/.snapshots/TestJavascriptReactGoogleAnalytics--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/airbrake/.snapshots/TestJavascriptAirbrake--datatype_in_notify.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - Personal Data
    12 12   parent_line_number: 16
    13  - parent_content: |-
     13 + snippet: |-
    14 14   airbrake.notify({
    15 15   error: err,
    16 16   params: { user: user.ipAddress },
    17 17   })
    18  - 
    19 18   
    20 19   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/airbrake/.snapshots/TestJavascriptAirbrake--ok_no_datatype.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/algolia/.snapshots/TestJavascriptAlgolia--datatype_in_index.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 4
    13  - parent_content: myAlgolia.initIndex(company.bank_account_number)
    14  - 
     13 + snippet: myAlgolia.initIndex(company.bank_account_number)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/algolia/.snapshots/TestJavascriptAlgolia--datatype_in_save_object.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - Personal Data
    12 12   parent_line_number: 8
    13  - parent_content: |-
     13 + snippet: |-
    14 14   index
    15 15   .saveObject(userObj, { autoGenerateObjectIDIfNotExist: true })
    16 16  medium:
    skipped 8 lines
    25 25   category_groups:
    26 26   - PII
    27 27   parent_line_number: 12
    28  - parent_content: 'index.saveObjects([{ email: user.email }])'
    29  - 
     28 + snippet: 'index.saveObjects([{ email: user.email }])'
    30 29   
    31 30   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/bugsnag/.snapshots/TestJavascriptBugsnag--datatype_in_breadcrumb.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: Bugsnag.leaveBreadcrumb(user.email)
    14  - 
     13 + snippet: Bugsnag.leaveBreadcrumb(user.email)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/bugsnag/.snapshots/TestJavascriptBugsnag--datatype_in_notify.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - Personal Data
    12 12   parent_line_number: 5
    13  - parent_content: 'Bugsnag.notify(user.ip_address + " : " + e)'
    14  - 
     13 + snippet: 'Bugsnag.notify(user.ip_address + " : " + e)'
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/bugsnag/.snapshots/TestJavascriptBugsnag--datatype_in_session.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 4
    13  - parent_content: bugSession.notify(user.email)
    14  - 
     13 + snippet: bugSession.notify(user.email)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/bugsnag/.snapshots/TestJavascriptBugsnag--datatype_in_start.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   Bugsnag.start({
    15 15   onError: function (e) {
    16 16   e.setUser(user.id, user.email, user.name)
    skipped 16 lines
    33 33   category_groups:
    34 34   - PII
    35 35   parent_line_number: 1
    36  - parent_content: |-
     36 + snippet: |-
    37 37   Bugsnag.start({
    38 38   onError: function (e) {
    39 39   e.setUser(user.id, user.email, user.name)
    skipped 16 lines
    56 56   category_groups:
    57 57   - PII
    58 58   parent_line_number: 1
    59  - parent_content: |-
     59 + snippet: |-
    60 60   Bugsnag.start({
    61 61   onError: function (e) {
    62 62   e.setUser(user.id, user.email, user.name)
    skipped 5 lines
    68 68   session.setUser(user.email)
    69 69   }
    70 70   })
    71  - 
    72 71   
    73 72   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/bugsnag/.snapshots/TestJavascriptBugsnag--ok_ignored_datatype_only.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/datadog/.snapshots/TestJavascriptDataDog--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/datadog/.snapshots/TestJavascriptDataDog--unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 11
    13  - parent_content: client.event("user", "logged_in", {}, user)
    14  - 
     13 + snippet: client.event("user", "logged_in", {}, user)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/datadog_browser/.snapshots/TestJavascriptDataDogBrowser--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/datadog_browser/.snapshots/TestJavascriptDataDogBrowser--unsecure.yml
    skipped 7 lines
    8 8   line_number: 2
    9 9   filename: unsecure.js
    10 10   parent_line_number: 2
    11  - parent_content: 'trackUserInteractions: true'
    12  - 
     11 + snippet: 'trackUserInteractions: true'
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/dom_purify/.snapshots/TestJavascriptDomPurify--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/dom_purify/.snapshots/TestJavascriptDomPurify--unsecure.yml
    skipped 7 lines
    8 8   line_number: 2
    9 9   filename: unsecure.js
    10 10   parent_line_number: 2
    11  - parent_content: DOMPurify.sanitize(dirty, config)
    12  - 
     11 + snippet: DOMPurify.sanitize(dirty, config)
    13 12   
    14 13   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/elasticsearch/.snapshots/TestJavascriptElasticSearch--unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: elasticsearch.index(user)
    14  - 
     13 + snippet: elasticsearch.index(user)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/google_analytics/.snapshots/TestJavascriptGoogleAnalytics--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/google_analytics/.snapshots/TestJavascriptGoogleAnalytics--unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   gtag("event", "screen_view", {
    15 15   user: {
    16 16   email: "[email protected]",
    17 17   },
    18 18   })
    19  - 
    20 19   
    21 20   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/google_tag_manager/.snapshots/TestJavascriptGTM--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/google_tag_manager/.snapshots/TestJavascriptGTM--unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: |-
     13 + snippet: |-
    14 14   window.dataLayer.push({
    15 15   email: user.email,
    16 16   })
    skipped 8 lines
    25 25   category_groups:
    26 26   - PII
    27 27   parent_line_number: 3
    28  - parent_content: |-
     28 + snippet: |-
    29 29   window.dataLayer.push({
    30 30   email: user.email,
    31 31   })
    32  - 
    33 32   
    34 33   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/honeybadger/.snapshots/TestJavascriptHoneybadger--secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/honeybadger/.snapshots/TestJavascriptHoneybadger--unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: Honeybadger.setContext(context)
    14  - 
     13 + snippet: Honeybadger.setContext(context)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/new_relic/.snapshots/TestJavascriptNewRelic--datatype_in_interaction_set_attribute.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: |-
     13 + snippet: |-
    14 14   newrelic.interaction()
    15 15   .setAttribute("username", user.first_name)
    16 16   - rule:
    skipped 7 lines
    24 24   category_groups:
    25 25   - PII
    26 26   parent_line_number: 5
    27  - parent_content: |-
     27 + snippet: |-
    28 28   newrelic.interaction()
    29 29   .setAttribute("username", user.first_name)
    30 30   .setAttribute("postal-code", user.post_code)
    skipped 8 lines
    39 39   category_groups:
    40 40   - PII
    41 41   parent_line_number: 13
    42  - parent_content: interaction.setAttribute("email", user.email_address)
    43  - 
     42 + snippet: interaction.setAttribute("email", user.email_address)
    44 43   
    45 44   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/new_relic/.snapshots/TestJavascriptNewRelic--datatype_in_notice_error.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - Personal Data
    12 12   parent_line_number: 7
    13  - parent_content: newrelic.noticeError(err, customer.ip_address)
    14  - 
     13 + snippet: newrelic.noticeError(err, customer.ip_address)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/new_relic/.snapshots/TestJavascriptNewRelic--datatype_in_set_custom_attribute.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: newrelic.setCustomAttribute("user-id", customer.email)
    14  - 
     13 + snippet: newrelic.setCustomAttribute("user-id", customer.email)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/new_relic/.snapshots/TestJavascriptNewRelic--datatype_in_set_page_view_name.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: newrelic.setPageViewName(customer.bank_account_number, "$host")
    14  - 
     13 + snippet: newrelic.setPageViewName(customer.bank_account_number, "$host")
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/new_relic/.snapshots/TestJavascriptNewRelic--ok_ignored_datatypes_only.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/new_relic/.snapshots/TestJavascriptNewRelic--ok_no_datatypes.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/open_telemetry/.snapshots/TestJavascriptOpenTelemetry--datatype_in_add_event.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 4
    13  - parent_content: |-
     13 + snippet: |-
    14 14   currentSpan.addEvent('my-event', {
    15 15   'event.metadata': customer.emailAddress
    16 16   })
    17  - 
    18 17   
    19 18   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/open_telemetry/.snapshots/TestJavascriptOpenTelemetry--datatype_in_record_exception.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - Personal Data
    12 12   parent_line_number: 9
    13  - parent_content: span.recordException(currentUser.ipAddress)
    14  - 
     13 + snippet: span.recordException(currentUser.ipAddress)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/open_telemetry/.snapshots/TestJavascriptOpenTelemetry--datatype_in_set_attribute.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 6
    13  - parent_content: span.setAttribute("current-user", currentUser.emailAddress)
     13 + snippet: span.setAttribute("current-user", currentUser.emailAddress)
    14 14   - rule:
    15 15   cwe_ids:
    16 16   - "201"
    skipped 5 lines
    22 22   category_groups:
    23 23   - PII
    24 24   parent_line_number: 11
    25  - parent_content: span.setAttribute("current-user", user.email)
    26  - 
     25 + snippet: span.setAttribute("current-user", user.email)
    27 26   
    28 27   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/open_telemetry/.snapshots/TestJavascriptOpenTelemetry--datatype_in_set_status.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 7
    13  - parent_content: |-
     13 + snippet: |-
    14 14   span.setStatus({
    15 15   code: opentelemetry.SpanStatusCode.ERROR,
    16 16   message: "Bad connection for " + currentUser.emailAddress
    17 17   })
    18  - 
    19 18   
    20 19   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/open_telemetry/.snapshots/TestJavascriptOpenTelemetry--ok_no_datatypes.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/passport_hardcoded_secret/.snapshots/TestJavascripPassportHardcodedSecret--unsecure.yml
    skipped 7 lines
    8 8   line_number: 4
    9 9   filename: unsecure.js
    10 10   parent_line_number: 4
    11  - parent_content: '{ clientSecret: "hardcodedSecret" }'
     11 + snippet: '{ clientSecret: "hardcodedSecret" }'
    12 12   - rule:
    13 13   cwe_ids:
    14 14   - "798"
    skipped 3 lines
    18 18   line_number: 5
    19 19   filename: unsecure.js
    20 20   parent_line_number: 5
    21  - parent_content: passport.use(strategy)
    22  - 
     21 + snippet: passport.use(strategy)
    23 22   
    24 23   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/rollbar/.snapshots/TestJavascriptRollbar--browser_secure.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/rollbar/.snapshots/TestJavascriptRollbar--browser_unsecure.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 3
    13  - parent_content: Rollbar.critical("Connection error from remote Payments API", user)
    14  - 
     13 + snippet: Rollbar.critical("Connection error from remote Payments API", user)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--datatype_in_alias.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 7
    13  - parent_content: |-
     13 + snippet: |-
    14 14   appAnalytics.alias({
    15 15   previousId: user.email,
    16 16   userId: user.id,
    17 17   })
    18  - 
    19 18   
    20 19   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--datatype_in_group.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 6
    13  - parent_content: |-
     13 + snippet: |-
    14 14   analytics.group({
    15 15   userId: user.id,
    16 16   groupId: user.job_title,
    17 17   traits: {},
    18 18   })
    19  - 
    20 19   
    21 20   
  • ■ ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--datatype_in_identify.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 5
    13  - parent_content: |-
     13 + snippet: |-
    14 14   analytics.identify({
    15 15   userId: user.id,
    16 16   traits: {
    skipped 14 lines
    31 31   category_groups:
    32 32   - PII
    33 33   parent_line_number: 5
    34  - parent_content: |-
     34 + snippet: |-
    35 35   analytics.identify({
    36 36   userId: user.id,
    37 37   traits: {
    skipped 14 lines
    52 52   category_groups:
    53 53   - PII
    54 54   parent_line_number: 5
    55  - parent_content: |-
     55 + snippet: |-
    56 56   analytics.identify({
    57 57   userId: user.id,
    58 58   traits: {
    skipped 14 lines
    73 73   category_groups:
    74 74   - PII
    75 75   parent_line_number: 18
    76  - parent_content: browser.identify(user.email)
    77  - 
     76 + snippet: browser.identify(user.email)
    78 77   
    79 78   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--datatype_in_page.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 6
    13  - parent_content: |-
     13 + snippet: |-
    14 14   analytics.page({
    15 15   userId: customer.id,
    16 16   category: "Shopping Cart",
    skipped 1 lines
    18 18   path: "/cart/"+customer.bank_account_number
    19 19   },
    20 20   })
    21  - 
    22 21   
    23 22   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--datatype_in_track.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - Personal Data
    12 12   parent_line_number: 5
    13  - parent_content: |-
     13 + snippet: |-
    14 14   client.track({
    15 15   event: "some event name",
    16 16   userId: user.id,
    skipped 11 lines
    28 28   category_groups:
    29 29   - PII
    30 30   parent_line_number: 17
    31  - parent_content: browser.track(user.email)
    32  - 
     31 + snippet: browser.track(user.email)
    33 32   
    34 33   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--ok_ignored_datatypes.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/segment/.snapshots/TestJavascriptSegmentDataflow--ok_no_datatypes.yml
    1 1  {}
    2 2   
    3 3   
    4  - 
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_add_breadcrumb.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   Sentry.addBreadcrumb({
    15 15   message: `my message for ${user.email}`,
    16 16   // ...
    17 17   })
    18  - 
    19 18   
    20 19   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_capture_event.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   Sentry.captureEvent({
    15 15   message: "user successfully logged in " + current_user.email,
    16 16   stacktrace: [
    17 17   // ...
    18 18   ],
    19 19   })
    20  - 
    21 20   
    22 21   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_capture_exception.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: |-
     13 + snippet: |-
    14 14   Sentry.captureException(
    15 15   new Error(`user ${current_user.email} couldn't log in!`)
    16 16   )
    17  - 
    18 17   
    19 18   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_capture_message.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 1
    13  - parent_content: Sentry.captureMessage("User has successfully signed in " + current_user.email)
    14  - 
     13 + snippet: Sentry.captureMessage("User has successfully signed in " + current_user.email)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_configure_scope_set_extra.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: scope.setExtra("email", user.email)
    14  - 
     13 + snippet: scope.setExtra("email", user.email)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_configure_scope_set_tag.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: scope.setTag("user_email", user.email)
    14  - 
     13 + snippet: scope.setTag("user_email", user.email)
    15 14   
    16 15   
  • ■ ■ ■ ■ ■
    pkg/commands/process/settings/rules/javascript/third_parties/sentry/.snapshots/TestJavascriptThirdPartySentry--javascript_configure_scope_set_user.yml
    skipped 9 lines
    10 10   category_groups:
    11 11   - PII
    12 12   parent_line_number: 2
    13  - parent_content: 'scope.setUser({ email: user.email })'
    14  - 
     13 + snippet: 'scope.setUser({ email: user.email })'
    15 14   
    16 15   
Please wait...
Page is in error, reload to recover