Skip to content

Commit

Permalink
Added tests to Essentials to validate no access to response actions
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Jul 28, 2023
1 parent 3ff3741 commit d55754e
Showing 1 changed file with 14 additions and 1 deletion.
Expand Up @@ -5,9 +5,11 @@
* 2.0.
*/

import { RESPONSE_ACTION_API_COMMANDS_NAMES } from '@kbn/security-solution-plugin/common/endpoint/service/response_actions/constants';
import { login } from '../../../tasks/login';
import { getNoPrivilegesPage } from '../../../screens/endpoint_management/common';
import { getEndpointManagementPageList } from '../../../screens/endpoint_management';
import { ensureResponseActionAuthzAccess } from '../../../tasks/endpoint_management';

describe(
'App Features for Essential PLI',
Expand All @@ -20,9 +22,14 @@ describe(
},
() => {
const pages = getEndpointManagementPageList();
let username: string;
let password: string;

beforeEach(() => {
login();
login('endpoint_operations_analyst').then((response) => {
username = response.username;
password = response.password;
});
});

for (const { url, title } of pages) {
Expand All @@ -31,5 +38,11 @@ describe(
getNoPrivilegesPage().should('exist');
});
}

for (const actionName of RESPONSE_ACTION_API_COMMANDS_NAMES) {
it(`should not allow access to Response Action: ${actionName}`, () => {
ensureResponseActionAuthzAccess('none', actionName, username, password);
});
}
}
);

0 comments on commit d55754e

Please sign in to comment.