fix(auth): limit application commands and configuration to admins and read:sensitive tokens

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-10-27 21:19:20 +01:00
co-authored by Claude Opus 5.5
parent efbd64346c
commit eb030c6a22
6 changed files with 258 additions and 23 deletions
+19
View File
@@ -254,6 +254,24 @@ class Application extends BaseModel
protected $appends = ['server_status'];
/**
* Free-form commands and configuration that can embed credentials. Only users who can
* update the application and `read:sensitive` tokens may read them.
*/
public const COMMAND_AND_CONFIGURATION_ATTRIBUTES = [
'install_command',
'build_command',
'start_command',
'pre_deployment_command',
'post_deployment_command',
'health_check_command',
'health_check_response_text',
'custom_docker_run_options',
'docker_compose_custom_start_command',
'docker_compose_custom_build_command',
'custom_nginx_configuration',
];
/**
* Sensitive fields hidden by default in serialized output (toArray/toJson).
* API controllers should call makeVisible([...]) for callers with the
@@ -261,6 +279,7 @@ class Application extends BaseModel
* job, compose generation) must makeVisible explicitly before toArray().
*/
protected $hidden = [
...self::COMMAND_AND_CONFIGURATION_ATTRIBUTES,
'http_basic_auth_password',
'manual_webhook_secret_github',
'manual_webhook_secret_gitlab',