/** * audit_dmv_roothash() - audit the roothash of a dmverity_roothash property. * @ab: Supplies a pointer to the audit_buffer to append to. * @rh: Supplies a pointer to the digest structure.
*/ staticvoid audit_dmv_roothash(struct audit_buffer *ab, constvoid *rh)
{
audit_log_format(ab, "%s", audit_prop_names[IPE_PROP_DMV_ROOTHASH]);
ipe_digest_audit(ab, rh);
}
/** * audit_fsv_digest() - audit the digest of a fsverity_digest property. * @ab: Supplies a pointer to the audit_buffer to append to. * @d: Supplies a pointer to the digest structure.
*/ staticvoid audit_fsv_digest(struct audit_buffer *ab, constvoid *d)
{
audit_log_format(ab, "%s", audit_prop_names[IPE_PROP_FSV_DIGEST]);
ipe_digest_audit(ab, d);
}
/** * audit_rule() - audit an IPE policy rule. * @ab: Supplies a pointer to the audit_buffer to append to. * @r: Supplies a pointer to the ipe_rule to approximate a string form for.
*/ staticvoid audit_rule(struct audit_buffer *ab, conststruct ipe_rule *r)
{ conststruct ipe_prop *ptr;
/** * ipe_audit_match() - Audit a rule match in a policy evaluation. * @ctx: Supplies a pointer to the evaluation context that was used in the * evaluation. * @match_type: Supplies the scope of the match: rule, operation default, * global default. * @act: Supplies the IPE's evaluation decision, deny or allow. * @r: Supplies a pointer to the rule that was matched, if possible.
*/ void ipe_audit_match(conststruct ipe_eval_ctx *const ctx, enum ipe_match match_type, enum ipe_action_type act, conststruct ipe_rule *const r)
{ constchar *op = audit_op_names[ctx->op]; char comm[sizeof(current->comm)]; struct audit_buffer *ab; struct inode *inode;
if (act != IPE_ACTION_DENY && !READ_ONCE(success_audit)) return;
ab = audit_log_start(audit_context(), GFP_ATOMIC | __GFP_NOWARN,
AUDIT_IPE_ACCESS); if (!ab) return;
/** * audit_policy() - Audit a policy's name, version and thumbprint to @ab. * @ab: Supplies a pointer to the audit buffer to append to. * @audit_format: Supplies a pointer to the audit format string * @p: Supplies a pointer to the policy to audit.
*/ staticvoid audit_policy(struct audit_buffer *ab, constchar *audit_format, conststruct ipe_policy *const p)
{
u8 digest[SHA256_DIGEST_SIZE];
/** * ipe_audit_policy_activation() - Audit a policy being activated. * @op: Supplies a pointer to the previously activated policy to audit. * @np: Supplies a pointer to the newly activated policy to audit.
*/ void ipe_audit_policy_activation(conststruct ipe_policy *const op, conststruct ipe_policy *const np)
{ struct audit_buffer *ab;
ab = audit_log_start(audit_context(), GFP_KERNEL,
AUDIT_IPE_CONFIG_CHANGE); if (!ab) return;
if (op) {
audit_policy(ab, AUDIT_OLD_ACTIVE_POLICY_FMT, op);
audit_log_format(ab, " ");
} else { /* * old active policy can be NULL if there is no kernel * built-in policy
*/
audit_log_format(ab, AUDIT_OLD_ACTIVE_POLICY_NULL_FMT);
audit_log_format(ab, " ");
}
audit_policy(ab, AUDIT_NEW_ACTIVE_POLICY_FMT, np);
audit_log_format(ab, " auid=%u ses=%u lsm=ipe res=1",
from_kuid(&init_user_ns, audit_get_loginuid(current)),
audit_get_sessionid(current));
audit_log_end(ab);
}
/** * ipe_audit_policy_load() - Audit a policy loading event. * @p: Supplies a pointer to the policy to audit or an error pointer.
*/ void ipe_audit_policy_load(conststruct ipe_policy *const p)
{ struct audit_buffer *ab; int err = 0;
ab = audit_log_start(audit_context(), GFP_KERNEL,
AUDIT_IPE_POLICY_LOAD); if (!ab) return;
/** * ipe_audit_enforce() - Audit a change in IPE's enforcement state. * @new_enforce: The new value enforce to be set. * @old_enforce: The old value currently in enforce.
*/ void ipe_audit_enforce(bool new_enforce, bool old_enforce)
{ struct audit_buffer *ab;
ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_MAC_STATUS); if (!ab) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.