Skip to content

Commit

Permalink
Update eic_curl_authorized_keys for release 1.1.13
Browse files Browse the repository at this point in the history
* Verify that domain returned from IMDS is an AWS domain
  • Loading branch information
ohitspaul committed Nov 18, 2020
1 parent 47de505 commit c15b99f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1-12
1.1-13
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ec2-instance-connect (1.1.13) xenial; urgency=high

* Verify that domain returned from IMDS is an AWS domain

-- Jacob Meisler <[email protected]> Thu, 22 Oct 2020 00:00:00 -0400

ec2-instance-connect (1.1.12) xenial; urgency=high

* Adding support for Instance Metadata Service Version 2
Expand Down
2 changes: 2 additions & 0 deletions rpmsrc/SPECS/generic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ fi


%changelog
* Thu Oct 22 2020 Jacob Meisler <[email protected]> 1.1-13
- Verify that domain returned from IMDS is an AWS domain
* Tue Nov 19 2019 Daniel Anderson <[email protected]> 1.1-12
- Adding support for Instance Metadata Service Version 2
- Modifying cURL invocation to avoid need for eval
Expand Down
11 changes: 11 additions & 0 deletions src/bin/eic_curl_authorized_keys
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ if [ "${domain_exit}" -ne 0 ]
then
exit "${domain_exit}"
fi
is_domain_valid=1
for valid_domain in amazonaws.com amazonaws.com.cn c2s.ic.gov sc2s.sgov.gov; do
if [ "$domain" = "$valid_domain" ]; then
is_domain_valid=0
break
fi
done
if [ $is_domain_valid -eq 1 ]; then
/usr/bin/logger -i -p authpriv.info "EC2 Instance Connect found an invalid domain and will do nothing."
exit 255
fi

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

Expand Down

0 comments on commit c15b99f

Please sign in to comment.