specs_security.h 1.9 KB
Newer Older
O
overweight 已提交
1 2
/******************************************************************************
 * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved.
3 4 5 6
 * iSulad licensed under the Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *     http://license.coscl.org.cn/MulanPSL2
O
overweight 已提交
7 8 9
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 * PURPOSE.
10
 * See the Mulan PSL v2 for more details.
O
overweight 已提交
11 12 13 14
 * Author: maoweiyong
 * Create: 2017-11-22
 * Description: provide specs definition
 ******************************************************************************/
15 16
#ifndef DAEMON_MODULES_SPEC_SPECS_SECURITY_H
#define DAEMON_MODULES_SPEC_SPECS_SECURITY_H
O
overweight 已提交
17 18

#include <stdint.h>
19 20 21 22 23
#include <isula_libutils/defs.h>
#include <isula_libutils/json_common.h>
#include <stdbool.h>
#include <stddef.h>

L
lifeng68 已提交
24
#include "err_msg.h"
H
haozi007 已提交
25 26 27
#include "isula_libutils/host_config.h"
#include "isula_libutils/container_config_v2.h"
#include "isula_libutils/oci_runtime_spec.h"
28

L
lifeng68 已提交
29 30 31
int merge_default_seccomp_spec(oci_runtime_spec *oci_spec, const defs_process_capabilities *capabilites);
int merge_caps(oci_runtime_spec *oci_spec, const char **adds, size_t adds_len, const char **drops, size_t drops_len);
int refill_oci_process_capabilities(defs_process_capabilities **caps, const char **src_caps, size_t src_caps_len);
O
overweight 已提交
32
int merge_sysctls(oci_runtime_spec *oci_spec, const json_map_string_string *sysctls);
W
wujing 已提交
33
int merge_no_new_privileges(oci_runtime_spec *oci_spec, bool value);
O
overweight 已提交
34
int adapt_settings_for_system_container(oci_runtime_spec *oci_spec, const host_config *host_spec);
W
wujing 已提交
35
int merge_seccomp(oci_runtime_spec *oci_spec, const char *seccomp_profile);
36
int merge_selinux(oci_runtime_spec *oci_spec, container_config_v2_common_config *v2_spec);
O
overweight 已提交
37 38

#endif