File tree 3 files changed +31
-0
lines changed
3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ gem "lograge"
53
53
gem "sentry-rails"
54
54
gem "sentry-ruby"
55
55
56
+ # For getting information about the AWS EC2 host credentials
57
+ gem "aws-sdk-core"
58
+
56
59
group :development , :test do
57
60
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
58
61
gem "debug" , platforms : %i[ mri mingw x64_mingw ]
Original file line number Diff line number Diff line change 77
77
acts_as_list (1.1.0 )
78
78
activerecord (>= 4.2 )
79
79
ast (2.4.2 )
80
+ aws-eventstream (1.3.0 )
81
+ aws-partitions (1.867.0 )
82
+ aws-sdk-core (3.190.0 )
83
+ aws-eventstream (~> 1 , >= 1.3.0 )
84
+ aws-partitions (~> 1 , >= 1.651.0 )
85
+ aws-sigv4 (~> 1.8 )
86
+ jmespath (~> 1 , >= 1.6.1 )
87
+ aws-sigv4 (1.8.0 )
88
+ aws-eventstream (~> 1 , >= 1.0.2 )
80
89
bootsnap (1.17.0 )
81
90
msgpack (~> 1.2 )
82
91
brakeman (6.1.0 )
144
153
irb (1.10.1 )
145
154
rdoc
146
155
reline (>= 0.3.8 )
156
+ jmespath (1.6.2 )
147
157
json (2.6.3 )
148
158
language_server-protocol (3.17.0.3 )
149
159
lograge (0.14.0 )
@@ -321,6 +331,7 @@ PLATFORMS
321
331
322
332
DEPENDENCIES
323
333
acts_as_list
334
+ aws-sdk-core
324
335
bootsnap
325
336
brakeman
326
337
bundler-audit
Original file line number Diff line number Diff line change
1
+ require "aws-sdk-core"
2
+
1
3
namespace :access_tokens do
4
+ task :get_caller_identity => :environment do
5
+ sts = Aws ::STS ::Client . new
6
+ caller_identity = sts . get_caller_identity
7
+ puts caller_identity
8
+
9
+ caller_arn = caller_identity [ :arn ]
10
+ caller_arn = Aws ::ARNParser . parse ( caller_arn )
11
+ puts caller_arn . inspect
12
+
13
+ =begin
14
+ /arn:aws:sts::#{caller_identity[:account]}:(user/(?<user_name>)|assumed-role/(?<role_name>)/(?<role_session_name>)|federated-user/(?<federated_user_name>))
15
+ puts caller_identity
16
+ =end
17
+ end
18
+
2
19
desc "Add a pre-generated token, using the SHA256 hex digest"
3
20
task :insert , %i[ token_digest ] => :environment do |_ , args |
4
21
usage_message = "usage: rails access_tokens:insert[<token_digest>]" . freeze
You can’t perform that action at this time.
0 commit comments