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 +4 -4
- data/lib/chef/knife/ec2_base.rb +13 -1
- data/lib/chef/knife/ec2_server_create.rb +5 -11
- data/lib/knife-ec2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6444d46c88ab7fe3b303af2b9cb993633791d89d98a53690658ca5932825d29
|
4
|
+
data.tar.gz: 00321d501e212ec768eb08357645d740f33abea1cd0b63c31e6fc2e9f7ab80dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703b96ddffb5e8a282d37b6e730dbea8872d2fa9792d097e1315f6cfffea42ef14c6b87cda9b06089263f5a184f22f509c3e68783e30906cdc2fe74ac7c28279
|
7
|
+
data.tar.gz: 278c42337c36b0dd30e3d5a7bfcd7a9976573545a6673bdea928197f1b27513f77a8e06d893492217c5f36ea05e8fd8d913f763a8b2d0ad38d40b404491fda63
|
data/lib/chef/knife/ec2_base.rb
CHANGED
@@ -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?
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
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"
|
data/lib/knife-ec2/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|