|
PQS: Post Quantum Shell Protocol 1.1.0.0a (A2)
A quantum secure secure shell protocol
|
PQS command execution sandbox configuration helpers. More...
#include "pqscommon.h"Go to the source code of this file.
Data Structures | |
| struct | pqs_sandbox_profile |
| The PQS command execution sandbox profile. More... | |
Typedefs | |
| typedef PQS_EXPORT_API struct pqs_sandbox_profile | pqs_sandbox_profile |
| The PQS command execution sandbox profile. | |
Functions | |
| PQS_EXPORT_API void | pqs_sandbox_profile_defaults (pqs_sandbox_profile *profile) |
| Initialize a sandbox profile with safe defaults. | |
| 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. | |
| 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. | |
| PQS_EXPORT_API bool | pqs_sandbox_profile_canonicalize_working_directory (pqs_sandbox_profile *profile) |
| Canonicalize the configured sandbox working directory in place. | |
| 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. | |
| 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. | |
| PQS_EXPORT_API bool | pqs_sandbox_working_directory_valid (const pqs_sandbox_profile *profile) |
| Test whether a sandbox profile has a usable working directory. | |
| PQS_EXPORT_API uint32_t | pqs_sandbox_timeout_milliseconds (const pqs_sandbox_profile *profile) |
| Get the command timeout in milliseconds. | |
| PQS_EXPORT_API uint32_t | pqs_sandbox_output_limit_bytes (const pqs_sandbox_profile *profile) |
| Get the configured command-output byte limit. | |
PQS command execution sandbox configuration helpers.
| PQS_EXPORT_API uint32_t pqs_sandbox_output_limit_bytes | ( | const pqs_sandbox_profile * | profile | ) |
Get the configured command-output byte limit.
| profile | [const struct] The sandbox profile. |
| PQS_EXPORT_API bool pqs_sandbox_profile_canonicalize_working_directory | ( | pqs_sandbox_profile * | profile | ) |
Canonicalize the configured sandbox working directory in place.
| profile | [struct] The sandbox profile. |
| 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.
| profile | [struct] The sandbox profile. |
| enabled | [bool] Enables sandbox controls. |
| clear_environment | [bool] Enables minimal environment execution. |
| timeout_seconds | [uint32_t] The command timeout in seconds. |
| working_directory | [const] The confined working directory. |
| 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.
| profile | [struct] The sandbox profile. |
| enabled | [bool] Enables sandbox controls. |
| clear_environment | [bool] Enables minimal environment execution. |
| timeout_seconds | [uint32_t] The command timeout in seconds. |
| working_directory | [const] The confined working directory. |
| run_as_user | [const] The POSIX user name used for privilege drop, or NULL/empty. |
| run_as_group | [const] The POSIX group name used for privilege drop, or NULL/empty. |
| chroot_enabled | [bool] Enables POSIX chroot confinement when the server has the required privilege. |
| PQS_EXPORT_API void pqs_sandbox_profile_defaults | ( | pqs_sandbox_profile * | profile | ) |
Initialize a sandbox profile with safe defaults.
| profile | [struct] The sandbox profile to initialize. |
| 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.
When disabled, POSIX command execution requires an explicit run-as identity. This prevents unconfined same-user command execution from being enabled accidentally. The override may be enabled for development or deliberately single-user deployments.
| profile | [struct] The sandbox profile. |
| allow_same_user | [bool] Enables execution as the server process user when no run-as identity is configured. |
| 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.
| profile | [struct] The sandbox profile. |
| max_output_bytes | [uint32_t] The maximum command-output byte count. |
| PQS_EXPORT_API uint32_t pqs_sandbox_timeout_milliseconds | ( | const pqs_sandbox_profile * | profile | ) |
Get the command timeout in milliseconds.
| profile | [const struct] The sandbox profile. |
| PQS_EXPORT_API bool pqs_sandbox_working_directory_valid | ( | const pqs_sandbox_profile * | profile | ) |
Test whether a sandbox profile has a usable working directory.
| profile | [const struct] The sandbox profile. |