Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAC][RBAC] Updates integration tests to use subfeature privileges (e…
Browse files Browse the repository at this point in the history
…lastic#18)

* update scripts, adds trial license tests for testing subfeature privilege access

* adds roles and users for testing update alerts as data with subfeature privileges
dhurley14 authored and yctercero committed Jun 30, 2021

Unverified

The email in this signature doesn’t match the committer email.
1 parent 10e819d commit b0d1af1
Showing 11 changed files with 899 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ export class AlertsClient {
})
);

return res.body.get?._source;
return res.body;
} catch (error) {
this.auditLogger?.log(
alertAuditEvent({
6 changes: 3 additions & 3 deletions x-pack/plugins/rule_registry/server/routes/get_alert_by_id.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export const getAlertByIdRoute = (router: IRouter<RacRequestHandlerContext>) =>
),
t.exact(
t.partial({
indexName: t.string,
index: t.string,
})
),
])
@@ -41,8 +41,8 @@ export const getAlertByIdRoute = (router: IRouter<RacRequestHandlerContext>) =>
async (context, request, response) => {
try {
const alertsClient = await context.rac.getAlertsClient();
const { id, indexName } = request.query;
const alert = await alertsClient.get({ id, index: indexName });
const { id, index } = request.query;
const alert = await alertsClient.get({ id, index });
return response.ok({
body: alert,
});
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
set -e

USER=${1:-'observer'}
ID=${2:-'DHEnOXoB8br9Z2X1fq_l'}

cd ./hunter && sh ./post_detections_role.sh && sh ./post_detections_user.sh
cd ../observer && sh ./post_detections_role.sh && sh ./post_detections_user.sh
@@ -18,4 +19,4 @@ cd ..
# Example: ./get_observability_alert.sh hunter
curl -v -k \
-u $USER:changeme \
-X GET "${KIBANA_URL}${SPACE_URL}/api/rac/alerts?id=DUgwMHoB4rQQN4aqv7Co&index=.alerts-observability-apm" | jq .
-X GET "${KIBANA_URL}${SPACE_URL}/api/rac/alerts?id=$ID&index=.alerts-observability-apm" | jq .
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
"feature": {
"ml": ["read"],
"monitoring": ["all"],
"apm": ["all"],
"apm": ["minimal_read", "alerts_all"],
"ruleRegistry": ["all"],
"actions": ["read"],
"builtInAlerts": ["all"],
Original file line number Diff line number Diff line change
@@ -25,4 +25,4 @@ curl -s -k \
-H 'kbn-xsrf: 123' \
-u observer:changeme \
-X POST ${KIBANA_URL}${SPACE_URL}/api/rac/alerts \
-d "{\"ids\": $IDS, \"status\":\"$STATUS\", \"indexName\":\".alerts-observability-apm\"}" | jq .
-d "{\"ids\": $IDS, \"status\":\"$STATUS\", \"index\":\".alerts-observability-apm\"}" | jq .
Loading

0 comments on commit b0d1af1

Please sign in to comment.