From eaaed729bbf9e4d70ad0fdfc45c7430d9a8620b8 Mon Sep 17 00:00:00 2001 From: elsapet Date: Mon, 13 Feb 2023 11:21:41 +0200 Subject: [PATCH] feat(ruby rules): add ruby google dataflow rule (#553) * feat: add ruby google dataflow rule * Update pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow.yml Co-authored-by: Mark Michon --------- Co-authored-by: Mark Michon --- integration/rules/ruby_test.go | 10 ++ .../ruby/third_parties/google_dataflow.yml | 140 ++++++++++++++++++ ...ties_google_dataflow_datatype_in_config.rb | 79 ++++++++++ ...google_dataflow_datatype_in_job_message.rb | 47 ++++++ ...es_google_dataflow_datatype_in_metadata.rb | 73 +++++++++ ...oogle_dataflow_datatype_in_params_entry.rb | 38 +++++ ...taflow_datatype_in_snapshot_job_request.rb | 38 +++++ ...le_dataflow_datatype_in_snapshot_setter.rb | 70 +++++++++ ...dataflow_datatype_in_structured_message.rb | 38 +++++ ...ow_datatype_in_structured_message_param.rb | 38 +++++ ...aflow_datatype_in_template_job_creation.rb | 61 ++++++++ ...le_dataflow_fail_with_different_version.rb | 61 ++++++++ ...ogle_dataflow_ok_ignored_datatypes_only.rb | 15 ++ ...parties_google_dataflow_ok_no_datatypes.rb | 47 ++++++ ...ruby_third_parties_google_dataflow_temp.rb | 117 +++++++++++++++ ...ties_google_dataflow_datatype_in_config.rb | 25 ++++ ...google_dataflow_datatype_in_job_message.rb | 15 ++ ...es_google_dataflow_datatype_in_metadata.rb | 35 +++++ ...oogle_dataflow_datatype_in_params_entry.rb | 15 ++ ...taflow_datatype_in_snapshot_job_request.rb | 15 ++ ...le_dataflow_datatype_in_snapshot_setter.rb | 15 ++ ...dataflow_datatype_in_structured_message.rb | 15 ++ ...ow_datatype_in_structured_message_param.rb | 15 ++ ...aflow_datatype_in_template_job_creation.rb | 15 ++ ...le_dataflow_fail_with_different_version.rb | 15 ++ ...ogle_dataflow_ok_ignored_datatypes_only.rb | 5 + ...parties_google_dataflow_ok_no_datatypes.rb | 5 + .../testdata/datatype_in_config.rb | 14 ++ .../testdata/datatype_in_job_message.rb | 2 + .../testdata/datatype_in_metadata.rb | 6 + .../testdata/datatype_in_params_entry.rb | 2 + .../datatype_in_snapshot_job_request.rb | 2 + .../testdata/datatype_in_snapshot_setter.rb | 9 ++ .../datatype_in_structured_message.rb | 4 + .../datatype_in_structured_message_param.rb | 2 + .../datatype_in_template_job_creation.rb | 5 + .../testdata/fail_with_different_version.rb | 5 + .../testdata/ok_ignored_datatypes_only.rb | 2 + .../testdata/ok_no_datatypes.rb | 9 ++ 39 files changed, 1124 insertions(+) create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow.yml create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_config.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_job_message.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_metadata.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_fail_with_different_version.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_no_datatypes.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_temp.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_config.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_job_message.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_metadata.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_fail_with_different_version.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_no_datatypes.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_ignored_datatypes_only.rb create mode 100644 pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb diff --git a/integration/rules/ruby_test.go b/integration/rules/ruby_test.go index 55dc9b7fd..bcf8a4814 100644 --- a/integration/rules/ruby_test.go +++ b/integration/rules/ruby_test.go @@ -303,3 +303,13 @@ func TestRubyThirdPartiesSegmentDataflow(t *testing.T) { t.Parallel() runRulesTest("ruby/third_parties/segment", "dataflow", "ruby_third_parties_segment", t) } + +func TestRubyThirdPartiesGoogleDataflowSummary(t *testing.T) { + t.Parallel() + runRulesTest("ruby/third_parties/google_dataflow", "summary", "ruby_third_parties_google_dataflow", t) +} + +func TestRubyThirdPartiesGoogleDataflowDataflow(t *testing.T) { + t.Parallel() + runRulesTest("ruby/third_parties/google_dataflow", "dataflow", "ruby_third_parties_google_dataflow", t) +} diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow.yml b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow.yml new file mode 100644 index 000000000..812a2955a --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow.yml @@ -0,0 +1,140 @@ +patterns: + - pattern: | + $.message_text = $ + filters: + - variable: VAR + detection: google_dataflow_message_text_classes + - variable: DATA_TYPE + detection: datatype + - pattern: | + $.description = $ + filters: + - variable: VAR + detection: google_dataflow_description_classes + - variable: DATA_TYPE + detection: datatype + - pattern: | + $.value = $ + filters: + - variable: VAR + detection: google_dataflow_value_classes + - variable: DATA_TYPE + detection: datatype + - pattern: | + $.create_job_from_template($<...>$$<...>) + filters: + - variable: VAR + detection: google_dataflow_templates_service_client_init + - variable: DATA_TYPE + detection: datatype + - pattern: | + $.$ = $ + filters: + - variable: VAR + detection: google_dataflow_template_metadata_init + - variable: DATA_TYPE + detection: datatype + - variable: METHOD + values: + - description + - name + - pattern: | + $.metadata = $<...>$$<...> + filters: + - variable: VAR + detection: google_dataflow_config + - variable: DATA_TYPE + detection: datatype +languages: + - ruby +auxiliary: + - id: google_dataflow_client_init + patterns: + - | + Google::Cloud::Dataflow::$<_>::$<_>::Client.new + - pattern: | + Google::Cloud::Dataflow.$ + filters: + - variable: METHOD + values: + - messages + - templates_service + - flex_templates_service + - jobs + - metrics + - snapshots + - id: google_dataflow_config + patterns: + - pattern: | + $.configure + filters: + - variable: VAR + detection: google_dataflow_client_init + - pattern: | + $.configure { |$$<_:identifier>| } + filters: + - variable: VAR + detection: google_dataflow_client_init + - id: google_dataflow_message_text_classes + patterns: + - | + Google::Cloud::Dataflow::$<_>::StructuredMessage.new + - | + Google::Cloud::Dataflow::$<_>::JobMessage.new + - id: google_dataflow_snapshots_client_init + patterns: + - | + Google::Cloud::Dataflow::$<_>::Snapshots::Client.new + - | + Google::Cloud::Dataflow.snapshots + - id: google_dataflow_description_classes + patterns: + - | + Google::Cloud::Dataflow::$<_>::SnapshotJobRequest.new + - pattern: | + $.get_snapshot + fitlers: + - variable: VAR + detection: google_dataflow_snapshots_client_init + - id: google_dataflow_value_classes + patterns: + - | + Google::Cloud::Dataflow::$<_>::JobMessage.new + - | + Google::Cloud::Dataflow::$<_>::CreateJobFromTemplateRequest::ParametersEntry.new + - | + Google::Cloud::Dataflow::$<_>::ParameterMetadata::CustomMetadataEntry.new + - | + Google::Cloud::Dataflow::$<_>::StructuredMessage::Parameter.new + - id: google_dataflow_templates_service_client_init + patterns: + - | + Google::Cloud::Dataflow::$<_>::TemplatesService::Client.new + - | + Google::Cloud::Dataflow.templates_service + - id: google_dataflow_template_metadata_init + patterns: + - | + Google::Cloud::Dataflow::$<_>::TemplateMetadata.new +trigger: local +severity: + default: low + PII: critical + PHI: medium + PD: high +skip_data_types: + - "Unique Identifier" +metadata: + description: "Do not send sensitive data to Google Dataflow." + remediation_message: | + ## Description + Leaking sensitive data to a third-party service is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to Google Dataflow. + + ## Remediations + + When sending data to third-party services, ensure all sensitive data is removed. + + ## Resources + - [Google Dataflow Docs](https://cloud.google.com/ruby/docs/reference/google-cloud-dataflow/latest) + dsr_id: DSR-1 + id: ruby_third_parties_google_dataflow diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_config.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_config.rb new file mode 100644 index 000000000..c8cdbe2fb --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_config.rb @@ -0,0 +1,79 @@ +data_types: + - name: Email Address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 8 + field_name: email + object_name: current_user + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 13 + field_name: email + object_name: current_user + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 14 + field_name: email + object_name: current_user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: Email Address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 8 + parent: + line_number: 8 + content: 'config.metadata = { current_user_id: current_user.email }' + field_name: email + object_name: current_user + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 14 + parent: + line_number: 14 + content: 'client_config.metadata = { current_user_id: current_user.email }' + field_name: email + object_name: current_user + subject_name: User + - detector_id: google_dataflow_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 2 + parent: + line_number: 2 + content: Google::Cloud::Dataflow.messages + content: | + Google::Cloud::Dataflow.$ + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::Messages::Client.new + content: | + Google::Cloud::Dataflow::$<_>::$<_>::Client.new + - detector_id: google_dataflow_config + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 6 + parent: + line_number: 6 + content: client.configure + content: | + $.configure + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + line_number: 7 + parent: + line_number: 7 + content: config + content: | + $.configure { |$$<_:identifier>| } +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_job_message.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_job_message.rb new file mode 100644 index 000000000..743a1d47d --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_job_message.rb @@ -0,0 +1,47 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb + line_number: 2 + field_name: ip_address + object_name: user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb + line_number: 2 + parent: + line_number: 2 + content: 'msg.message_text = "Current user: #{user.ip_address}"' + field_name: ip_address + object_name: user + subject_name: User + - detector_id: google_dataflow_message_text_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::JobMessage.new + content: | + Google::Cloud::Dataflow::$<_>::JobMessage.new + - detector_id: google_dataflow_value_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::JobMessage.new + content: | + Google::Cloud::Dataflow::$<_>::JobMessage.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_metadata.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_metadata.rb new file mode 100644 index 000000000..0084f74b2 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_metadata.rb @@ -0,0 +1,73 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 2 + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 5 + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 6 + field_name: ip_address + object_name: customer + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 2 + parent: + line_number: 2 + content: 'custom_metadata.value = "ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 5 + parent: + line_number: 5 + content: 'template_metadata.description ="ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 6 + parent: + line_number: 6 + content: 'template_metadata.name ="ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - detector_id: google_dataflow_template_metadata_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 4 + parent: + line_number: 4 + content: Google::Cloud::Dataflow::V1beta3::TemplateMetadata.new + content: | + Google::Cloud::Dataflow::$<_>::TemplateMetadata.new + - detector_id: google_dataflow_value_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::ParameterMetadata::CustomMetadataEntry.new + content: | + Google::Cloud::Dataflow::$<_>::ParameterMetadata::CustomMetadataEntry.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb new file mode 100644 index 000000000..f22a7c26c --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb @@ -0,0 +1,38 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb + line_number: 2 + field_name: ip_address + object_name: customer + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb + line_number: 2 + parent: + line_number: 2 + content: 'param.value = "ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - detector_id: google_dataflow_value_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest::ParametersEntry.new + content: | + Google::Cloud::Dataflow::$<_>::CreateJobFromTemplateRequest::ParametersEntry.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb new file mode 100644 index 000000000..edc1e8a0f --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb @@ -0,0 +1,38 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb + line_number: 2 + field_name: ip_address + object_name: user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb + line_number: 2 + parent: + line_number: 2 + content: 'req.description = "Current user: #{user.ip_address}"' + field_name: ip_address + object_name: user + subject_name: User + - detector_id: google_dataflow_description_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest.new + content: | + Google::Cloud::Dataflow::$<_>::SnapshotJobRequest.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb new file mode 100644 index 000000000..f4629e673 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb @@ -0,0 +1,70 @@ +data_types: + - name: Email Address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 9 + field_name: email_address + object_name: user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: Email Address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 9 + parent: + line_number: 9 + content: 'snapshot.description = "Current user: #{user.email_address}"' + field_name: email_address + object_name: user + subject_name: User + - detector_id: google_dataflow_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 2 + parent: + line_number: 2 + content: Google::Cloud::Dataflow.snapshots + content: | + Google::Cloud::Dataflow.$ + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new + content: | + Google::Cloud::Dataflow::$<_>::$<_>::Client.new + - detector_id: google_dataflow_description_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 6 + parent: + line_number: 6 + content: snapshot_client.get_snapshot + content: | + $.get_snapshot + - detector_id: google_dataflow_snapshots_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 2 + parent: + line_number: 2 + content: Google::Cloud::Dataflow.snapshots + content: | + Google::Cloud::Dataflow.snapshots + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new + content: | + Google::Cloud::Dataflow::$<_>::Snapshots::Client.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb new file mode 100644 index 000000000..015abd0be --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb @@ -0,0 +1,38 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb + line_number: 4 + field_name: ip_address + object_name: user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb + line_number: 4 + parent: + line_number: 4 + content: 'str_msg.message_text = "Current user: #{user.ip_address}"' + field_name: ip_address + object_name: user + subject_name: User + - detector_id: google_dataflow_message_text_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::StructuredMessage.new + content: | + Google::Cloud::Dataflow::$<_>::StructuredMessage.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb new file mode 100644 index 000000000..fc5d556bf --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb @@ -0,0 +1,38 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb + line_number: 2 + field_name: ip_address + object_name: customer + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb + line_number: 2 + parent: + line_number: 2 + content: 'param2.value = "ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - detector_id: google_dataflow_value_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::StructuredMessage::Parameter.new + content: | + Google::Cloud::Dataflow::$<_>::StructuredMessage::Parameter.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb new file mode 100644 index 000000000..28dcf4fc4 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb @@ -0,0 +1,61 @@ +data_types: + - name: Email Address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + line_number: 5 + field_name: email + object_name: user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: Email Address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + line_number: 5 + parent: + line_number: 5 + content: 'templates_client.create_job_from_template(project_id: "123", job_name: "my-job", parameters: { current_user: user.email })' + field_name: email + object_name: user + subject_name: User + - detector_id: google_dataflow_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new + content: | + Google::Cloud::Dataflow::$<_>::$<_>::Client.new + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + line_number: 4 + parent: + line_number: 4 + content: Google::Cloud::Dataflow.templates_service + content: | + Google::Cloud::Dataflow.$ + - detector_id: google_dataflow_templates_service_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new + content: | + Google::Cloud::Dataflow::$<_>::TemplatesService::Client.new + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + line_number: 4 + parent: + line_number: 4 + content: Google::Cloud::Dataflow.templates_service + content: | + Google::Cloud::Dataflow.templates_service +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_fail_with_different_version.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_fail_with_different_version.rb new file mode 100644 index 000000000..5b2daae92 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_fail_with_different_version.rb @@ -0,0 +1,61 @@ +data_types: + - name: Email Address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + line_number: 5 + field_name: email + object_name: user + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: Email Address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + line_number: 5 + parent: + line_number: 5 + content: 'templates_client.create_job_from_template(project_id: "123", job_name: "my-job", parameters: { current_user: user.email })' + field_name: email + object_name: user + subject_name: User + - detector_id: google_dataflow_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V2::TemplatesService::Client.new + content: | + Google::Cloud::Dataflow::$<_>::$<_>::Client.new + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + line_number: 4 + parent: + line_number: 4 + content: Google::Cloud::Dataflow.templates_service + content: | + Google::Cloud::Dataflow.$ + - detector_id: google_dataflow_templates_service_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V2::TemplatesService::Client.new + content: | + Google::Cloud::Dataflow::$<_>::TemplatesService::Client.new + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + line_number: 4 + parent: + line_number: 4 + content: Google::Cloud::Dataflow.templates_service + content: | + Google::Cloud::Dataflow.templates_service +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb new file mode 100644 index 000000000..23ca17e19 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb @@ -0,0 +1,15 @@ +risks: + - detector_id: google_dataflow_value_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_ignored_datatypes_only.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::StructuredMessage::Parameter.new + content: | + Google::Cloud::Dataflow::$<_>::StructuredMessage::Parameter.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_no_datatypes.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_no_datatypes.rb new file mode 100644 index 000000000..d0dcdccdf --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_ok_no_datatypes.rb @@ -0,0 +1,47 @@ +risks: + - detector_id: google_dataflow_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb + line_number: 2 + parent: + line_number: 2 + content: Google::Cloud::Dataflow.snapshots + content: | + Google::Cloud::Dataflow.$ + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new + content: | + Google::Cloud::Dataflow::$<_>::$<_>::Client.new + - detector_id: google_dataflow_description_classes + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb + line_number: 6 + parent: + line_number: 6 + content: snapshot_client.get_snapshot + content: | + $.get_snapshot + - detector_id: google_dataflow_snapshots_client_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb + line_number: 2 + parent: + line_number: 2 + content: Google::Cloud::Dataflow.snapshots + content: | + Google::Cloud::Dataflow.snapshots + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb + line_number: 3 + parent: + line_number: 3 + content: Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new + content: | + Google::Cloud::Dataflow::$<_>::Snapshots::Client.new +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_temp.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_temp.rb new file mode 100644 index 000000000..93670ce69 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowDataflow-dataflow_ruby_third_parties_google_dataflow_temp.rb @@ -0,0 +1,117 @@ +data_types: + - name: IP address + detectors: + - name: ruby + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 2 + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 5 + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 8 + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 11 + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 12 + field_name: ip_address + object_name: customer + subject_name: User +risks: + - detector_id: ruby_third_parties_google_dataflow + data_types: + - name: IP address + stored: false + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 2 + parent: + line_number: 2 + content: 'param.value = "ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 5 + parent: + line_number: 5 + content: 'custom_metadata.value = "ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 8 + parent: + line_number: 8 + content: 'param2.value = "ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 11 + parent: + line_number: 11 + content: 'template_metadata.description ="ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 12 + parent: + line_number: 12 + content: 'template_metadata.name ="ip: #{customer.ip_address}"' + field_name: ip_address + object_name: customer + subject_name: User + - detector_id: google_dataflow_custom_metadata_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 4 + parent: + line_number: 4 + content: Google::Cloud::Dataflow::V1beta3::ParameterMetadata::CustomMetadataEntry.new() + content: | + Google::Cloud::Dataflow::$<_>::ParameterMetadata::CustomMetadataEntry.new() + - detector_id: google_dataflow_parameters_entry_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 1 + parent: + line_number: 1 + content: Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest::ParametersEntry.new() + content: | + Google::Cloud::Dataflow::$<_>::CreateJobFromTemplateRequest::ParametersEntry.new() + - detector_id: google_dataflow_structured_message_parameter_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 7 + parent: + line_number: 7 + content: Google::Cloud::Dataflow::V1beta3::StructuredMessage::Parameter.new() + content: | + Google::Cloud::Dataflow::$<_>::StructuredMessage::Parameter.new() + - detector_id: google_dataflow_template_metadata_init + locations: + - filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/temp.rb + line_number: 10 + parent: + line_number: 10 + content: Google::Cloud::Dataflow::V1beta3::TemplateMetadata.new() + content: | + Google::Cloud::Dataflow::$<_>::TemplateMetadata.new() +components: [] + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_config.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_config.rb new file mode 100644 index 000000000..c55663da0 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_config.rb @@ -0,0 +1,25 @@ +critical: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 8 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + category_groups: + - PII + parent_line_number: 8 + parent_content: 'config.metadata = { current_user_id: current_user.email }' + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 14 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb + category_groups: + - PII + parent_line_number: 14 + parent_content: 'client_config.metadata = { current_user_id: current_user.email }' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_job_message.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_job_message.rb new file mode 100644 index 000000000..9e628b193 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_job_message.rb @@ -0,0 +1,15 @@ +high: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 2 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb + category_groups: + - Personal Data + parent_line_number: 2 + parent_content: 'msg.message_text = "Current user: #{user.ip_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_metadata.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_metadata.rb new file mode 100644 index 000000000..aeaf9d926 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_metadata.rb @@ -0,0 +1,35 @@ +high: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 2 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + category_groups: + - Personal Data + parent_line_number: 2 + parent_content: 'custom_metadata.value = "ip: #{customer.ip_address}"' + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 5 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + category_groups: + - Personal Data + parent_line_number: 5 + parent_content: 'template_metadata.description ="ip: #{customer.ip_address}"' + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 6 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb + category_groups: + - Personal Data + parent_line_number: 6 + parent_content: 'template_metadata.name ="ip: #{customer.ip_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb new file mode 100644 index 000000000..a33789b0a --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_params_entry.rb @@ -0,0 +1,15 @@ +high: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 2 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb + category_groups: + - Personal Data + parent_line_number: 2 + parent_content: 'param.value = "ip: #{customer.ip_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb new file mode 100644 index 000000000..078b44a99 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_job_request.rb @@ -0,0 +1,15 @@ +high: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 2 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb + category_groups: + - Personal Data + parent_line_number: 2 + parent_content: 'req.description = "Current user: #{user.ip_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb new file mode 100644 index 000000000..801a464f7 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_snapshot_setter.rb @@ -0,0 +1,15 @@ +critical: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 9 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb + category_groups: + - PII + parent_line_number: 9 + parent_content: 'snapshot.description = "Current user: #{user.email_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb new file mode 100644 index 000000000..453d25672 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message.rb @@ -0,0 +1,15 @@ +high: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 4 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb + category_groups: + - Personal Data + parent_line_number: 4 + parent_content: 'str_msg.message_text = "Current user: #{user.ip_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb new file mode 100644 index 000000000..2c925776b --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_structured_message_param.rb @@ -0,0 +1,15 @@ +high: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 2 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb + category_groups: + - Personal Data + parent_line_number: 2 + parent_content: 'param2.value = "ip: #{customer.ip_address}"' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb new file mode 100644 index 000000000..e0f13d7d3 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_datatype_in_template_job_creation.rb @@ -0,0 +1,15 @@ +critical: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 5 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb + category_groups: + - PII + parent_line_number: 5 + parent_content: 'templates_client.create_job_from_template(project_id: "123", job_name: "my-job", parameters: { current_user: user.email })' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_fail_with_different_version.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_fail_with_different_version.rb new file mode 100644 index 000000000..d504bef96 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_fail_with_different_version.rb @@ -0,0 +1,15 @@ +critical: + - rule_dsrid: DSR-1 + rule_display_id: ruby_third_parties_google_dataflow + rule_description: Do not send sensitive data to Google Dataflow. + rule_documentation_url: https://curio.sh/reference/rules/ruby_third_parties_google_dataflow + line_number: 5 + filename: pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb + category_groups: + - PII + parent_line_number: 5 + parent_content: 'templates_client.create_job_from_template(project_id: "123", job_name: "my-job", parameters: { current_user: user.email })' + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb new file mode 100644 index 000000000..76ed44fb2 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_ignored_datatypes_only.rb @@ -0,0 +1,5 @@ +{} + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_no_datatypes.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_no_datatypes.rb new file mode 100644 index 000000000..76ed44fb2 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/.snapshots/TestRubyThirdPartiesGoogleDataflowSummary-summary_ruby_third_parties_google_dataflow_ok_no_datatypes.rb @@ -0,0 +1,5 @@ +{} + + +-- + diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb new file mode 100644 index 000000000..7525dc69e --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_config.rb @@ -0,0 +1,14 @@ +# Google::Cloud::Dataflow::V1beta3::Messages::Client and others +client = Google::Cloud::Dataflow.messages +client = Google::Cloud::Dataflow::V1beta3::Messages::Client.new + +# client config +client_config = client.configure +client.configure do |config| + config.metadata = { current_user_id: current_user.email } +end + +# config metadata +# https://cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-Messages-Client-Configuration#Google__Cloud__Dataflow__V1beta3__Messages__Client__Configuration_metadata_instance_ +client_config.metadata("current_user_id": current_user.email) +client_config.metadata = { current_user_id: current_user.email } diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb new file mode 100644 index 000000000..f5607bc50 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_job_message.rb @@ -0,0 +1,2 @@ +msg = Google::Cloud::Dataflow::V1beta3::JobMessage.new +msg.message_text = "Current user: #{user.ip_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb new file mode 100644 index 000000000..44f3aaeaf --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_metadata.rb @@ -0,0 +1,6 @@ +custom_metadata = Google::Cloud::Dataflow::V1beta3::ParameterMetadata::CustomMetadataEntry.new +custom_metadata.value = "ip: #{customer.ip_address}" + +template_metadata = Google::Cloud::Dataflow::V1beta3::TemplateMetadata.new +template_metadata.description ="ip: #{customer.ip_address}" +template_metadata.name ="ip: #{customer.ip_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb new file mode 100644 index 000000000..16da67700 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_params_entry.rb @@ -0,0 +1,2 @@ +param = Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest::ParametersEntry.new +param.value = "ip: #{customer.ip_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb new file mode 100644 index 000000000..ba17751f7 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_job_request.rb @@ -0,0 +1,2 @@ +req = Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest.new +req.description = "Current user: #{user.ip_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb new file mode 100644 index 000000000..9468d541b --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_snapshot_setter.rb @@ -0,0 +1,9 @@ +# Google::Cloud::Dataflow::V1beta3::Snapshots::Client +snapshot_client = Google::Cloud::Dataflow.snapshots +snapshot_client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new + +# https://cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-Snapshots-Client#Google__Cloud__Dataflow__V1beta3__Snapshots__Client_get_snapshot_instance_ +snapshot = snapshot_client.get_snapshot + +snapshot.id = user.id +snapshot.description = "Current user: #{user.email_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb new file mode 100644 index 000000000..43ac00054 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message.rb @@ -0,0 +1,4 @@ +# pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/datatype_in_structured_message.rb + +str_msg = Google::Cloud::Dataflow::V1beta3::StructuredMessage.new +str_msg.message_text = "Current user: #{user.ip_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb new file mode 100644 index 000000000..a8a5859c9 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_structured_message_param.rb @@ -0,0 +1,2 @@ +param2 = Google::Cloud::Dataflow::V1beta3::StructuredMessage::Parameter.new +param2.value = "ip: #{customer.ip_address}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb new file mode 100644 index 000000000..132e8097a --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/datatype_in_template_job_creation.rb @@ -0,0 +1,5 @@ +# https://cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client + +templates_client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new +templates_client = Google::Cloud::Dataflow.templates_service +templates_client.create_job_from_template(project_id: "123", job_name: "my-job", parameters: { current_user: user.email }) \ No newline at end of file diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb new file mode 100644 index 000000000..a9e5c7627 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/fail_with_different_version.rb @@ -0,0 +1,5 @@ +# https://cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client + +templates_client = Google::Cloud::Dataflow::V2::TemplatesService::Client.new +templates_client = Google::Cloud::Dataflow.templates_service +templates_client.create_job_from_template(project_id: "123", job_name: "my-job", parameters: { current_user: user.email }) \ No newline at end of file diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_ignored_datatypes_only.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_ignored_datatypes_only.rb new file mode 100644 index 000000000..6fd606931 --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_ignored_datatypes_only.rb @@ -0,0 +1,2 @@ +param2 = Google::Cloud::Dataflow::V1beta3::StructuredMessage::Parameter.new +param2.value = "ip: #{customer.id}" diff --git a/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb new file mode 100644 index 000000000..d5cf263cd --- /dev/null +++ b/pkg/commands/process/settings/rules/ruby/third_parties/google_dataflow/testdata/ok_no_datatypes.rb @@ -0,0 +1,9 @@ +# Google::Cloud::Dataflow::V1beta3::Snapshots::Client +snapshot_client = Google::Cloud::Dataflow.snapshots +snapshot_client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new + +# https://cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-Snapshots-Client#Google__Cloud__Dataflow__V1beta3__Snapshots__Client_get_snapshot_instance_ +snapshot = snapshot_client.get_snapshot + +snapshot.id = user.id +snapshot.description = "Snapshot taken #{DateTime.now}"