Change user agent string for docker refresh

This commit is contained in:
Mike Reeves
2020-11-13 14:09:29 -05:00
parent 069908ec56
commit 3173c6fd3c
2 changed files with 9 additions and 5 deletions

View File

@@ -89,9 +89,9 @@ container_list() {
operating_system() { operating_system() {
if [ -f /etc/redhat-release ]; then if [ -f /etc/redhat-release ]; then
OS=CentOS OS=centos
else else
OS=Ubuntu OS=ubuntu
fi fi
} }
@@ -114,7 +114,7 @@ update_docker_containers() {
docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$i:$VERSION docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$i:$VERSION
# Get signature # Get signature
curl -A "$OS $CURLTYPE" https://sigs.securityonion.net/$VERSION/$i:$VERSION.sig --output $SIGNPATH/$i:$VERSION.sig curl -A "$CURLTYPE/$OS/$(uname -r)" https://sigs.securityonion.net/$VERSION/$i:$VERSION.sig --output $SIGNPATH/$i:$VERSION.sig
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "Unable to pull signature file for $i:$VERSION" echo "Unable to pull signature file for $i:$VERSION"
exit 1 exit 1

View File

@@ -16,13 +16,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
. /usr/sbin/so-common . /usr/sbin/so-common
. /usr/sbin/so-image-common if [ -f /usr/sbin/so-image-common ]; then
. /usr/sbin/so-image-common
fi
UPDATE_DIR=/tmp/sogh/securityonion UPDATE_DIR=/tmp/sogh/securityonion
INSTALLEDVERSION=$(cat /etc/soversion) INSTALLEDVERSION=$(cat /etc/soversion)
INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk {'print $2'}) INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk {'print $2'})
DEFAULT_SALT_DIR=/opt/so/saltstack/default DEFAULT_SALT_DIR=/opt/so/saltstack/default
BATCHSIZE=5 BATCHSIZE=5
SOUP_LOG=/root/soup.log SOUP_LOG=/root/soup.log
CURLTYPE=soup
exec 3>&1 1>${SOUP_LOG} 2>&1 exec 3>&1 1>${SOUP_LOG} 2>&1
manager_check() { manager_check() {
@@ -119,7 +123,6 @@ clean_dockers() {
} }
clone_to_tmp() { clone_to_tmp() {
# TODO Need to add a air gap option
# Clean old files # Clean old files
rm -rf /tmp/sogh rm -rf /tmp/sogh
# Make a temp location for the files # Make a temp location for the files
@@ -379,6 +382,7 @@ verify_latest_update_script() {
else else
echo "You are not running the latest soup version. Updating soup." echo "You are not running the latest soup version. Updating soup."
cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/ cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/
cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/
salt-call state.apply common queue=True salt-call state.apply common queue=True
echo "" echo ""
echo "soup has been updated. Please run soup again." echo "soup has been updated. Please run soup again."