diff --git a/bin/configure_sshd.sh b/bin/configure_sshd.sh index ab33f72..a494299 100755 --- a/bin/configure_sshd.sh +++ b/bin/configure_sshd.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Create/configure system user /usr/bin/id -u "ec2-instance-connect" > /dev/null 2>&1 if [ $? -ne 0 ] ; then diff --git a/bin/make_tarball.sh b/bin/make_tarball.sh index 6a9f0ce..c600251 100755 --- a/bin/make_tarball.sh +++ b/bin/make_tarball.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + TOPDIR=$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )") mkdir $TOPDIR/ec2-instance-connect-1.0 cp -r $TOPDIR/src/opt $TOPDIR//ec2-instance-connect-1.0 diff --git a/bin/reset_sshd.sh b/bin/reset_sshd.sh index e5dec10..eb2c90b 100644 --- a/bin/reset_sshd.sh +++ b/bin/reset_sshd.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + modified=false # Remove EC2 Instance Connect sshd config if present @@ -18,7 +31,7 @@ fi if [ $modified = true ] ; then # Restart sshd - # HACK: There is no good way to tell what init system is running. + # HACK: There is absolutely no good way to tell what init system is running. # "Best" solution is to just try them all sudo systemctl restart ssh || true sudo service sshd restart || true diff --git a/bin/test/generate_ocsp.sh b/bin/test/generate_ocsp.sh index 36f7259..1653979 100755 --- a/bin/test/generate_ocsp.sh +++ b/bin/test/generate_ocsp.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Unit test helper to generate an OCSP response in the desired location if [ -z "${1}" ] ; then diff --git a/bin/test/run_authorized_keys_tests.sh b/bin/test/run_authorized_keys_tests.sh index 6a12e38..2d785a9 100755 --- a/bin/test/run_authorized_keys_tests.sh +++ b/bin/test/run_authorized_keys_tests.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Script to run our entire unit test suite. # Iterates over the contents of test/input/direct and test/input/unsigned and validates we get the matching contents of test/expected-output diff --git a/bin/test/setup_certificates.sh b/bin/test/setup_certificates.sh index e7babf2..2fc4a0c 100755 --- a/bin/test/setup_certificates.sh +++ b/bin/test/setup_certificates.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Quick script to generate a CA, intermediate, and end certificate if [ -z "${1}" ] ; then diff --git a/bin/test/sign_data.sh b/bin/test/sign_data.sh index f19d142..d68b0e6 100755 --- a/bin/test/sign_data.sh +++ b/bin/test/sign_data.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Unit test helper. Takes a directory containing key blobs in files, signs the data in each, and consolidates into a final output. if [ -z "${1}" ] ; then diff --git a/bin/test/test_authorized_keys.sh b/bin/test/test_authorized_keys.sh index 28da0cc..eb38174 100755 --- a/bin/test/test_authorized_keys.sh +++ b/bin/test/test_authorized_keys.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Authorized keys command unit test script. Takes the script to test, certificate, CA, input, and expected output. if [ -z "${1}" ] ; then diff --git a/src/opt/aws/bin/curl_authorized_keys b/src/opt/aws/bin/curl_authorized_keys index 7493405..7cebc56 100755 --- a/src/opt/aws/bin/curl_authorized_keys +++ b/src/opt/aws/bin/curl_authorized_keys @@ -1,5 +1,18 @@ #!/bin/sh +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # EC2 Instance Connect AuthorizedKeysCommand v 1.0.0 # Reads and echoes EC2 Metadata to get the authorized keys blob for the user $1 diff --git a/src/opt/aws/bin/parse_authorized_keys b/src/opt/aws/bin/parse_authorized_keys index 601c106..a3087ba 100755 --- a/src/opt/aws/bin/parse_authorized_keys +++ b/src/opt/aws/bin/parse_authorized_keys @@ -1,5 +1,18 @@ #!/bin/sh +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # EC2 Instance Connect AuthorizedKeysCommand v 1.0.0 # Reads authorized keys blob $3 and prints verified, unexpired keys