audit

package
v3.6.172-1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package audit log the beginning and end of each API request to different logger. The records also contains information about the request status and error message if it fails.

Index

Constants

View Source
const (
	LogEntryType     = "openshift.logger"
	AuditUserEntry   = "openshift.auth.user"
	AuditUserIDEntry = "openshift.auth.userid"
	AuditStatusEntry = "openshift.request.status"
	AuditErrorEntry  = "openshift.request.error"

	DefaultLoggerType = "registry"
	AuditLoggerType   = "audit"

	OpStatusBegin = "begin"
	OpStatusError = "error"
	OpStatusOK    = "success"
)

Variables

This section is empty.

Functions

func LoggerExists

func LoggerExists(ctx context.Context) (exists bool)

LoggerExists checks audit logger existence.

func WithLogger

func WithLogger(ctx context.Context, logger *AuditLogger) context.Context

WithLogger creates a new context with provided logger.

Types

type AuditLogger

type AuditLogger struct {
	// contains filtered or unexported fields
}

AuditLogger implements special audit log. We can't use the system logger because the change of log level can hide the audit logs.

func GetLogger

func GetLogger(ctx context.Context) *AuditLogger

GetLogger returns the logger from the current context, if present. It will be created otherwise.

func MakeAuditLogger

func MakeAuditLogger(ctx context.Context) *AuditLogger

MakeAuditLogger returns new audit logger which inherits fields from the system logger.

func (*AuditLogger) Log

func (l *AuditLogger) Log(args ...interface{})

Log logs record.

func (*AuditLogger) LogResult

func (l *AuditLogger) LogResult(err error, args ...interface{})

LogResult logs record with additional operation status.

func (*AuditLogger) LogResultf

func (l *AuditLogger) LogResultf(err error, format string, args ...interface{})

LogResultf formats record according to a format with additional operation status.

func (*AuditLogger) Logf

func (l *AuditLogger) Logf(format string, args ...interface{})

Logf formats record according to a format.

func (*AuditLogger) SetFormatter

func (l *AuditLogger) SetFormatter(formatter logrus.Formatter)

SetFormatter sets the audit logger formatter.

type BlobStore

type BlobStore struct {
	// contains filtered or unexported fields
}

BlobStore wraps a distribution.BlobStore to track operation result and write it in the audit log.

func (*BlobStore) Create

func (*BlobStore) Delete

func (b *BlobStore) Delete(ctx context.Context, dgst digest.Digest) error

func (*BlobStore) Get

func (b *BlobStore) Get(ctx context.Context, dgst digest.Digest) ([]byte, error)

func (*BlobStore) Open

func (*BlobStore) Put

func (b *BlobStore) Put(ctx context.Context, mediaType string, p []byte) (distribution.Descriptor, error)

func (*BlobStore) Resume

func (*BlobStore) ServeBlob

func (b *BlobStore) ServeBlob(ctx context.Context, w http.ResponseWriter, req *http.Request, dgst digest.Digest) error

func (*BlobStore) Stat

type ManifestService

type ManifestService struct {
	// contains filtered or unexported fields
}

ManifestService wraps a distribution.ManifestService to track operation result and write it in the audit log.

func (*ManifestService) Delete

func (m *ManifestService) Delete(ctx context.Context, dgst digest.Digest) error

func (*ManifestService) Exists

func (m *ManifestService) Exists(ctx context.Context, dgst digest.Digest) (bool, error)

func (*ManifestService) Get

func (*ManifestService) Put

type TagService

type TagService struct {
	// contains filtered or unexported fields
}

TagService wraps a distribution.TagService to track operation result and write it in the audit log.

func (*TagService) All

func (t *TagService) All(ctx context.Context) ([]string, error)

func (*TagService) Get

func (*TagService) Lookup

func (t *TagService) Lookup(ctx context.Context, digest distribution.Descriptor) ([]string, error)

func (*TagService) Tag

func (t *TagService) Tag(ctx context.Context, tag string, desc distribution.Descriptor) error

func (*TagService) Untag

func (t *TagService) Untag(ctx context.Context, tag string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL