-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: go back to root user in Dockefile #103
fix: go back to root user in Dockefile #103
Conversation
Other options: we do setup a non-root user with sudoer privileges. This should satisfy the security linter and still gives us the same privileges as root in the container. (yep, I understand still insecure) |
We will likely need to add something in the dockerfile or a config file to exempt the security rule being caught by the linter. |
cb33298
to
0d0abf2
Compare
Fixes: github#101 Based on [GitHub docs]() we will not be able to access the workspace of the GitHub Action without being the root user. As a non-root user we won't be able to write to `$GITHUB_OUTPUT` which is an environment variable that is a path inside the workspace and GitHub Actions using to handle output from the GitHub Action. Once that was realized, this seems to be the only possible path. fix: ignore checkov linter requiring user in Dockerfile Signed-off-by: jmeridth <jmeridth@gmail.com>
0d0abf2
to
eee235e
Compare
@zkoppert updated and pushed with skip for user in Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the follow up on this @jmeridth!
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - [x] add missing --- at top of stale.yml github action (makes warning happy) there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
- [x] add skips for checkov - can't add user due to needing root access [context](github/stale-repos#103) - add health check endpoint - not there yet - [x] move flake8 arguments from Makefile into .github/linters/.flake8 config file - use .flake8 config in Makefile - [x] move .pylintrc from root to .github/linters/.pylintrc so superlinter uses it - rename file to .python-lint (default that superlinter looks for) - [x] add missing --- at top of stale.yml github action (makes warning happy) - [x] update super-linter to v6 - [x] update README with permissions best practices in examples there might be a few other linting errors, but I'm not able to recreate locally currently Signed-off-by: jmeridth <jmeridth@gmail.com>
Fixes: #101
Pull Request
Proposed Changes
Based on GitHub docs we will not be able to access the workspace of the GitHub Action without being the root user. As a non-root user we won't be able to write to
$GITHUB_OUTPUT
which is an environment variable that is a path inside the workspace and GitHub Actions using to handle output from the GitHub Action.Once that was realized, this seems to be the only possible path.
fix: ignore checkov linter requiring user in Dockerfile (docs)
Running checkov locally
Note: CKV_DOCKER_3 is skipped
Readiness Checklist
Author/Contributor
make lint
and fix any issues that you have introducedmake test
and ensure you have test coverage for the lines you are introducingReviewer
bug
,documentation
,enhancement
,infrastructure
, orbreaking