Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlongcc committed Jun 3, 2024
1 parent 075c1a9 commit 70be6f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A workflow for hardening a MongoDB container against a STIG using Packer and Ans

Start by cloning the `mongo-hardening` repository from GitHub to your local machine:

```
```sh
git clone https://github.com/mitre/mongodb-enterprise-advanced-4-stig-baseline-hardening.git
cd mongo-hardening
```
Expand All @@ -29,31 +29,31 @@ A workflow for hardening a MongoDB container against a STIG using Packer and Ans

Execute the following command to create the inputs.yml file under `spec/mongo-inspec-profile` by copying `inputs_template.yml` and renaming it to `inputs.yml`:

```
```sh
cp spec/mongo-inspec-profile/inputs_template.yml spec/mongo-inspec-profile/inputs.yml
```

4. **Initialize Packer**

Initialize Packer to install the required Ansible and Docker plugins:

```
```sh
packer init .
```

5. **Build the Hardened Image**

Execute the following command to build, test, and save the hardened Mongo image:

```
```sh
packer build mongo-hardening.pkr.hcl
```

6. **Run the Hardened Image**

Execute the following command to run the hardened Mongo image:

```
```sh
docker run -d \
--name mongo-hardened \
-p 27017:27017 \
Expand All @@ -74,14 +74,14 @@ A workflow for hardening a MongoDB container against a STIG using Packer and Ans

- Remove the `--controls` flag to run all inspec checks at once.

```
inspec exec spec/mongo-inspec-profile/ -t docker://mongo-hardened --controls=SV-252134 --no-create-lockfile --input-file=spec/mongo-inspec-profile/inputs.yml
```sh
inspec exec spec/mongo-inspec-profile/ -t docker://mongo-hardened --controls=SV-252134 --input-file=spec/mongo-inspec-profile/inputs.yml --no-create-lockfile --show-progress
```

- To get into the inspec shell for deeper testing

```
inspec shell -t docker://mongo-hardened --depends=spec/mongo-inspec-profile/ --no-create-lockfile --input-file=spec/mongo-inspec-profile/inputs.yml
```sh
inspec shell -t docker://mongo-hardened --depends=spec/mongo-inspec-profile/ --input-file=spec/mongo-inspec-profile/inputs.yml
```

---
2 changes: 1 addition & 1 deletion spec/ansible/roles/mongo-stig/tasks/prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
group: "{{ mongo_group }}"
mode: "{{ mongo_permissions }}"

- name: "PREP | Create MongoDB admin user"
- name: "PREP | Create MongoDB root user"
community.mongodb.mongodb_user:
database: "{{ mongo_auth_source }}"
name: "{{ mongo_dba }}"
Expand Down

0 comments on commit 70be6f4

Please sign in to comment.