-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-1945: Metron MPack support for Knox SSO setup #1308
Conversation
# Conflicts: # dependencies_with_url.csv
# Conflicts: # dependencies_with_url.csv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @merrimanr ! Besides a minor hiccup, I was able to spin up and get this working on a multi node cluster fine. Some comments inline.
| def is_metron_knox_installed(params): | ||
| return os.path.isfile(params.metron_knox_installed_flag_file) | ||
|
|
||
| def set_metron_knox_installed(params): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step fails on a multi node install since $METRON_HOME will not be present on a non-Metron node. We need to add a step to create the directory $METRON_HOME/config/zookeeper before updating the metron_knox_installed flag file.
Attached is the from Ambari when restarting Metron Client on a non-Metron node.
restart-metron-client.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked this behavior on a kerberized environment. Here is the folder structure on a node without Metron services:
[root@metron-1 ~]# cd /usr/metron/0.7.0/
[root@metron-1 0.7.0]# ll
total 4
-rwxr-xr-x. 1 metron metron 688 Dec 21 10:18 client_jaas.conf
Restarting Metron Client service is still failing with this error:
raise Fail("Applying %s failed, parent directory %s doesn't exist" % (self.resource, dirname))
resource_management.core.exceptions.Fail: Applying File['/usr/metron/0.7.0/config/zookeeper/../metron_knox_installed'] failed, parent directory /usr/metron/0.7.0/config/zookeeper/.. doesn't exist
The config/zookeeper within $METRON_HOME needs to be created before we write the flag file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @anandsubbu. The latest commit creates this directory if it doesn't already exist.
...bari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json
Show resolved
Hide resolved
...ack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py
Show resolved
Hide resolved
|
When I click in Ambari -> Metron service -> Quick Links -> any of the links, it does not get redirected to the Knox gateway. Does this need to be fixed as well? |
|
I also pushed a commit out that exposes the Knox SSO Token TTL as an Ambari setting and changes the default to 5 minutes. The default was 30 seconds and I can't imagine anyone would ever leave it set to that. Is 5 minutes still too short or should it be expected that an administrator will need to change it? Any thoughts on what this should be? I tested this again in full dev and the TTL setting works as expected. |
|
@anandsubbu as far as I know Quick Links must be changed manually. There is a section in the README explaining this. I believe all feedback has been addressed. Let me know if I missed something. |
I'm fine with 5 min, and I'd probably also take a quick look at a couple other hadoop services to see what they're setting it to. |
|
The only example I can find is the SSO topology that ships with Knox and it's set to 30 seconds. |
|
Just a clarification:
Check for |
|
You're correct. Fortunately it's only the testing instructions that were incorrect. Fixed. |
|
@merrimanr Great job on a big submission. I ran this up in full dev and everything seems to be working properly, including timeouts and logouts. I also see @anandsubbu has put this through its paces in a multi-node deployment, which is great. +1 from me pending the latest Travis build succeeding. You also have a +1 from on #1275, so this feature should be ready to roll. |
|
+1 |
# Conflicts: # metron-interface/metron-alerts/cypress/integration/pcap/pcap.spec.js
# Conflicts: # metron-interface/README.md # metron-interface/metron-rest/src/main/scripts/install_metron_knox.sh
Contributor Comments
This PR is based on #1275 and adds Ambari MPack support for enabling Metron on Knox. This makes the setup process simpler, consisting of only a couple steps.
Changes Included
metron.knox.enabledandmetron.knox.sso.pubkeyproperties to Ambariapp-config.jsonfiles as templates in Ambari so the correct paths can be configured automaticallyTesting
This has been tested in full dev. The setup steps are similar to #1275 but should be substantially simpler with less manual work involved:
Ambari > Metron > Configs > Securityand setKnox Enabledto true. Restart the Metron REST component and it should fail with this error:Change
Knox Enabledback to false and save.Ambari > Hosts > node1and select theInstall clientsoption in the dropdown next to the clients, at the bottom of theComponentssection. This should install the Metron Client.Copy the output of that command and paste to the Ambari setting at
Metron > Configs > Security > Knox SSO Public Key. Change theKnox Enabledsetting right above that to true and save.After REST comes back up Metron should be enabled for Knox. You should be able to follow the instructions in the #1275 description for verifying that SSO is working for all services.
Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html:Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.