microsoft / microsoft/windows-container-tools

How to use Logmon when running as ContainerUser

Open
#143 3 comments 0 reactions 1 assignee View on GitHub

@iankingori is already working on this.

Since May 18, 2023.

needs-investigation
Dominant language
C++
Stars
277
Forks
77
PR merge metrics
No merged PRs in 30d

Description

Discussed in https://github.com/microsoft/windows-container-tools/discussions/142

Originally posted by rigdal May 15, 2023
Running apps in containers as a non-root user is standard with containers nowadays.

I am new to Windows containers, but it appears that I should leverage USER ContainerUser in my Dockerfile for running as non-root.

However, I cannot seem to start Logmon or maybe there is a better spot to have my USER layer in my Dockerfile. Here is the output I get upon startup.

_npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] ERROR: Failed to start ETW trace. Error: 5
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] ERROR: Failed to start ETW trace session. Error: 5
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] ERROR: Failed to start ETW monitor. Error: 5
npc-oes-webapp  | 
npc-oes-webapp  | ERROR: Failed to stop or query status of service 'w3svc' error [80070005]
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] ERROR: Failed to open log directory handle. Directory: \\?\c:\inetpub\logs Error=5
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] ERROR: Failed to start log file monitor. Log files in a directory \\?\c:\inetpub\logs will not be monitored. Error: 5
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] INFO: Entrypoint processs exit code: -2147024891
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] WARNING: The given session is not running. Error: 4201
npc-oes-webapp  | [2023-05-15T16:48:49.000Z][LOGMONITOR] ERROR: Failed to wait for log file monitor to stop. Log directory: \\?\c:\inetpub\logs Error: 2147942406_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.