You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Eric Yang (JIRA)" <ji...@apache.org> on 2017/11/17 18:12:01 UTC

[jira] [Comment Edited] (YARN-5673) [Umbrella] Re-write container-executor to improve security, extensibility, and portability

    [ https://issues.apache.org/jira/browse/YARN-5673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16257315#comment-16257315 ] 

Eric Yang edited comment on YARN-5673 at 11/17/17 6:11 PM:
-----------------------------------------------------------

Hi [~miklos.szegedi@cloudera.com] 
4) For clean up container, it *might* require root privileges.  For example, if a docker container is stuck, and we need to clean up forcefully using {{docker rm-f}} as root user or a container runs multi-user code and generate local temp files that can only be cleaned up using privileged user access.  This might be the preferred method for clean up.

5) Some Linux (i.e. SuSE) prevents user to identify which PID is attached to which port unless the checking is using root privileges.  It is also possible a PID file is written and readable by root user only.  This is the reason that we *might* want to give root access to check container process tree and ports allocation.

{quote}
I absolutely agree. However, the tool already does this, does not it?
{quote}

I am inclined to agree that rewrite is not required.  Enhancement and bug fix might be good enough to make this better.  The current messy part is the modularization is based on container type instead of workflow.  There were some logic that could stay in Java land which were converted to C code.  For example, the construction of docker command can be done in Java.  We can pass a list of item to validate, and container-executor report the summary to allow rest of the logic to be computed in Java, then pass to next workflow with Java constructed commands.  This might be one way to make this better without major rewrite.


was (Author: eyang):
Hi [~miklos.szegedi@cloudera.com] 
4) For clean up container, it *might* require root privileges.  For example, if a docker container is stuck, and we need to clean up forcefully using {{docker rm-f}} as root user or a container runs multi-user code and generate local temp files that can only be cleaned up using privileged user access.  This might be the preferred method for clean up.

5) Some Linux (i.e. SuSE) prevents user to identify which PID is attached to which port unless the checking is using root privileges.  It is also possible a PID file is written and readable by root user only.  This is the reason that we *might* want to give root access to check container process tree and ports allocation.

{quote}
I absolutely agree. However, the tool already does this, does not it?
{quote}

Agree, rewrite is not required.  Enhancement and bug fix might be good enough to make this better.

> [Umbrella] Re-write container-executor to improve security, extensibility, and portability
> ------------------------------------------------------------------------------------------
>
>                 Key: YARN-5673
>                 URL: https://issues.apache.org/jira/browse/YARN-5673
>             Project: Hadoop YARN
>          Issue Type: New Feature
>          Components: nodemanager
>            Reporter: Varun Vasudev
>            Assignee: Varun Vasudev
>         Attachments: container-executor Re-write Design Document.pdf
>
>
> As YARN adds support for new features that require administrator privileges(such as support for network throttling and docker), we’ve had to add new capabilities to the container-executor. This has led to a recognition that the current container-executor security features as well as the code could be improved. The current code is fragile and it’s hard to add new features without causing regressions. Some of the improvements that need to be made are -
> *Security*
> Currently the container-executor has limited security features. It relies primarily on the permissions set on the binary but does little additional security beyond that. There are few outstanding issues today -
> - No audit log
> - No way to disable features - network throttling and docker support are built in and there’s no way to turn them off at a container-executor level
> - Code can be improved - a lot of the code switches users back and forth in an arbitrary manner
> - No input validation - the paths, and files provided at invocation are not validated or required to be in some specific location
> - No signing functionality - there is no way to enforce that the binary was invoked by the NM and not by any other process
> *Code Issues*
> The code layout and implementation themselves can be improved. Some issues there are -
> - No support for log levels - everything is logged and this can’t be turned on or off
> - Extremely long set of invocation parameters(specifically during container launch) which makes turning features on or off complicated
> - Poor test coverage - it’s easy to introduce regressions today due to the lack of a proper test setup
> - Duplicate functionality - there is some amount of code duplication
> - Hard to make improvements or add new features due to the issues raised above
> *Portability*
>  - The container-executor mixes platform dependent APIs with platform independent APIs making it hard to run it on multiple platforms. Allowing it to run on multiple platforms also improves the overall code structure .
> One option is to improve the existing container-executor, however it might be easier to start from scratch. That allows existing functionality to be supported until we are ready to switch to the new code.
> This umbrella JIRA is to capture all the work required for the new code. I'm going to work on a design doc for the changes - any suggestions or improvements are welcome.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org