99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov/*
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov SSSD
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov Session recording utilities
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov Authors:
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov Copyright (C) 2017 Red Hat
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov This program is free software; you can redistribute it and/or modify
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov it under the terms of the GNU General Public License as published by
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov the Free Software Foundation; either version 3 of the License, or
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov (at your option) any later version.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov This program is distributed in the hope that it will be useful,
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov but WITHOUT ANY WARRANTY; without even the implied warranty of
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov GNU General Public License for more details.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov You should have received a copy of the GNU General Public License
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov along with this program. If not, see <http://www.gnu.org/licenses/>.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov*/
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov#ifndef __SESSION_RECORDING_H__
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov#define __SESSION_RECORDING_H__
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov#include "confdb/confdb.h"
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov#include "util/util_errors.h"
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov/** Scope of users/groups whose session should be recorded */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashovenum session_recording_scope {
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov SESSION_RECORDING_SCOPE_NONE, /**< None, no users/groups */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov SESSION_RECORDING_SCOPE_SOME, /**< Some users/groups specified elsewhere */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov SESSION_RECORDING_SCOPE_ALL /**< All users/groups */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov};
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov/** Session recording configuration (from "session_recording" section) */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashovstruct session_recording_conf {
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov /**
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * Session recording scope:
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * whether to record nobody, everyone, or some users/groups
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov enum session_recording_scope scope;
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov /**
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * NULL-terminated list of users whose session should be recorded.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * Can be NULL, meaning empty list. Only applicable if scope is "some".
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov char **users;
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov /**
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * NULL-terminated list of groups, members of which should have their
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * sessions recorded. Can be NULL, meaning empty list. Only applicable if
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * scope is "some"
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov char **groups;
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov};
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov/**
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * Load session recording configuration from configuration database.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov *
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * @param mem_ctx Memory context to allocate data with.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * @param cdb The configuration database connection object to retrieve
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * data from.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * @param pconf Location for the loaded session recording configuration.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov *
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * @return Status code:
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * ENOMEM - memory allocation failed,
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * EINVAL - configuration was invalid,
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov * EIO - an I/O error occurred while communicating with the ConfDB.
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov */
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashovextern errno_t session_recording_conf_load(
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov TALLOC_CTX *mem_ctx,
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov struct confdb_ctx *cdb,
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov struct session_recording_conf *pconf);
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov
99b96048b79b0228c3f7c431ea12010f7bd5b362Nikolai Kondrashov#endif /* __SESSION_RECORDING_H__ */