[36346] in Kerberos
Re: New remctl ACL scheme and execution of external ACL checking
daemon@ATHENA.MIT.EDU (=?windows-1252?Q?R=E9mi_Ferrand?=)
Wed Aug 6 12:01:42 2014
Message-ID: <53E25144.5090809@cc.in2p3.fr>
Date: Wed, 06 Aug 2014 18:01:08 +0200
From: =?windows-1252?Q?R=E9mi_Ferrand?= <remi.ferrand@cc.in2p3.fr>
MIME-Version: 1.0
To: Russ Allbery <eagle@eyrie.org>
In-Reply-To: <53E0FE7B.4020201@cc.in2p3.fr>
Cc: "kerberos@mit.edu" <kerberos@mit.edu>
Content-Type: multipart/mixed; boundary="===============1174826050=="
Errors-To: kerberos-bounces@mit.edu
This is a cryptographically signed message in MIME format.
--===============1174826050==
Content-Type: multipart/signed; protocol="application/pkcs7-signature";
micalg=sha1; boundary="------------ms090103010403020808000201"
This is a cryptographically signed message in MIME format.
--------------ms090103010403020808000201
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
On 05/08/2014 17:55, R=E9mi Ferrand wrote:
> Sorry for the spam, afterwards I realized that this was more=20
> appropriate to open a new thread for this very subject.
>
> Regards
>
> R=E9mi
>
>
> On 17/07/2014 14:22, R=E9mi Ferrand wrote:
>>
>> * REMCTL-8: Add support for external ACL checking programs. If the
>> program exits with a zero status, access is granted. If it exits 1,
>> access is not granted but checking continues. If it exits with any
>> other exit status, access is not granted and checking aborts. Ideally,=
>> for writing generic ACL checking programs, the program should get the
>> type and service of the remctl command as well as any arguments.
>> However, it would also be good to support passing other arguments into=
>> the program as specified in the ACL file.
>>
>
> I've started to think about this feature and I think that this could=20
> be a great enhancement to be able to access to requested command,=20
> subcommand and args in the "acl_check_" functions (I guess that by=20
> "type and service of the remctl command as well as any arguments" you=20
> meant "command, subcommand and args", didn't you ?)
>
>
> I've created https://github.com/rra/remctl/pull/2 as a proposal but=20
> this could be a little "na=EFve" since it was very straightforward.
> This should be more considered as a "discussion starter" about how to=20
> grant access to command, subcommand and args to "acl_check_" functions.=
>
Using my previous patch I've created a "first version" of the external=20
acl checking support here :=20
https://github.com/ccin2p3/remctl/commit/fefb9f7820961bfef8f98dee8256bd4d=
86e19b47.
Same as my previous patch, this commit should be considered as a way to=20
initiate a discussion about how this external ACL checking support=20
should be implemented.
>
> Talking about the support for external ACL checking programs,
> for now my idea is to have a configuration line like:
>
>
> testcmd ALL /usr/bin/myprogram.pl exec_extra_arg=3D"--arg1 --arg2=20
> --arg-with-value=3D'foo'" exec:/path/to/acl_checking_command.pl
>
>
> with the new "exec" (or something like this) ACL scheme that would=20
> execute the external program "/path/to/acl_checking_command.pl" and=20
> check for its return code to allow/deny access or continue ACL=20
> processing.
>
>
> My idea was that the program "/path/to/acl_checking_command.pl" would=20
> always receive those arguments:
>
> --user=3D"remote user authenticated throw gssapi"
> --command=3D"requested command"
> --subcommand=3D"requested subcommand" (if subcommand is not NULL)
>
> (people that, in the future, would write external validation scripts=20
> MUST support those options)
This is not the way I finally choose:
* To propagate command, subcommand and user ... I've used environment as =
that's done in "server/process.c".
* Remote user supplied arguments are passed as arguments to the external =
ACL checking program.
For the special case where STDIN should be used with the *stdin* option, =
my idea was to supply STDIN to the external ACL checking program (as it=20
would be done to the final program) ... this could allow very deep=20
inspection about what is passed to the final program.
>
>
> and if option "exec_extra_arg" is used in configurationn file, then=20
> those extra arguments should be appended to previous mandatory ones,=20
> which could lead to the final execution of
>
The main problem I have is about supplying extra arguments in the=20
remctld configuration file ...
If I create a new option "exec_extra_arg", this will be a problem when=20
there will be multiple ACL that uses "exec" in the same rule, as in:
testcmd ALL /usr/bin/myprogram.pl exec_extra_arg=3D"--arg1 --arg2"=20
exec:/path/to/acl_checking_command.pl=20
exec:/path/to/other/acl_checking_command.pl
For now, I couldn't find a good way to specify those extra arguments, if =
anyone has an idea about it, just say it :-)
Cheers
R=E9mi
--------------ms090103010403020808000201
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/M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Ib3DQEJBTEPFw0xNDA4MDYxNjAxMDhaMCMGCSqGSIb3DQEJBDEWBBRo
CZzF/O6Ru+jszBr9eKXuvkAhKjBKBgkrBgEEAYI3EAQxPTA7MDUxCzAJBgNVBAYTAkZSMQ0w
CwYDVQQKEwRDTlJTMRcwFQYDVQQDEw5DTlJTMi1TdGFuZGFyZAICdxcwTAYLKoZIhvcNAQkQ
AgsxPaA7MDUxCzAJBgNVBAYTAkZSMQ0wCwYDVQQKEwRDTlJTMRcwFQYDVQQDEw5DTlJTMi1T
dGFuZGFyZAICdxcwbAYJKoZIhvcNAQkPMV8wXTALBglghkgBZQMEASowCwYJYIZIAWUDBAEC
MAoGCCqGSIb3DQMHMA4GCCqGSIb3DQMCAgIAgDANBggqhkiG9w0DAgIBQDAHBgUrDgMCBzAN
BggqhkiG9w0DAgIBKDANBgkqhkiG9w0BAQEFAASCAQB9voYIL+pO4lpy8C8XbolgilnmkE+v
B+FgxlP4SAwMRQQwsUvZNGIFsNlYDhOM5520dN6S4TVi+f/R0/JWwHcv1NfAr+H+Hcoe5QfR
Oy/CeSg+yuUYg3xHU1B6ezVu4h9ROQH+Xz/YwPVeKmhvuNuBo24rP4fc8o+5wPcRcxqawXNu
k1Ei9zpwR2OoEWMcD9j3T6dEbwLJJQTq3KdJ0lPm9Fn03qXKXiL3iWZhmFzmdQo8ZzDh8yEX
nPl6waScyYbcA1fECboqyfaKkk/nE1LgPyiUNfLPGPCst0MNGWTNczSyLWinWcOEBZqYaq+n
DTnSKMBpN6NtQ1DgY1hEk1XXAAAAAAAA
--------------ms090103010403020808000201--
--===============1174826050==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
________________________________________________
Kerberos mailing list Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos
--===============1174826050==--