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

Release v2.0.0: Run ASH as non-root user, add explicit CI stage #109

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

rafaelpereyra
Copy link
Contributor

@rafaelpereyra rafaelpereyra commented Oct 28, 2024

Issue #, if available:

N/A

Description of changes:

v2.0.0

Breaking Changes

  • Building ASH images for use in CI platforms (or other orchestration platforms that may require elevated access within the container) now requires targeting the ci stage of the Dockerfile:

via ash CLI

ash --no-run --build-target ci

via docker or other OCI CLI

docker build --tag automated-security-helper:ci --target ci .

Features

  • Run ASH as non-root user to align with security best practices.
  • Create a CI version of the docker file that still runs as root to comply with the different requirements from building platforms where UID/GID cannot be modified and there are additional agents installed at runtime that requires elevated privileges.

Fixes

  • Offline mode now skips NPM/PNPM/Yarn Audit checks (requires connection to registry to pull package information)
  • NPM install during image build now restricts available memory to prevent segmentation fault

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

climbertjh2 and others added 29 commits April 29, 2024 12:36
…rtjh2/automated-security-helper into feature/78/run-container-non-root
…tly in offline mode so findings are still captured
Copy link
Contributor

@climbertjh2 climbertjh2 left a comment

Choose a reason for hiding this comment

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

Requesting one minor change.

Dockerfile Outdated Show resolved Hide resolved
scrthq
scrthq previously approved these changes Nov 1, 2024
@rafaelpereyra
Copy link
Contributor Author

Includes changes from #79

@rafaelpereyra rafaelpereyra changed the title Merge from main ASH Running as non-root user Nov 1, 2024
scrthq
scrthq previously approved these changes Nov 1, 2024
awsmadi
awsmadi previously approved these changes Nov 12, 2024
Copy link
Contributor

@awsmadi awsmadi left a comment

Choose a reason for hiding this comment

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

looks great!

climbertjh2
climbertjh2 previously approved these changes Nov 13, 2024
Copy link
Contributor

@climbertjh2 climbertjh2 left a comment

Choose a reason for hiding this comment

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

This looks good to me.

I understand the addition of --target to the command-line options, since it is similar to the docker build command-line option of --target. However, in the context of the ash command-line, I think it might cause some confusion.

Also, in the command-line help, it says image to build - it probably should say image to run/build.

@scrthq scrthq dismissed stale reviews from climbertjh2 and awsmadi via bb4c68f December 2, 2024 19:50
Add additional checks for build expiry and ignoring Checkov/NPM Audit during offline mode
@scrthq scrthq changed the title ASH Running as non-root user Release v2.0.0: Run ASH as non-root user, add explicit CI stage Dec 2, 2024
scrthq
scrthq previously approved these changes Dec 3, 2024
Copy link
Contributor

@climbertjh2 climbertjh2 left a comment

Choose a reason for hiding this comment

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

I did a couple smoke tests - this looks OK to me. Approving.

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.

5 participants