You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From a syntax PoV, --working-dir is a global option, supported by all composer commands and as such can (and should) be issued at the beginning of the command-line, before the composer command itself, eg composer --working-dir=... install/require/help ...
On top of that, in some scenarios, putting --working-dir first is actually beneficial:
The --working-directory is a sensitive option, it allows to execute arbitrary PHP-code in that directory. The command itself, not so much
When it comes to either security or audit log, --working-directory= is the option one would either grep, analyze or restrict
In the case of sudoers (but could be for ssh authorized commands, selinux, apparmor, firejail LSM or similar), having the sensitive/variable component at the beginning makes more sense and make things more easy, eg %operator IT = (foo:bar) NOPASSWD /usr/bin/composer --working-dir=restricted *
composer only considers the first occurrence of this option (no possible override)
#3787 is related since it fall into above mentioned case n°1 and fixing both issues with the same modification is possible.
Issue Type
Feature Idea
Component Name
composer
Additional Information
This would be the command line generated by the module /usr/bin/php /usr/bin/composer --working-dir <BAR> <FOO> --no-ansi --no-interaction <BAZ>
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
This module generates suitable command lines relying on the
composer
binary.Typical command-lines look like
/usr/bin/php /usr/bin/composer <FOO> --no-ansi --no-interaction --working-dir <BAR> <BAZ>
Where
command
working_dir
arguments
Considerations
From a syntax PoV,
--working-dir
is a global option, supported by all composer commands and as such can (and should) be issued at the beginning of the command-line, before the composer command itself, egcomposer --working-dir=... install/require/help ...
On top of that, in some scenarios, putting
--working-dir
first is actually beneficial:--working-directory
is a sensitive option, it allows to execute arbitrary PHP-code in that directory. The command itself, not so much--working-directory=
is the option one would eithergrep
, analyze or restrictsudoers
(but could be for sshauthorized commands
,selinux, apparmor, firejail
LSM or similar), having the sensitive/variable component at the beginning makes more sense and make things more easy, eg%operator IT = (foo:bar) NOPASSWD /usr/bin/composer --working-dir=restricted *
composer
only considers the first occurrence of this option (no possible override)#3787 is related since it fall into above mentioned case n°1 and fixing both issues with the same modification is possible.
Issue Type
Feature Idea
Component Name
composer
Additional Information
This would be the command line generated by the module
/usr/bin/php /usr/bin/composer --working-dir <BAR> <FOO> --no-ansi --no-interaction <BAZ>
Code of Conduct
The text was updated successfully, but these errors were encountered: