Skip to content

Commit

Permalink
Add comments identifying sensitive logging risks
Browse files Browse the repository at this point in the history
Signed-off-by: Clarence "Sparr" Risher <[email protected]>
  • Loading branch information
sparr committed May 8, 2023
1 parent 1c7ab66 commit 586037f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/soci-snapshotter-grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const (
defaultMetricsNetwork = "tcp"
)

// logLevel of Debug or Trace may emit sensitive information
// e.g. file contents, file names and paths, network addresses and ports
var (
address = flag.String("address", defaultAddress, "address for the snapshotter's GRPC server")
configPath = flag.String("config", defaultConfigPath, "path to the configuration file")
Expand Down Expand Up @@ -133,7 +135,7 @@ func main() {
)
defer cancel()
// Streams log of standard lib (go-fuse uses this) into debug log
// Snapshotter should use "github.com/containerd/containerd/log" otherwize
// Snapshotter should use "github.com/containerd/containerd/log" otherwise
// logs are always printed as "debug" mode.
golog.SetOutput(log.G(ctx).WriterLevel(logrus.DebugLevel))
log.G(ctx).WithFields(logrus.Fields{
Expand Down
3 changes: 2 additions & 1 deletion fs/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ type FuseConfig struct {
NegativeTimeout int64 `toml:"negative_timeout"`

// LogFuseOperations enables logging of operations on FUSE FS. This is to be used
// for debugging purposes only.
// for debugging purposes only. This option may emit sensitive information,
// e.g. filenames and paths within an image
LogFuseOperations bool `toml:"log_fuse_operations"`
}

Expand Down
2 changes: 2 additions & 0 deletions fs/layer/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ func incFuseOpFailureMetric(operationName string, layer digest.Digest) {
commonmetrics.IncOperationCount(metric, layer)
}

// logFSOperations may cause sensitive information to be emitted to logs
// e.g. filenames and paths within an image
func newNode(layerDgst digest.Digest, r reader.Reader, blob remote.Blob, baseInode uint32, opaque OverlayOpaqueType, logFSOperations bool, opCounter *FuseOperationCounter) (fusefs.InodeEmbedder, error) {
rootID := r.Metadata().RootID()
rootAttr, err := r.Metadata().GetAttr(rootID)
Expand Down

0 comments on commit 586037f

Please sign in to comment.