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

[SECURITY_SOLUTION] 145: Advanced Policy Tests #82898

Merged
merged 64 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d4af7e4
Create Policies for each generated host
paul-tavares Aug 3, 2020
9b1ff83
Refactor Ingest setup to also setup Fleet
paul-tavares Aug 3, 2020
915c910
Rename prop name
paul-tavares Aug 3, 2020
9e53c33
Add generic response type to KbnClient.request + support for headers
paul-tavares Aug 3, 2020
3797983
first attempt at adding fleet agent registration
paul-tavares Aug 4, 2020
67425be
a little closer with fleet integration
paul-tavares Aug 4, 2020
3dc453c
SUCCESS. Able to enroll agent and set it to online
paul-tavares Aug 4, 2020
766821b
Merge branch 'master' into task/endpoint-host-data-generator-create-p…
elasticmachine Aug 21, 2020
63f4d1c
update names to be policy
kevinlog Aug 23, 2020
a2297b3
policy generator has advanced types in endpoint confit
parkiino Aug 31, 2020
0889459
linting
jmiller263 Aug 31, 2020
ffd46ef
Merge branch 'task/endpoint-host-data-generator-create-policy' of htt…
jmiller263 Aug 31, 2020
e868b25
flesh out callback
jmiller263 Sep 1, 2020
41cfac0
add submit button for verify_peer
jmiller263 Sep 1, 2020
ba3b90e
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Sep 1, 2020
67b12d2
add verify hostname field
jmiller263 Sep 3, 2020
638dc5f
145 generalize cb
jmiller263 Sep 10, 2020
59c8170
145 fix setAgain and getValue
jmiller263 Sep 10, 2020
98601b2
145 merge conflict
jmiller263 Sep 23, 2020
ff425c8
145 merge conflict
jmiller263 Sep 23, 2020
3726588
145 add verify_hostname back, start loop for form
jmiller263 Sep 23, 2020
0b98114
145 remove OS trick
jmiller263 Sep 28, 2020
201f433
145 make AdvancedPolicyForms its own component
jmiller263 Sep 29, 2020
749c3f3
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Sep 29, 2020
e534356
145 grid partially working
jmiller263 Oct 1, 2020
2c6530e
145 grid partially working
jmiller263 Oct 1, 2020
bda9b8c
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 5, 2020
aa94cda
145 back to basics
jmiller263 Oct 8, 2020
6074d82
145 back to basics
jmiller263 Oct 8, 2020
38574c6
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 8, 2020
9a1a2da
145 rolled back grid
jmiller263 Oct 12, 2020
d0dba21
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 12, 2020
9d36541
145 flex table working
jmiller263 Oct 13, 2020
34adcc9
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 13, 2020
5ecd799
145 undo accidental change
jmiller263 Oct 13, 2020
00dedbb
145 remove extra schema file
jmiller263 Oct 13, 2020
afe40b7
145 remove unused variable
jmiller263 Oct 13, 2020
23238e9
145 kevin's PR feedback
jmiller263 Oct 15, 2020
0bdfa5f
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 15, 2020
bb3174d
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 19, 2020
0c5a577
145 fix type check and jest
jmiller263 Oct 19, 2020
ec0cb65
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 20, 2020
5546c25
145 EuiFlexGroups
jmiller263 Oct 20, 2020
7c79ece
145 use simple EuiFormRow and add show/hide buttons
jmiller263 Oct 21, 2020
b37f2af
145 merge conflicts
jmiller263 Oct 21, 2020
f44601c
145 move all advanced policy code to advanced file; remove unnec test…
jmiller263 Oct 21, 2020
50d799b
145 fix IDs
jmiller263 Oct 21, 2020
8bd1ef6
145 take out unnecessary stuff
jmiller263 Oct 22, 2020
9a6afa0
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 22, 2020
06c3b4d
145 removed a couple more lines
jmiller263 Oct 22, 2020
37cc6a4
145 add some fields back in
jmiller263 Oct 22, 2020
c7054c6
145 add spacer
jmiller263 Oct 22, 2020
946dbc1
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 27, 2020
a55447a
Merge remote-tracking branch 'upstream/master' into task/145_advanced…
jmiller263 Oct 28, 2020
4583915
Merge remote-tracking branch 'upstream/master' into test/145_advanced…
jmiller263 Oct 29, 2020
fc5a77a
145 start tests
jmiller263 Nov 3, 2020
4ea76d9
Merge remote-tracking branch 'upstream/master' into test/145_advanced…
jmiller263 Nov 3, 2020
8839e5f
145 add findAdvancedPolicyButton
jmiller263 Nov 5, 2020
c26cea0
Merge remote-tracking branch 'upstream/master' into test/145_advanced…
jmiller263 Nov 5, 2020
6382a30
145 test passing
jmiller263 Nov 6, 2020
9696182
Merge remote-tracking branch 'upstream/master' into test/145_advanced…
jmiller263 Nov 6, 2020
75df3ee
145 remove comment
jmiller263 Nov 6, 2020
249a4e4
Merge remote-tracking branch 'upstream/master' into test/145_advanced…
jmiller263 Nov 9, 2020
fa4b4c7
Merge branch 'master' into test/145_advanced_policy
kibanamachine Nov 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const AdvancedPolicyForms = React.memo(() => {
/>
</h4>
</EuiText>
<EuiPanel paddingSize="s">
<EuiPanel data-test-subj="advancedPolicyPanel" paddingSize="s">
{AdvancedPolicySchema.map((advancedField, index) => {
const configPath = advancedField.key.split('.');
return (
Expand Down Expand Up @@ -114,7 +114,12 @@ const PolicyAdvanced = React.memo(
</EuiText>
}
>
<EuiFieldText fullWidth value={value as string} onChange={onChange} />
<EuiFieldText
data-test-subj={configPath.join('.')}
fullWidth
value={value as string}
onChange={onChange}
/>
</EuiFormRow>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
policyInfo.packagePolicy.name
);
});

it('and the show advanced settings button is clicked', async () => {
await testSubjects.missingOrFail('advancedPolicyPanel');

let advancedPolicyButton = await pageObjects.policy.findAdvancedPolicyButton();
await advancedPolicyButton.click();

await testSubjects.existOrFail('advancedPolicyPanel');

advancedPolicyButton = await pageObjects.policy.findAdvancedPolicyButton();
await advancedPolicyButton.click();
await testSubjects.missingOrFail('advancedPolicyPanel');
});
});

describe('and the save button is clicked', () => {
Expand Down Expand Up @@ -98,7 +111,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
pageObjects.endpointPageUtils.clickOnEuiCheckbox('policyLinuxEvent_file'),
pageObjects.endpointPageUtils.clickOnEuiCheckbox('policyMacEvent_file'),
]);

const advancedPolicyButton = await pageObjects.policy.findAdvancedPolicyButton();
await advancedPolicyButton.click();

const advancedPolicyField = await pageObjects.policy.findAdvancedPolicyField();
await advancedPolicyField.clearValue();
await advancedPolicyField.click();
await advancedPolicyField.type('true');
await pageObjects.policy.confirmAndSave();

await testSubjects.existOrFail('policyDetailsSuccessMessage');

const agentFullPolicy = await policyTestResources.getFullAgentPolicy(
Expand Down Expand Up @@ -191,6 +213,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
linux: {
events: { file: false, network: true, process: true },
logging: { file: 'info' },
advanced: { agent: { connection_delay: 'true' } },
},
mac: {
events: { file: false, network: true, process: true },
Expand Down
16 changes: 16 additions & 0 deletions x-pack/test/security_solution_endpoint/page_objects/policy_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr
return await testSubjects.find('policyDetailsCancelButton');
},

/**
* Finds and returns the Advanced Policy Show/Hide Button
*/
async findAdvancedPolicyButton() {
await this.ensureIsOnDetailsPage();
return await testSubjects.find('advancedPolicyButton');
},

/**
* Finds and returns the linux connection_delay Advanced Policy field
*/
async findAdvancedPolicyField() {
await this.ensureIsOnDetailsPage();
return await testSubjects.find('linux.advanced.agent.connection_delay');
},

/**
* ensures that the Details Page is the currently display view
*/
Expand Down