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: Enhance action.yaml with additional outputs for downstream integration #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bilals12
Copy link

new outputs:

  • image-name: outputs Docker image name after scanning.
  • image-tag: outputs Docker image tag after scanning.
  • scan-results: path to scan results file.

this will (hopefully) also allow downstream processes to consume these scan results programmatically.

some additional context:
these changes support integrating this GHA with external tools, such as the TypeScript program that will be in it-security-tooling/security-engineering, to fetch Lacework scan results and then report them to New Relic.

@bilals12 bilals12 self-assigned this Nov 22, 2024
@bilals12 bilals12 requested a review from a team as a code owner November 22, 2024 14:58
@bilals12 bilals12 force-pushed the c/updating-container-scan-action branch from 8716afd to 2eacad8 Compare November 22, 2024 16:19
Copy link
Contributor

@tagoro9 tagoro9 left a comment

Choose a reason for hiding this comment

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

Just the removal of the comment logic

container-scan/action.yaml Outdated Show resolved Hide resolved
container-scan/action.yaml Outdated Show resolved Hide resolved
container-scan/action.yaml Show resolved Hide resolved
@bilals12 bilals12 force-pushed the c/updating-container-scan-action branch from 2eacad8 to fe28659 Compare November 22, 2024 17:24
@bilals12 bilals12 enabled auto-merge (rebase) November 28, 2024 17:44
@bilals12 bilals12 force-pushed the c/updating-container-scan-action branch from e720887 to 392484f Compare December 9, 2024 20:46
Copy link
Contributor

@prathamesh16c prathamesh16c left a comment

Choose a reason for hiding this comment

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

Also, can we add a example dir which outlines an example of using this action in a consuming repo ? We can add two examples - one with NR reporting and the other without (basic scanning of container image using lacework)

@bilals12 bilals12 force-pushed the c/updating-container-scan-action branch 2 times, most recently from 6e0e637 to b4fd165 Compare December 10, 2024 19:12
@bilals12 bilals12 requested a review from a team December 10, 2024 20:05
- adds test workflow for scanning containers
- formats scan results for New Relic integration
- includes debug mode and configurable inputs
- preserves results as workflow artifacts

feat: update action.yaml for additional outputs (image-name, image-tag) for downstream processing

chore: remove scan-output-test.yaml from branch

fix: resolve set-output and input issues in container-scan action

fix: resolving errors

fix: align outputs and cleanup references in container scan action

fix: add required inputs for container scan

Added input definitions for:
- lw-account-name
- lw-access-token
- github-token
- build-args

Pass build-args to docker-build action

feat(action): add JSON output format support

- Add output-format parameter to control scan results format
- Pass format parameter to Lacework scanner
- Default to JSON for better parsing

fix(scan): disable verbose output for JSON format

- Add scanner flag to output clean JSON
- Enable proper parsing of scan results

fix(scan): use correct JSON output flag for Lacework scanner

- Add -j=true flag to force JSON output format
- Remove output-format parameter

fix(scan): use correct parameter name for JSON output

- Replace SCANNER_FLAGS with ADDITIONAL_PARAMETERS
- Maintain -j=true flag for JSON format

feat: add optional skip-checkout input to container-scan action

fix(ci): restore PR commenting and result formatting in security scan action

- Added steps to check and delete previous PR comments to ensure clean re-runs.
- Restored PR commenting functionality with formatted Lacework scan results.
- Improved validation of  to prevent runtime errors.
- Ensured Docker images are properly cleaned up after the scan process.

This change addresses feedback regarding missing PR comments and maintains the expected behavior of the workflow.

fix(ci): restored ADDITIONAL_PARAMETERS to enable JSON output.

fix: add missing shell property to container scan action

fix: add winterjung/comment@v1, type: delete

feat(security): enable table output for container scan results

- Add RESULTS_IN_GITHUB_SUMMARY and PRETTY_OUTPUT flags to Lacework scanner config
- Maintain JSON output for New Relic metrics integration
- Improve scan result readability in PR comments

The scanner will now display results in both table format for GitHub and JSON for metrics reporting.

feat(security): enable table output for scan results while preserving JSON for metrics

Set PRETTY_OUTPUT and RESULTS_IN_GITHUB_SUMMARY to true while maintaining JSON output for New Relic integration using --save-results flag

feat(security): parse JSON scan results into markdown table

Keep JSON output for New Relic integration while adding JQ-based parsing to generate readable table format for PR comments

feat(security): parse JSON scan results into markdown table

Keep JSON output for New Relic integration while adding JQ-based parsing to generate readable table format for PR comments

fix(ci): recreating pretty table

feat(security): add formatted Lacework vulnerability report for PR comments

- Parse Lacework JSON scan results into a readable markdown table.
- Generate a summary table with severity counts and detailed vulnerabilities.
- Add support for posting formatted results as PR comments.
- Ensure compatibility with consuming workflows.

fix(ci): revert to JSON results, table format failing
@bilals12 bilals12 force-pushed the c/updating-container-scan-action branch from 09b55cc to a9dccbb Compare December 11, 2024 17:09
Copy link

Release notes preview

No new release will be created.

If you are expecting a release, you will need to either fix a bug or add a feature.
Chores, CI, docs, refactoring, style and other changes will not trigger a release.

Copy link
Contributor

@tagoro9 tagoro9 left a comment

Choose a reason for hiding this comment

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

There is something odd in the PR. The title says feat but the only commit says test. This is not going to create a new release of the action.

You are doing some refactoring in the same commit, making the review a bit harder. It would be nice to split things into separate commits

image

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.

3 participants