slimtoolkit / slimtoolkit/slim
Incorrect generated seccomp profile for ASP.NET Core app
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.4k
- Forks
- 840
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behavior
Running docker-slim build on an ASP.NET Core application should produce a seccomp profile that can be successfully used when running the container.
Actual Behavior
Attempting to use the generated seccomp profile results in a failure to start the container. This is because the syscalls contained in the seccomp profile is missing fstatfs.
Steps to Reproduce the Problem
-
git clone https://github.com/dotnet/dotnet-docker.git -
cd dotnet-docker/samples/aspnetapp -
docker-slim build --dockerfile Dockerfile.debian-x64-slim --expose 80 --copy-meta-artifacts artifacts --tag-fat app --tag app.min . -
docker run --rm -it -p 8000:80 --security-opt seccomp=artifacts/app-seccomp.json app.minFailure Result:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: close exec fds: ensure /proc/self/fd is on procfs: operation not permitted: unknown. -
Open the
artifacts/app-seccomp.jsonfile in a text editor. -
Add
fstatfsto the list of syscall names and save the file. -
docker run --rm -it -p 8000:80 --security-opt seccomp=artifacts/app-seccomp.json app.minSuccessful Result:
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60] Storing keys in a directory '/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {c31322cc-fec6-4a7a-9dbf-3798a9e5db7c} may be persisted to storage in unencrypted form. info: Microsoft.Hosting.Lifetime[0] Now listening on: http://[::]:80 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app
Specifications
- Version:
docker-slim version linux|Transformer|1.34.0|a5cb54043b3ab3cf747165aad745f19db680434e|2021-01-29_10:00:49PM - Platform: Ubuntu 20.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the listed docker-slim build and docker run commands in dotnet-docker/samples/aspnetapp, then inspect artifacts/app-seccomp.json. Done means the generated profile includes fstatfs and the app.min container starts successfully with that profile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- devops, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100