Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Osquery] Make Osquery All with All base privillege #130523

Merged
merged 10 commits into from
May 17, 2022
1 change: 0 additions & 1 deletion x-pack/plugins/osquery/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const registerFeatures = (features: SetupPlugins['features']) => {
app: [PLUGIN_ID, 'kibana'],
catalogue: [PLUGIN_ID],
order: 2300,
excludeFromBasePrivileges: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an intentional design decision when this feature was introduced in #106669 (cc @patrykkopycinski). I don't remember the full context, but I believe the team wanted to ensure that osquery was explicitly granted to end users, rather than "rolling up" into the preconfigured all/read base privileges.

Altering this behavior has historically been considered a breaking change, and as such cannot be made in a minor release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @legrego thanks for pointing this out :)

I think that the teams consensus (in here: #128768) is that we want to change this.
However, I will forward your concerns to @melissaburpo @patrykkopycinski @james-elastic for a second round of thoughts ;)

IF we decide to still go with the change, how do you suggest going forward with this ? Are you suggesting waiting for post-v8 version?

Big thanks!

Copy link
Member

@legrego legrego Apr 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the teams consensus (in here: #128768) is that we want to change this.

Ok, great!

IF we decide to still go with the change, how do you suggest going forward with this ? Are you suggesting waiting for post-v8 version?

Yes, my recommendation is to wait for the next major version. Otherwise we will grant access to osquery to users who previously didn't have access, and this lack of access may have been done intentionally by an administrator. Granting this additional access simply by upgrading their stack constitutes a "surprise on upgrade", and when it comes to authorization/access controls, that's not a good thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @legrego, apologies for the slow reply on this one. The team wanted to discuss it as a group before getting back to you, and I was out of office for a bit.

We’d like to move forward with this during the 8.x release period, for a couple reasons. 1) After a customer raised this issue, it became clear that the current setting can be experienced as a bug. If an administrator is setting up a user role that has All Kibana access, it would make sense that would apply to Osquery as well. 2) It’s not clear yet what the plans are for 9.x. So if possible, we’d like to fix this sooner rather than later.

While surprising people on upgrade is not ideal, in this case, we would plan to clearly document this change so that people know what to expect. And for full Osquery access, Administrators would still need to take additional steps so that people can use it: to view osquery data, users need Read access to the logs-osquery_manager.result* index, and to use Osquery itself, the Osquery Manager integration must be deployed to Elastic Agents. So while users with All may get access to a new nav item after this change, they wouldn't be able to see any sensitive data without fulfilling the other Osquery requirements.

If it would be easier to discuss this one live, I’m happy to set up a meeting, just let me know. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @melissaburpo, thanks for taking the time to explain your reasoning, and the mitigating factors that are in place to prevent unintended usage of this feature. That makes me feel quite a bit better, but I would like to discuss with @jportner before we proceed. He's on PTO for the next few days, but I'll try to follow up with him towards the end of the week.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi folks, I spoke with Larry about this --
I agree it's not ideal but it's OK to make this particular change.

My one suggestion is to relabel this issue with release_note:fix (instead of release_note:skip) so that we can capture this change in our release notes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legrego @jportner @melissaburpo @patrykkopycinski Given we came to a conclusion here to merge this. Could I get the green light (approvals)? Big, big thanks in advance! :)

privileges: {
all: {
api: [`${PLUGIN_ID}-read`, `${PLUGIN_ID}-write`],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
const expected = mapValues(
uiCapabilities.value!.catalogue,
(enabled, catalogueId) =>
catalogueId !== 'monitoring' &&
catalogueId !== 'osquery' &&
!esFeatureExceptions.includes(catalogueId)
catalogueId !== 'monitoring' && !esFeatureExceptions.includes(catalogueId)
);
expect(uiCapabilities.value!.catalogue).to.eql(expected);
break;
Expand All @@ -69,7 +67,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
'appSearch',
'workplaceSearch',
'spaces',
'osquery',
...esFeatureExceptions,
];
const expected = mapValues(
Expand All @@ -94,7 +91,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
'appSearch',
'workplaceSearch',
'spaces',
'osquery',
...esFeatureExceptions,
];
const expected = mapValues(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
case 'dual_privileges_all at everything_space':
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('navLinks');
expect(uiCapabilities.value!.navLinks).to.eql(
navLinksBuilder.except('monitoring', 'osquery')
);
expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.except('monitoring'));
break;
case 'everything_space_all at everything_space':
case 'global_read at everything_space':
Expand All @@ -57,8 +55,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
'enterpriseSearch',
'enterpriseSearchContent',
'appSearch',
'workplaceSearch',
'osquery'
'workplaceSearch'
)
);
break;
Expand Down