Skip to content

Commit 26e1825

Browse files
authored
Merge pull request #70 from cisagov/bugfix/correct-quotes
Correct quotes in shell script
2 parents 9acc1c3 + 35f2976 commit 26e1825

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ expects the secrets in a different location.
3232
To run the `cisagov/scanner` image via Docker:
3333

3434
```console
35-
docker run cisagov/scanner:1.3.1
35+
docker run cisagov/scanner:1.3.2
3636
```
3737

3838
### Running with Docker Compose ###
@@ -45,7 +45,7 @@ docker run cisagov/scanner:1.3.1
4545

4646
services:
4747
scanner:
48-
image: cisagov/scanner:1.3.1
48+
image: cisagov/scanner:1.3.2
4949
volumes:
5050
- type: bind
5151
source: <your_log_dir>
@@ -89,7 +89,7 @@ environment variables. See the
8989
9090
services:
9191
scanner:
92-
image: cisagov/scanner:1.3.1
92+
image: cisagov/scanner:1.3.2
9393
volumes:
9494
- type: bind
9595
source: <your_log_dir>
@@ -126,7 +126,7 @@ environment variables. See the
126126
1. Pull the new image:
127127

128128
```console
129-
docker pull cisagov/scanner:1.3.1
129+
docker pull cisagov/scanner:1.3.2
130130
```
131131

132132
1. Recreate and run the container by following the [previous instructions](#running-with-docker).
@@ -136,11 +136,11 @@ environment variables. See the
136136
The images of this container are tagged with [semantic
137137
versions](https://semver.org) of the underlying example project that they
138138
containerize. It is recommended that most users use a version tag (e.g.
139-
`:1.3.1`).
139+
`:1.3.2`).
140140

141141
| Image:tag | Description |
142142
|-----------|-------------|
143-
|`cisagov/scanner:1.3.1`| An exact release version. |
143+
|`cisagov/scanner:1.3.2`| An exact release version. |
144144
|`cisagov/scanner:1.3`| The most recent release matching the major and minor version numbers. |
145145
|`cisagov/scanner:1`| The most recent release matching the major version number. |
146146
|`cisagov/scanner:edge` | The most recent image built from a merge into the `develop` branch of this repository. |
@@ -200,8 +200,8 @@ Build the image locally using this git repository as the [build context](https:/
200200

201201
```console
202202
docker build \
203-
--build-arg VERSION=1.3.1 \
204-
--tag cisagov/scanner:1.3.1 \
203+
--build-arg VERSION=1.3.2 \
204+
--tag cisagov/scanner:1.3.2 \
205205
https://github.com/cisagov/scanner.git#develop
206206
```
207207

@@ -231,9 +231,9 @@ Docker:
231231
docker buildx build \
232232
--file Dockerfile-x \
233233
--platform linux/amd64 \
234-
--build-arg VERSION=1.3.1 \
234+
--build-arg VERSION=1.3.2 \
235235
--output type=docker \
236-
--tag cisagov/scanner:1.3.1 .
236+
--tag cisagov/scanner:1.3.2 .
237237
```
238238

239239
## Contributing ##

src/scan.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#!/bin/bash
22

3-
SHARED_DIR=${CISA_HOME}/shared
3+
SHARED_DIR="${CISA_HOME}"/shared
44

5-
echo "Creating artifacts folder..."
6-
mkdir -p "${SHARED_DIR}/artifacts/"
5+
echo Creating artifacts folder...
6+
mkdir -p "${SHARED_DIR}"/artifacts/
77

8-
echo "Waiting for gatherer"
8+
echo Waiting for gatherer
99
while [ "$(redis-cli -h redis get gathering_complete)" != "true" ]; do
1010
sleep 5
1111
done
12-
echo "Gatherer finished"
12+
echo Gatherer finished
1313

1414
# No longer needed
1515
redis-cli -h orchestrator_redis_1 del gathering_complete
1616

1717
# Run the https-scan scan
18-
echo "Running domain-scan scan"
19-
cd "${SHARED_DIR}/artifacts/" || exit
18+
echo Running domain-scan scan
19+
cd "${SHARED_DIR}"/artifacts/ || exit
2020
# We run the three scans separately because we want to reduce the
2121
# concurrency for trustymail scans. This is to avoid a situation
2222
# where DNS queries are too high a rate (more than 1024
@@ -30,7 +30,7 @@ cd "${SHARED_DIR}/artifacts/" || exit
3030
# See this link for an explanation as to why the VPC DNS limitation
3131
# was not initially a concern:
3232
# https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/
33-
"${CISA_HOME}/domain-scan/scan" "${SHARED_DIR}/artifacts/scanme.csv" \
33+
"${CISA_HOME}"/domain-scan/scan "${SHARED_DIR}"/artifacts/scanme.csv \
3434
--scan=pshtt \
3535
--lambda \
3636
--lambda-retries=1 \
@@ -40,8 +40,8 @@ cd "${SHARED_DIR}/artifacts/" || exit
4040
--workers=40
4141
# This file would get deleted when we rerun domain-scan/scan if it
4242
# stayed where it is
43-
mv "${SHARED_DIR}/artifacts/results/pshtt.csv" "${SHARED_DIR}/artifacts"
44-
"${CISA_HOME}/domain-scan/scan" "${SHARED_DIR}/artifacts/scanme.csv" \
43+
mv "${SHARED_DIR}"/artifacts/results/pshtt.csv "${SHARED_DIR}"/artifacts
44+
"${CISA_HOME}"/domain-scan/scan "${SHARED_DIR}"/artifacts/scanme.csv \
4545
--scan=trustymail \
4646
--lambda \
4747
--lambda-retries=1 \
@@ -52,8 +52,8 @@ mv "${SHARED_DIR}/artifacts/results/pshtt.csv" "${SHARED_DIR}/artifacts"
5252
--smtp-localhost=ec2-100-27-42-254.compute-1.amazonaws.com
5353
# This file would get deleted when we rerun domain-scan/scan if it
5454
# stayed where it is
55-
mv "${SHARED_DIR}/artifacts/results/trustymail.csv" "${SHARED_DIR}/artifacts"
56-
"${CISA_HOME}/domain-scan/scan" "${SHARED_DIR}/artifacts/scanme.csv" \
55+
mv "${SHARED_DIR}"/artifacts/results/trustymail.csv "${SHARED_DIR}"/artifacts
56+
"${CISA_HOME}"/domain-scan/scan "${SHARED_DIR}"/artifacts/scanme.csv \
5757
--scan=sslyze \
5858
--lambda \
5959
--lambda-retries=1 \
@@ -62,7 +62,10 @@ mv "${SHARED_DIR}/artifacts/results/trustymail.csv" "${SHARED_DIR}/artifacts"
6262
--cache \
6363
--workers=40
6464
# Restore the files that we had temporarily copied to a safe place
65-
mv "${SHARED_DIR}/artifacts/{pshtt,trustymail}.csv" "${SHARED_DIR}/artifacts/results"
65+
#
66+
# Note that we cannot wrap {pshtt,trustymail} in double quotes, since
67+
# that would force the braces to be interpreted as literals.
68+
mv "${SHARED_DIR}"/artifacts/{pshtt,trustymail}.csv "${SHARED_DIR}"/artifacts/results
6669

6770
# Let redis know we're done
6871
redis-cli -h redis set scanning_complete true

src/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3.1"
1+
__version__ = "1.3.2"

0 commit comments

Comments
 (0)