Apache Falcon provides the following security features:
Server-side configuration properties (i.e. startup.properties) contain passwords and other sensitive information. In addition to specifying properties in plain text, we provide the user an option to use credential provider alias in the property file.
Take SMTP password for example. The user can store the password in a Hadoop credential provider with the alias name SMTPPasswordAlias. In startup.properties where SMTP password is needed, the user can refer to its alias name SMTPPasswordAlias instead of providing the real password.
The alias property to be resolved through Hadoop credential provider should have the format: credential.provider.alias.for.[property-key]. For example, credential.provider.alias.for.falcon.email.smtp.password=SMTPPasswordAlias for SMTP password. Falcon server, during the start, will automatically retrieve the real password provided the alias name.
The user can specify the provider path with the property key credential.provider.path, e.g. credential.provider.path=jceks://file/tmp/test.jceks. If not specified, Falcon will use the default Hadoop credential provider path in core-site.xml.
Apache Falcon enforces authentication on protected resources. Once authentication has been established it sets a signed HTTP Cookie that contains an authentication token with the user name, user principal, authentication type and expiration time.
It does so by using Hadoop Auth. Hadoop Auth is a Java library consisting of a client and a server components to enable Kerberos SPNEGO authentication for HTTP. Hadoop Auth also supports additional authentication mechanisms on the client and the server side via 2 simple interfaces.
Falcon authenticates the user by simply trusting the value of the query string parameter 'user.name'. This is the default mode Falcon is configured with.
Falcon also enforces authorization on Entities using ACLs (Access Control Lists). ACLs are useful for implementing permission requirements and provide a way to set different permissions for specific users or named groups.
By default, support for authorization is disabled and can be enabled in startup.properties.
All Entities now have ACL which needs to be present if authorization is enabled. Only owners who own or created the entity will be allowed to update or delete their entities.
An entity has ACLs (Access Control Lists) that are useful for implementing permission requirements and provide a way to set different permissions for specific users or named groups.
<ACL owner="test-user" group="test-group" permission="*"/>
ACL indicates the Access control list for this cluster. owner is the Owner of this entity. group is the one which has access to read. permission indicates the rwx is not enforced at this time.
The super-user is the user with the same identity as falcon process itself. Loosely, if you started the falcon, then you are the super-user. The super-user can do anything in that permissions checks never fail for the super-user. There is no persistent notion of who was the super-user; when the falcon is started the process identity determines who is the super-user for now. The Falcon super-user does not have to be the super-user of the falcon host, nor is it necessary that all clusters have the same super-user. Also, an experimenter running Falcon on a personal workstation, conveniently becomes that installation's super-user without any configuration.
Falcon also allows users to configure a super user group and allows users belonging to this group to be a super user.
ACL owner and group must be valid even if the authenticated user is a super-user.
Once a user has been authenticated and a username has been determined, the list of groups is determined by a group mapping service, configured by the hadoop.security.group.mapping property in Hadoop. The default implementation, org.apache.hadoop.security.ShellBasedUnixGroupsMapping, will shell out to the Unix bash -c groups command to resolve a list of groups for a user.
Note that Falcon stores the user and group of an Entity as strings; there is no conversion from user and group identity numbers as is conventional in Unix.
The only limitation is that a user cannot add a group in ACL that he does not belong to.
Falcon provides a plugin-able provider interface for Authorization. It also ships with a default implementation that enforces the following authorization policy.
Any Feed or Process can refer to a Cluster entity not owned by the Feed or Process owner. Any Process can refer to a Feed entity not owned by the Process owner
The authorization is enforced in the following way:
To authenticate user for REST api calls, user should append "user.name=<username>" to the query.
operations on Entity Resource
Resource | Description | Authorization |
---|---|---|
api/entities/validate/:entity-type | Validate the entity | Owner/Group |
api/entities/submit/:entity-type | Submit the entity | Owner/Group |
api/entities/update/:entity-type/:entity-name | Update the entity | Owner/Group |
api/entities/submitAndSchedule/:entity-type | Submit & Schedule the entity | Owner/Group |
api/entities/schedule/:entity-type/:entity-name | Schedule the entity | Owner/Group |
api/entities/suspend/:entity-type/:entity-name | Suspend the entity | Owner/Group |
api/entities/resume/:entity-type/:entity-name | Resume the entity | Owner/Group |
api/entities/delete/:entity-type/:entity-name | Delete the entity | Owner/Group |
api/entities/status/:entity-type/:entity-name | Get the status of the entity | Owner/Group |
api/entities/definition/:entity-type/:entity-name | Get the definition of the entity | Owner/Group |
api/entities/list/:entity-type?fields=:fields | Get the list of entities | Owner/Group |
api/entities/dependencies/:entity-type/:entity-name | Get the dependencies of the entity | Owner/Group |
Resource | Description | Authorization |
---|---|---|
api/instance/running/:entity-type/:entity-name | List of running instances. | Owner/Group |
api/instance/status/:entity-type/:entity-name | Status of a given instance | Owner/Group |
api/instance/kill/:entity-type/:entity-name | Kill a given instance | Owner/Group |
api/instance/suspend/:entity-type/:entity-name | Suspend a running instance | Owner/Group |
api/instance/resume/:entity-type/:entity-name | Resume a given instance | Owner/Group |
api/instance/rerun/:entity-type/:entity-name | Rerun a given instance | Owner/Group |
api/instance/logs/:entity-type/:entity-name | Get logs of a given instance | Owner/Group |
Only users belonging to admin users or groups have access to this resource. Admin membership is determined by a static configuration parameter.
Resource | Description | Authorization |
---|---|---|
api/admin/version | Get version of the server | No restriction |
api/admin/stack | Get stack of the server | Admin User/Group |
api/admin/config/:config-type | Get configuration information of the server | Admin User/Group |
Lineage is read-only and hence all users can look at lineage for their respective entities. Note: This gap will be fixed in a later release.
# Authentication type must be specified: simple|kerberos *.falcon.authentication.type=kerberos
##### Service Configuration # Indicates the Kerberos principal to be used in Falcon Service. *.falcon.service.authentication.kerberos.principal=falcon/_HOST@EXAMPLE.COM # Location of the keytab file with the credentials for the Service principal. *.falcon.service.authentication.kerberos.keytab=/etc/security/keytabs/falcon.service.keytab # name node principal to talk to config store *.dfs.namenode.kerberos.principal=nn/_HOST@EXAMPLE.COM # Indicates how long (in seconds) falcon authentication token is valid before it has to be renewed. *.falcon.service.authentication.token.validity=86400 ##### SPNEGO Configuration # Authentication type must be specified: simple|kerberos|<class> # org.apache.falcon.security.RemoteUserInHeaderBasedAuthenticationHandler can be used for backwards compatibility *.falcon.http.authentication.type=kerberos # Indicates how long (in seconds) an authentication token is valid before it has to be renewed. *.falcon.http.authentication.token.validity=36000 # The signature secret for signing the authentication tokens. *.falcon.http.authentication.signature.secret=falcon # The domain to use for the HTTP cookie that stores the authentication token. *.falcon.http.authentication.cookie.domain= # Indicates if anonymous requests are allowed when using 'simple' authentication. *.falcon.http.authentication.simple.anonymous.allowed=true # Indicates the Kerberos principal to be used for HTTP endpoint. # The principal MUST start with 'HTTP/' as per Kerberos HTTP SPNEGO specification. *.falcon.http.authentication.kerberos.principal=HTTP/_HOST@EXAMPLE.COM # Location of the keytab file with the credentials for the HTTP principal. *.falcon.http.authentication.kerberos.keytab=/etc/security/keytabs/spnego.service.keytab # The kerberos names rules is to resolve kerberos principal names, refer to Hadoop's KerberosName for more details. *.falcon.http.authentication.kerberos.name.rules=DEFAULT # Comma separated list of black listed users *.falcon.http.authentication.blacklisted.users= # Increase Jetty request buffer size to accommodate the generated Kerberos token *.falcon.jetty.request.buffer.size=16192
##### SPNEGO Configuration # Authentication type must be specified: simple|kerberos|<class> # org.apache.falcon.security.RemoteUserInHeaderBasedAuthenticationHandler can be used for backwards compatibility *.falcon.http.authentication.type=simple # Indicates how long (in seconds) an authentication token is valid before it has to be renewed. *.falcon.http.authentication.token.validity=36000 # The signature secret for signing the authentication tokens. *.falcon.http.authentication.signature.secret=falcon # The domain to use for the HTTP cookie that stores the authentication token. *.falcon.http.authentication.cookie.domain= # Indicates if anonymous requests are allowed when using 'simple' authentication. *.falcon.http.authentication.simple.anonymous.allowed=true # Comma separated list of black listed users *.falcon.http.authentication.blacklisted.users=
By default, support for authorization is disabled and specifying ACLs in entities are optional. To enable support for authorization, set falcon.security.authorization.enabled to true in the startup configuration.
# Authorization Enabled flag: false|true *.falcon.security.authorization.enabled=true
Falcon provides a basic implementation for Authorization bundled, org.apache.falcon.security .DefaultFalconAuthorizationProvider. This can be overridden by custom implementations in the startup configuration.
# Authorization Provider Fully Qualified Class Name *.falcon.security.authorization.provider=org.apache.falcon.security.DefaultAuthorizationProvider
Super user group is determined by the configuration:
# The name of the group of super-users *.falcon.security.authorization.superusergroup=falcon
Administrative users are determined by the configuration:
# Admin Users, comma separated users *.falcon.security.authorization.admin.users=falcon,ambari-qa,seetharam
Administrative groups are determined by the configuration:
# Admin Group Membership, comma separated users *.falcon.security.authorization.admin.groups=falcon,testgroup,staff
Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated. Falcon provides an option to prevent CSRF with Hadoop CSRF filter for REST APIs. By default, Falcon CSRF filter is disabled. To enable the support for CSRF prevention, set falcon.security.csrf.enabled to true in the startup configuration. We also provide options to configure custom header and browser user agents.
# CSRF filter enabled flag: false (default) | true *.falcon.security.csrf.enabled=true # Custom header for CSRF filter *.falcon.security.csrf.header=FALCON-CSRF-FILTER # Browser user agents to be filtered *.falcon.security.csrf.browser=^Mozilla.*,^Opera.*
Falcon provides transport level security ensuring data confidentiality and integrity. This is enabled by default for communicating over HTTP between the client and the server.
*.falcon.enableTLS=true *.keystore.file=/path/to/keystore/file *.keystore.password=password
Falcon should be configured to communicate with Prism over TLS in secure mode. Its not enabled by default.
Directory | Location | Owner | Permissions |
---|---|---|---|
Configuration Store | ${config.store.uri} | falcon | 700 |
Cluster Staging Location | ${cluster.staging-location} | falcon | 777 |
Cluster Working Location | ${cluster.working-location} | falcon | 755 |
Shared libs | {cluster.working}/{lib,libext} | falcon | 755 |
Oozie coord/bundle XMLs | ${cluster.staging-location}/workflows/{entity}/{entity-name} | $user | cluster umask |
App logs | ${cluster.staging-location}/workflows/{entity}/{entity-name}/logs | $user | cluster umask |
Entities already scheduled with an earlier version of Falcon are not compatible with this version
Older Falcon clients are backwards compatible wrt Authentication and user information sent as part of the HTTP header, Remote-User is still honoured when the authentication type is configured as below:
*.falcon.http.authentication.type=org.apache.falcon.security.RemoteUserInHeaderBasedAuthenticationHandler
The blacklist users used to have the following super users: hdfs, mapreduce, oozie, and falcon. The list is externalized from code into Startup.properties file and is empty now and needs to be configured specifically in the file.
To initialize the current user for dashboard, user should append query param "user.name=<username>" to the REST api call.
If dashboard user wishes to change the current user, they should do the following.
In Kerberos method, the browser must support HTTP Kerberos SPNEGO.
There is no change in the way the CLI is used. The CLI has been changed to work with the configured authentication method.
Try accessing protected resources using curl. The protected resources are:
$ kinit Please enter the password for venkatesh@LOCALHOST: $ curl http://localhost:15000/api/admin/version $ curl http://localhost:15000/api/admin/version?user.name=venkatesh $ curl --negotiate -u foo -b ~/cookiejar.txt -c ~/cookiejar.txt curl http://localhost:15000/api/admin/version