Sync Security Hub findings and Jira issues #676
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
name: Sync Security Hub findings and Jira issues | |
on: | |
workflow_dispatch: # for testing and manual runs | |
schedule: | |
- cron: "25 1 * * *" # daily at 6:25 am EST | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
sync: | |
strategy: | |
max-parallel: 1 | |
matrix: | |
environment: ["prod-security-hub"] | |
fail-fast: false | |
environment: | |
name: ${{ matrix.environment }} | |
name: Run sync | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | |
- name: Sync Security Hub and Jira | |
uses: Enterprise-CMCS/mac-fc-security-hub-visibility@v2.0.9 | |
with: | |
jira-token: ${{ secrets.JIRA_TOKEN }} | |
jira-username: noVal # required variable for package but not for Enterprise Jira | |
jira-project-key: EREGCSC | |
jira-ignore-statuses: Done, Closed, Canceled | |
jira-custom-fields: '{ "customfield_10100": "EREGCSC-1989" }' | |
aws-severities: CRITICAL, HIGH, MEDIUM, LOW | |
#assign-jira-ticket-to: VU6Q | |
#auto-close: false | |
- name: Alert Slack On Failure | |
if: failure() | |
run: | | |
curl -X POST -H 'Content-type: application/json' --data '{"text": "Failure completing Syncing Security Hub and Jira.","blocks":[{"type": "section","text":{"type": "mrkdwn","text": "The nightly scheduled Job: https://github.com/Enterprise-CMCS/cmcs-eregulations/actions/runs/${{ github.run_id }} to Sync Security Hub and Jira has failed to complete successfully "}}]}' ${{ secrets.DEV_BOTS_SLACK_WEBHOOK }} |