uc3-dmp-id 0.0.10 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35192e984c146cf3891bc898ed03d3f100338a150a379e61e90da8c978b16050
4
- data.tar.gz: 1c75e1a057e8b45fb26b56e6b4569f47dc496bf3d0bd66c00ddebc8d3be85ccd
3
+ metadata.gz: c0a0a7c8a7c2ec3b7bfdc0051c323b85ba6f7bb14aa0bc1f77e499b7682b3814
4
+ data.tar.gz: 9bb5fa376caa1d07bd243cebad4b5757771eb996a4723c200366c034fdf56b2c
5
5
  SHA512:
6
- metadata.gz: 564ac8f207a3a156c73d3258f4de65d62e44841569e9f4a3808c88031ff0c5c75429d7922c2ed60a1146731e9c282170c111c3fd8a41524c9f9cb9e4bb608b9a
7
- data.tar.gz: 4bb2d583e5863ecc0b299a2f25c3042fc3f2615326a0545e2160e5f668db35dd3e2fe66be5c4ec1e0c630ef02a86dd1f986ea81f401e9c1f60fd6a455bb60980
6
+ metadata.gz: 8b8ff1171c5127af8fedbfe85bf2c74b4a61f25dc4bab73e42fa1903bbe36c9a20adb0f9db2b1906c6542f7172496ea9173b05c047b20392577d5cc9341002db
7
+ data.tar.gz: '079687ec9e07dddde7afcbcd9d1b6dc0b3606276f735e4040ca0183e378f1bc0c72017747d48dde140c32b922e7ce6825afc5b3961d6b93503ce4c2052226495'
@@ -28,7 +28,7 @@ module Uc3DmpId
28
28
 
29
29
  args = {
30
30
  key_conditions: {
31
- PK: { attribute_value_list: [Helper.append_pk_prefix(dmp: p_key)], comparison_operator: 'EQ' }
31
+ PK: { attribute_value_list: [Helper.append_pk_prefix(p_key: p_key)], comparison_operator: 'EQ' }
32
32
  },
33
33
  projection_expression: 'modified',
34
34
  scan_index_forward: false
@@ -65,13 +65,16 @@ module Uc3DmpId
65
65
  client = client.nil? ? Uc3DmpDynamo::Client.new(debug: debug) : client
66
66
  resp = client.get_item(
67
67
  key: {
68
- PK: Helper.append_pk_prefix(dmp: p_key),
68
+ PK: Helper.append_pk_prefix(p_key: p_key),
69
69
  SK: s_key.nil? || s_key.strip.empty? ? Helper::DMP_LATEST_VERSION : s_key
70
70
  }
71
71
  )
72
- return nil if resp.nil? || resp.fetch('dmp', {})['PK'].nil?
72
+ return resp unless resp.is_a?(Hash)
73
73
 
74
- _append_versions(p_key: resp['dmp']['PK'], dmp: resp, client: client, debug: debug)
74
+ dmp = resp['dmp'].nil? ? JSON.parse({ dmp: resp }.to_json) : resp
75
+ return nil if resp['dmp']['PK'].nil?
76
+
77
+ _append_versions(p_key: resp['dmp']['PK'], dmp: dmp, client: client, debug: debug)
75
78
  end
76
79
 
77
80
  # Attempt to find the DMP item by the provenance system's identifier
@@ -92,10 +95,13 @@ module Uc3DmpId
92
95
  }
93
96
  client = client.nil? ? Uc3DmpDynamo::Client.new(debug: debug) : client
94
97
  resp = client.query(**args)
95
- return resp if resp.nil? || resp['dmp'].nil?
98
+ return resp unless resp.is_a?(Hash)
99
+
100
+ dmp = resp['dmp'].nil? ? JSON.parse({ dmp: resp }.to_json) : resp
101
+ return nil if resp['dmp']['PK'].nil?
96
102
 
97
103
  # If we got a hit, fetch the DMP and return it.
98
- by_pk(p_key: resp['dmp']['PK'], s_key: resp['dmp']['SK'])
104
+ by_pk(p_key: dmp['dmp']['PK'], s_key: dmp['dmp']['SK'])
99
105
  end
100
106
  # rubocop:enable Metrics/AbcSize
101
107
 
@@ -115,7 +121,7 @@ module Uc3DmpId
115
121
  timestamp = version['dmp']['modified']
116
122
  {
117
123
  timestamp: timestamp,
118
- url: "#{Helper.api_base_url}dmps/#{Helper.remove_pk_prefix(dmp: p_key)}?version=#{timestamp}"
124
+ url: "#{Helper.api_base_url}dmps/#{Helper.remove_pk_prefix(p_key: p_key)}?version=#{timestamp}"
119
125
  }
120
126
  end
