Skip to content

Commit c15b99f

Browse files
committed
Update eic_curl_authorized_keys for release 1.1.13
* Verify that domain returned from IMDS is an AWS domain
1 parent 47de505 commit c15b99f

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1-12
1+
1.1-13

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ec2-instance-connect (1.1.13) xenial; urgency=high
2+
3+
* Verify that domain returned from IMDS is an AWS domain
4+
5+
-- Jacob Meisler <meislerj@amazon.com> Thu, 22 Oct 2020 00:00:00 -0400
6+
17
ec2-instance-connect (1.1.12) xenial; urgency=high
28

39
* Adding support for Instance Metadata Service Version 2

rpmsrc/SPECS/generic.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ fi
155155

156156

157157
%changelog
158+
* Thu Oct 22 2020 Jacob Meisler <meislerj@amazon.com> 1.1-13
159+
- Verify that domain returned from IMDS is an AWS domain
158160
* Tue Nov 19 2019 Daniel Anderson <dnde@amazon.com> 1.1-12
159161
- Adding support for Instance Metadata Service Version 2
160162
- Modifying cURL invocation to avoid need for eval

src/bin/eic_curl_authorized_keys

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ if [ "${domain_exit}" -ne 0 ]
111111
then
112112
exit "${domain_exit}"
113113
fi
114+
is_domain_valid=1
115+
for valid_domain in amazonaws.com amazonaws.com.cn c2s.ic.gov sc2s.sgov.gov; do
116+
if [ "$domain" = "$valid_domain" ]; then
117+
is_domain_valid=0
118+
break
119+
fi
120+
done
121+
if [ $is_domain_valid -eq 1 ]; then
122+
/usr/bin/logger -i -p authpriv.info "EC2 Instance Connect found an invalid domain and will do nothing."
123+
exit 255
124+
fi
114125

115126
expected_signer=$(/usr/bin/printf 'managed-ssh-signer.%s.%s' "${region}" "${domain}")
116127

0 commit comments

Comments
 (0)