knife-ec2 1.0.18 → 1.0.20

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: 7f0efb7449ec88881f143653d3bb282ca3d0e4e682773487cd17c4943e6631b9
4
- data.tar.gz: c89dfbbbb331f2258af0797273a58e77f13a321d62b17ec58346f07139fb27a9
3
+ metadata.gz: b6444d46c88ab7fe3b303af2b9cb993633791d89d98a53690658ca5932825d29
4
+ data.tar.gz: 00321d501e212ec768eb08357645d740f33abea1cd0b63c31e6fc2e9f7ab80dd
5
5
  SHA512:
6
- metadata.gz: 19f0cfcf4ced0fadfc2763cab088c15faa743f932f334fd8ffdd869c011284b32e281576cfaa3195e1a6b4fd97f7cf28bd29f1142b5983e8fba33ad7ed707830
7
- data.tar.gz: ba73cea8ba3d9baed0553ed7dca881e3b4756b8324015a99672937e0cbb7ba4dc0c00412200ffb21db61a15ec1090dbc5b9d1d9d49a197289c9dfcaef58585ba
6
+ metadata.gz: 703b96ddffb5e8a282d37b6e730dbea8872d2fa9792d097e1315f6cfffea42ef14c6b87cda9b06089263f5a184f22f509c3e68783e30906cdc2fe74ac7c28279
7
+ data.tar.gz: 278c42337c36b0dd30e3d5a7bfcd7a9976573545a6673bdea928197f1b27513f77a8e06d893492217c5f36ea05e8fd8d913f763a8b2d0ad38d40b404491fda63
@@ -88,7 +88,8 @@ class Chef
88
88
  Chef::Log.debug "Using iam profile for authentication as use_iam_profile set"
89
89
  Aws::InstanceProfileCredentials.new
90
90
  else
91
- Chef::Log.debug "Setting up AWS connection using aws_access_key_id #{locate_config_value(:aws_access_key_id)} aws_secret_access_key: #{locate_config_value(:aws_secret_access_key)} aws_session_token: #{locate_config_value(:aws_session_token)}"
91
+ Chef::Log.debug "Setting up AWS connection using aws_access_key_id: #{mask(locate_config_value(:aws_access_key_id))} aws_secret_access_key: #{mask(locate_config_value(:aws_secret_access_key))} aws_session_token: #{mask(locate_config_value(:aws_session_token))}"
92
+
92
93
  Aws::Credentials.new(locate_config_value(:aws_access_key_id), locate_config_value(:aws_secret_access_key), locate_config_value(:aws_session_token))
93
94
  end
94
95
  conn
@@ -343,5 +344,16 @@ class Chef
343
344
  raise ArgumentError, "The provided --aws-profile '#{profile}' is invalid. Does the credential file at '#{aws_cred_file_location}' contain this profile?"
344
345
  end
345
346
  end
347
+
348
+ # Mask the given string with char `X`
349
+ # Discard the chars based on from value
350
+ def mask(key, from = 4)
351
+ str = key.dup
352
+ if str && str.length > from
353
+ str[from...str.length] = "X" * (str[from...str.length].length)
354
+ end
355
+
356
+ str
357
+ end
346
358
  end
347
359
  end
@@ -717,15 +717,11 @@ class Chef
717
717
  exit 1
718
718
  end
719
719
 
720
- if winrm? && config_value(:connection_password).to_s.length > 14
721
- ui.warn("The password provided is longer than 14 characters. Computers with Windows prior to Windows 2000 will not be able to use this account. Do you want to continue this operation? (Y/N):")
722
- password_promt = STDIN.gets.chomp.upcase
723
- if password_promt == "N"
724
- raise "Exiting as operation with password greater than 14 characters not accepted"
725
- elsif password_promt == "Y"
726
- @allow_long_password = "/yes"
727
- else
728
- raise "The input provided is incorrect."
720
+ if winrm?
721
+ reg = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,40}$/
722
+ unless config_value(:connection_password) =~ reg
723
+ ui.error("Complexity requirements are not met. Password length should be 8-40 characters and include: 1 uppercase, 1 lowercase, 1 digit, and 1 special character")
724
+ exit 1
729
725
  end
730
726
  end
731
727
 
@@ -891,7 +887,6 @@ class Chef
891
887
  attributes[:placement][:tenancy] = "dedicated" if vpc_mode? && config_value(:dedicated_instance)
892
888
  attributes[:iam_instance_profile] = {}
893
889
  attributes[:iam_instance_profile][:name] = config_value(:iam_instance_profile)
894
-
895
890
  if config_value(:winrm_ssl)
896
891
  if config_value(:aws_user_data)
897
892
  begin
@@ -919,7 +914,6 @@ class Chef
919
914
  end
920
915
  end
921
916
  end
922
-
923
917
  attributes[:ebs_optimized] = !!config_value(:ebs_optimized)
924
918
 
925
919
  if ami.root_device_type == "ebs"
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Ec2
3
- VERSION = "1.0.18".freeze
3
+ VERSION = "1.0.20".freeze
4
4
  MAJOR, MINOR, TINY = VERSION.split(".")
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.18
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef