65#define PQS_SANDBOX_DEFAULT_TIMEOUT_SECONDS 120U
70#define PQS_SANDBOX_MIN_TIMEOUT_SECONDS 5U
75#define PQS_SANDBOX_MAX_TIMEOUT_SECONDS 3600U
80#define PQS_SANDBOX_DEFAULT_OUTPUT_BYTES 1048576U
85#define PQS_SANDBOX_MIN_OUTPUT_BYTES 4096U
90#define PQS_SANDBOX_MAX_OUTPUT_BYTES 16777216U
97 char working_directory[QSC_SYSTEM_MAX_PATH];
98 char run_as_user[PQS_USERNAME_MAX];
99 char run_as_group[PQS_USERNAME_MAX];
100 uint32_t command_timeout_seconds;
101 uint32_t max_output_bytes;
103 bool clear_environment;
105 bool allow_same_user;
PQS_EXPORT_API void pqs_sandbox_profile_configure(pqs_sandbox_profile *profile, bool enabled, bool clear_environment, uint32_t timeout_seconds, const char *working_directory)
Configure a sandbox profile.
Definition pqssandbox.c:110
PQS_EXPORT_API bool pqs_sandbox_working_directory_valid(const pqs_sandbox_profile *profile)
Test whether a sandbox profile has a usable working directory.
Definition pqssandbox.c:193
PQS_EXPORT_API bool pqs_sandbox_profile_canonicalize_working_directory(pqs_sandbox_profile *profile)
Canonicalize the configured sandbox working directory in place.
Definition pqssandbox.c:149
PQS_EXPORT_API void pqs_sandbox_profile_defaults(pqs_sandbox_profile *profile)
Initialize a sandbox profile with safe defaults.
Definition pqssandbox.c:94
PQS_EXPORT_API uint32_t pqs_sandbox_output_limit_bytes(const pqs_sandbox_profile *profile)
Get the configured command-output byte limit.
Definition pqssandbox.c:227
PQS_EXPORT_API void pqs_sandbox_profile_set_allow_same_user(pqs_sandbox_profile *profile, bool allow_same_user)
Set the same-user execution override for a sandbox profile.
Definition pqssandbox.c:172
PQS_EXPORT_API void pqs_sandbox_profile_set_output_limit(pqs_sandbox_profile *profile, uint32_t max_output_bytes)
Set the maximum command-output byte count for a sandbox profile.
Definition pqssandbox.c:183
PQS_EXPORT_API uint32_t pqs_sandbox_timeout_milliseconds(const pqs_sandbox_profile *profile)
Get the command timeout in milliseconds.
Definition pqssandbox.c:211
PQS_EXPORT_API void pqs_sandbox_profile_configure_security(pqs_sandbox_profile *profile, bool enabled, bool clear_environment, uint32_t timeout_seconds, const char *working_directory, const char *run_as_user, const char *run_as_group, bool chroot_enabled)
Configure a sandbox profile with platform privilege-separation fields.
Definition pqssandbox.c:117
The PQS command execution sandbox profile.
Definition pqssandbox.h:96