Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlongcc committed Jul 8, 2024
1 parent 53b49ca commit e0a5315
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ jobs:
steps:
- name: Add Dependencies
run: |
# python3 -m pip install --user ansible
# python3 -m pip install --upgrade --user ansible
npm install -g @mitre/saf
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-auditor
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Clone Repository
uses: actions/checkout@v4

Expand All @@ -39,32 +34,32 @@ jobs:
echo ${{ env.CA_FILE_BASE64_AB }} >> CA_FILE
base64 --decode CA_FILE > certificates/dod_CAs.pem
echo ${{ env.CERTIFICATE_KEY_FILE }} > certificates/mongodb.pem
cat certificates/mongodb.pem
head -c 10 certificates/mongodb.pem
- name: Run Packer Hardening
run: |
packer init mongo-hardening.pkr.hcl
packer build mongo-hardening.pkr.hcl
# - name: Run Packer Hardening
# run: |
# packer init mongo-hardening.pkr.hcl
# packer build mongo-hardening.pkr.hcl

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Log in to GitHub Container Registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Tag and Push Docker Image
run: |
docker tag mongo-hardened:latest ghcr.io/${{ github.repository_owner }}/mongo-hardened:latest
docker push ghcr.io/${{ github.repository_owner }}/mongo-hardened:latest
# - name: Tag and Push Docker Image
# run: |
# docker tag mongo-hardened:latest ghcr.io/${{ github.repository_owner }}/mongo-hardened:latest
# docker push ghcr.io/${{ github.repository_owner }}/mongo-hardened:latest

- name: Run Packer Validation
run: |
packer build -var 'report={"report_to_heimdall":"${{ env.REPORT_TO_HEIMDALL }}","heimdall_url":"${{ env.HEIMDALL_URL }}","heimdall_api_key":"${{ env.HEIMDALL_API_KEY }}"}' mongo-validate.pkr.hcl
docker ps -a
# - name: Run Packer Validation
# run: |
# packer build -var 'report={"report_to_heimdall":"${{ env.REPORT_TO_HEIMDALL }}","heimdall_url":"${{ env.HEIMDALL_URL }}","heimdall_api_key":"${{ env.HEIMDALL_API_KEY }}"}' mongo-validate.pkr.hcl
# docker ps -a

- name: Save Scan Artifacts
uses: actions/upload-artifact@v4
with:
path: reports/*.json
if: always()
# - name: Save Scan Artifacts
# uses: actions/upload-artifact@v4
# with:
# path: reports/*.json
# if: always()

0 comments on commit e0a5315

Please sign in to comment.