Skip to content

Commit

Permalink
Licensing headers
Browse files Browse the repository at this point in the history
  • Loading branch information
LordAlfredo committed Sep 27, 2018
1 parent 8705a0e commit 506303a
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 1 deletion.
13 changes: 13 additions & 0 deletions bin/configure_sshd.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions bin/make_tarball.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 14 additions & 1 deletion bin/reset_sshd.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions bin/test/generate_ocsp.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions bin/test/run_authorized_keys_tests.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
13 changes: 13 additions & 0 deletions bin/test/setup_certificates.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions bin/test/sign_data.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions bin/test/test_authorized_keys.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/opt/aws/bin/curl_authorized_keys
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/opt/aws/bin/parse_authorized_keys
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 506303a

Please sign in to comment.