-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:DrumSlayers/PA-ESGI-2023
- Loading branch information
Showing
10 changed files
with
285 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Checkov Scan and Upload to S3 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
checkov_scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get install python3-pip -y | ||
sudo pip3 install checkov awscli awscli_plugin_endpoint | ||
- name: Setup AWS CLI | ||
run: | | ||
mkdir $HOME/.aws | ||
cat << EOF > $HOME/.aws/config | ||
[plugins] | ||
endpoint = awscli_plugin_endpoint | ||
[default] | ||
region = fr-par | ||
s3 = | ||
endpoint_url = https://s3.fr-par.scw.cloud | ||
s3api = | ||
endpoint_url = https://s3.fr-par.scw.cloud | ||
EOF | ||
cat << EOF > $HOME/.aws/credentials | ||
[default] | ||
aws_access_key_id = ${{ secrets.ACCESS_KEY_ID_SCALEWAY }} | ||
aws_secret_access_key = ${{ secrets.SECRET_ACCESS_KEY_SCALEWAY }} | ||
EOF | ||
- name: Run Checkov | ||
run: | | ||
checkov -d . > results.txt || exit 0 | ||
- name: Upload Results to S3 | ||
run: | | ||
TIMESTAMP=$(TZ=":Europe/Paris" date '+%d_%m_%Y_%H_%M_%S') | ||
aws s3 cp results.txt s3://${{ secrets.BUCKETNAME }}/checkov_$TIMESTAMP.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.