-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Run Device Agent in container as unpriviledged user #565
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
Open
ppawlowski
wants to merge
15
commits into
main
Choose a base branch
from
feat-non-root-container
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2a22fab
Run device agent as non-root user
ppawlowski 0cc63e0
Add docker build workflow
ppawlowski ec1b4f1
Fix path
ppawlowski 0f4f098
Adjust workflow name
ppawlowski d8b1430
Add SAST scan for container
ppawlowski 0d90149
Do not build node package on docker-related changed
ppawlowski a2a12a4
Use codeql-action v4
ppawlowski 711c16e
Test multiarch image load
ppawlowski 17d9c58
Remove cache step
ppawlowski 06fef86
Remove debug log level for docker
ppawlowski 3103b7c
Pin setup-docker-action to commit sha
ppawlowski 2d77a94
Update docker/Dockerfile
ppawlowski 18a5e27
Merge branch 'main' into feat-non-root-container
ppawlowski 934d248
Add missing line break
ppawlowski 5dce8d2
Pin trivy version
ppawlowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Docker build | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'docker/**' | ||
| - '.github/workflows/docker-build.yaml' | ||
|
|
||
| jobs: | ||
| docker-build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| strategy: | ||
| matrix: | ||
| node: [18, 20] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Set up Docker | ||
| uses: docker/setup-docker-action@e43656e248c0bd0647d3f5c195d116aacf6fcaf4 #v4.7.0 | ||
| with: | ||
| daemon-config: | | ||
| { | ||
| "features": { | ||
| "containerd-snapshotter": true | ||
| } | ||
| } | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 | ||
|
|
||
| - name: Build Docker image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
| with: | ||
| context: . | ||
| file: docker/Dockerfile | ||
| platforms: linux/amd64, linux/arm64, linux/arm/v7 | ||
| tags: flowfuse-device-agent-pr:${{ matrix.node }}-scan | ||
| push: false | ||
| load: true | ||
| build-args: | | ||
| NODE_VERSION=${{ matrix.node }} | ||
|
|
||
| - name: Perform SAST scan | ||
| uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1 | ||
| with: | ||
| image-ref: flowfuse-device-agent-pr:${{ matrix.node }}-scan | ||
| trivy-config: .github/trivy.yaml | ||
| output: 'sast-results.sarif' | ||
|
|
||
| - name: Upload scan results | ||
| uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 | ||
| with: | ||
| sarif_file: sast-results.sarif |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.