121
127
  dmp['dmp']['dmphub_versions'] = JSON.parse(versions.to_json)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.10'
4
+ VERSION = '0.0.12'
5
5
  end
@@ -0,0 +1,73 @@
1
+
2
+ WAF analysis
3
+ ===========================================================
4
+
5
+ AWS#AWSManagedRulesCommonRuleSet#NoUserAgent_HEADER
6
+ Action: REMOVE THIS RULE? I feel like this one will cause more harm then good
7
+ Blocking: /
8
+ /plans/98982
9
+ /nuclei.svg?fc9dz=x (about 100 times!)
10
+ /v1/metadata/private-networks
11
+ /latest/meta-data/
12
+ /computeMetadata/v1/project/
13
+ /dynamic/instance-identity/document
14
+ /openstack/latest
15
+ /metadata/v1.json
16
+ /opc/v1/instance
17
+
18
+ AWS#AWSManagedRulesCommonRuleSet#SizeRestrictions_BODY
19
+ Action: Add exclusion for this specific path!
20
+ Blocking: /Shibboleth.sso/SAML2/POST
21
+
22
+ AWS#AWSManagedRulesAdminProtectionRuleSet#AdminProtection_URIPATH
23
+ Action: Add exceptions for [/org/admin/, /org_admin/, /super_admin/, /paginable/plans/org_admin]. The others are
24
+ all illegitimate so we want to block them.
25
+ Blocking: /org/admin/users/98307/admin_update_permissions
26
+ /org/admin/users/admin_index
27
+ /paginable/plans/org_admin/[page]?[query_params]
28
+ /org_admin/plans
29
+ /org/admin/543/admin_edit
30
+ /org/admin/users/admin_index
31
+ /org/admin/guidance/2163/admin_update
32
+ /org_admin/templates/1967/phases/2144/sections/11313
33
+ /org/admin/17/admin_edit
34
+ /super_admin/users/77446/merge
35
+
36
+ /admin/
37
+ /admin/phpMyAdmin/server_import.php
38
+ /phpMyAdmin/server_import.php
39
+ /admin/pma/server_import.php
40
+ /miscadmin
41
+ /admin/server_import.php
42
+ /backend/admin/users?username=anonymous
43
+ /phpmyadmin/server_import.php
44
+ /admin/install.php
45
+ /admin/install/install.php
46
+ /wp-admin/install.php
47
+ /solr/admin/
48
+ /Admin/frmWelcome.aspx
49
+ /boaform/admin/formLogin?username=user&psd=user
50
+
51
+
52
+ AWS#AWSManagedRulesCommonRuleSet#UserAgent_BadBots_HEADER
53
+ Actions: Block them
54
+ Blocking: /public_templates?[query_params]
55
+ /robots.txt
56
+ /aab8
57
+ /aaa9
58
+ /dmptool-ui/SourceSans3VF-Italic.ttf.fd20af5b.woff2
59
+ /dmptool-ui/SourceSans3VF-Roman.ttf.99aa17fb.woff2
60
+ /assets/application-4551ebb71fffa2b6d576438af0e66620a4e84cb8431cdd25889e191eed0fae66.js
61
+
62
+ AWS#AWSManagedRulesAmazonIpReputationList#AWSManagedReconnaissanceList
63
+ Actions: Block them
64
+ Blocking: /
65
+ /.env
66
+ /header.php
67
+
68
+ AWS#AWSManagedRulesCommonRuleSet#CrossSiteScripting_BODY
69
+ Actions: Add exception for /answers/create_or_update (or better yet address it)
70
+ Blocking: /answers/create_or_update?question_id=17592
71
+ /content/crx/de/setPreferences.jsp;%0A.html?keymap=<svg/onload=confirm(document.domain)>//a&language=en
72
+ /7/0/33/1d/www.citysearch.com/search?what=x&where=place%22%3E%3Csvg+onload=confirm(document.domain)%3E
73
+ /etc/designs/xh1x.childrenlist.json//%3Csvg%20onload=alert%28document.domain%29%3E.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-09 00:00:00.000000000 Z
11
+ date: 2023-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
- - !ruby/object:Gem::Dependency
42
- name: logger
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.4'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.4'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: uc3-dmp-dynamo
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -141,6 +127,7 @@ files:
141
127
  - lib/uc3-dmp-id/validator.rb
142
128
  - lib/uc3-dmp-id/version.rb
143
129
  - lib/uc3-dmp-id/versioner.rb
130
+ - lib/uc3-dmp-id/waf_analysis_2023-06-05.txt
144
131
  homepage: https://github.com/CDLUC3/dmp-hub-cfn/blob/main/src/sam/gems/uc3-dmp-id
145
132
  licenses:
146
133
  - MIT