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

security workflow does not repeat nightly scans #481

Conversation

rahulreddy15
Copy link
Contributor

The reusable security workflow (https://github.com/newrelic/coreint-automation/blob/8e5f750ba1e151b93454c56aeb1f6dbcea0e3b00/.github/workflows/reusable_security.yaml) scans the repo ( codebase ) for vulnerabilities with Trivy.
This cannot be used for infrastructure-bundle because we need to build a docker Image and then scan that docker image for vulnerabilities by running trivy in table-mode.
We have code that does this in the reusable nightly workflow for docker images. But that workflow also publishes the nightly build so reusing it just to scan the image on pull request does not make sense.

The code that runs the security check on a schedule can be removed because that is being handled by the nightly.

The code that runs the security check on a pull request should be left as is since we do not have a reusable workflow that only builds and scans a docker image.

Copy link
Contributor

@DavSanchez DavSanchez left a comment

Choose a reason for hiding this comment

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

Quick question

Comment on lines -69 to -79
notify-failure:
if: ${{ github.event_name == 'schedule' && failure() }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Notify failure via Slack
uses: archive/github-actions-slack@master
with:
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }}
slack-channel: ${{ secrets.CAOS_COREINT_SLACK_CHANNEL }}
slack-text: "❌ `'newrelic/infrastructure-bundle'`: [security pipeline failed](${{ github.server_url }}/newrelic/infrastructure-bundle/actions/runs/${{ github.run_id }})."
Copy link
Contributor

Choose a reason for hiding this comment

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

I get we remove the repeated Trivy check, but do we want to get rid of the notify failure step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only notifies failure if github.event_name == 'schedule' .
We are no longer running this with schedule because we have the nightly.
For failure on push PR the action will upload the results to the workflow on both success and failure.

Copy link
Contributor

@DavSanchez DavSanchez left a comment

Choose a reason for hiding this comment

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

🚀

@rahulreddy15 rahulreddy15 force-pushed the NR-339698-Migrate-security-workflow-in-infrastructure-bundle-to-use-coreint-automation branch from 27ad5d5 to 2c15af1 Compare January 10, 2025 13:39
@rahulreddy15 rahulreddy15 merged commit c180f8b into master Jan 10, 2025
6 of 7 checks passed
@rahulreddy15 rahulreddy15 deleted the NR-339698-Migrate-security-workflow-in-infrastructure-bundle-to-use-coreint-automation branch January 10, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants