Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/prowler shared workflow for AWS and GCP #146

Merged
merged 26 commits into from
Aug 13, 2024
Merged
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dc9dcba
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
dd0624b
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
0d2a402
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
5877e98
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
e68432f
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
0e1c5df
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
587db1a
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
918e0ea
feat/prowler shared workflow for AWS and GCP
Bharadwajshivam28 Jul 31, 2024
be26f3a
Improvied workflow
Bharadwajshivam28 Aug 1, 2024
ad90754
feat:Adding Azure Prowler
Bharadwajshivam28 Aug 1, 2024
95aa124
feat:Adding Azure Prowler
Bharadwajshivam28 Aug 1, 2024
cbf8c40
feat:Adding Azure Prowler
Bharadwajshivam28 Aug 1, 2024
8613ed4
feat: changed auth way in azure
Bharadwajshivam28 Aug 1, 2024
ea095d9
feat:changed auth way for azure
Bharadwajshivam28 Aug 1, 2024
dc0142c
feat:changed auth way for azure
Bharadwajshivam28 Aug 1, 2024
4e08be3
feat:changed auth way for azure
Bharadwajshivam28 Aug 1, 2024
492866a
feat:changed auth way for azure
Bharadwajshivam28 Aug 1, 2024
e0184a4
feat:changed auth way for azure
Bharadwajshivam28 Aug 1, 2024
06f6f80
feat:Readme for Prowler
Bharadwajshivam28 Aug 7, 2024
7124c79
Readme for prowler
Bharadwajshivam28 Aug 12, 2024
3b7a41c
Readme for prowler
Bharadwajshivam28 Aug 12, 2024
5dcb209
added link in text
Bharadwajshivam28 Aug 12, 2024
466394d
modified readme
Bharadwajshivam28 Aug 12, 2024
ba5f00a
modified readme
Bharadwajshivam28 Aug 12, 2024
9cc8c70
feat:Added contributors section in README
Bharadwajshivam28 Aug 12, 2024
88d2f05
feat:Changed branch name in README
Bharadwajshivam28 Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/prowler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: Prowler Reusable Workflow

on:
workflow_call:
inputs:
cloud_provider:
required: true
type: string
description: 'Cloud Provider'
project_id:
required: false
type: string
description: 'Project id for GCP'
aws_region:
required: false
type: string
description: 'AWS Region'

secrets:
WIP:
required: false
description: 'WIP'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give proper description

SERVICE_ACCOUNT:
required: false
description: 'GCP service account'
BUILD_ROLE:
required: false
description: 'AWS OIDC role for aws authentication.'
AWS_ACCESS_KEY_ID:
required: false
description: AWS Access Key ID to install AWS CLI.
AWS_SECRET_ACCESS_KEY:
required: false
description: AWS Secret access key to install AWS CLI
AWS_SESSION_TOKEN:
required: false
description: AWS Session Token to install AWS CLI

jobs:
prowler:
runs-on: macos-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

- name: Install Prowler
run: |
brew install prowler

- name: Authenticate with Google Cloud
if: ${{ inputs.cloud_provider == 'gcp' }}
uses: google-github-actions/auth@v1
with:
token_format: access_token
workload_identity_provider: ${{ secrets.WIP }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}
access_token_lifetime: 300s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass access_token_lifetime value in inputs and set default value

project_id: ${{ inputs.project_id }}

- name: Install AWS CLI
if: ${{ inputs.cloud_provider == 'aws' }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
role-to-assume: ${{ secrets.BUILD_ROLE }}
aws-region: ${{ inputs.aws_region }}
role-duration-seconds: 900
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass value in inputs

role-skip-session-tagging: true

- name: Run Prowler for GCP
if: ${{ inputs.cloud_provider == 'gcp' }}
id: prowler-gcp
run: |
prowler gcp --project-ids ${{ inputs.project_id }} -o ${{ github.workspace }}/report/
continue-on-error: true

- name: Run Prowler for AWS
if: ${{ inputs.cloud_provider == 'aws' }}
id: prowler-aws
run: |
prowler aws -f ${{ inputs.aws_region }} -o ${{ github.workspace }}/report/
continue-on-error: true

- name: Upload report directory
uses: actions/upload-artifact@v3
with:
name: compliance-report
path: ${{ github.workspace }}/report/
...