[Cloud Security] Adding Auth check on API (#186937)

## Summary

This PR addresses the issue where currently only some of our API does
Auth check. All of our API should be doing this. Furthermore we are
adding new API FTR to cover this scenario as well

Notes:
Currently Benchmark related API FTR is blocked by
https://github.com/elastic/kibana/issues/188059
This commit is contained in:
Rickyanto Ang 2024-07-12 14:39:59 -07:00 committed by GitHub
parent 1a920d1301
commit f5fda2ce79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 653 additions and 13 deletions

View file

@ -75,6 +75,8 @@ export const DATA_VIEW_INDEX_PATTERN = 'logs-*';
export const SECURITY_DEFAULT_DATA_VIEW_ID = 'security-solution-default';
export const ALERTS_INDEX_PATTERN = '.alerts-security.alerts-*';
export const CSP_INGEST_TIMESTAMP_PIPELINE = 'cloud_security_posture_add_ingest_timestamp_pipeline';
export const CSP_LATEST_FINDINGS_INGEST_TIMESTAMP_PIPELINE =
'cloud_security_posture_latest_index_add_ingest_timestamp_pipeline';

View file

@ -44,6 +44,9 @@ export const defineBulkActionCspBenchmarkRulesRoute = (router: CspRouter) =>
.post({
access: 'internal',
path: CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH,
options: {
tags: ['access:cloud-security-posture-read'],
},
})
.addVersion(
{

View file

@ -29,6 +29,9 @@ export const defineFindCspBenchmarkRuleRoute = (router: CspRouter) =>
.get({
access: 'internal',
path: FIND_CSP_BENCHMARK_RULE_ROUTE_PATH,
options: {
tags: ['access:cloud-security-posture-read'],
},
})
.addVersion(
{

View file

@ -16,6 +16,9 @@ export const defineGetCspBenchmarkRulesStatesRoute = (router: CspRouter) =>
.get({
access: 'internal',
path: CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH,
options: {
tags: ['access:cloud-security-posture-read'],
},
})
.addVersion(
{

View file

@ -65,6 +65,9 @@ export const defineGetComplianceDashboardRoute = (router: CspRouter) =>
.get({
access: 'internal',
path: STATS_ROUTE_PATH,
options: {
tags: ['access:cloud-security-posture-read'],
},
})
.addVersion(
{

View file

@ -57,6 +57,9 @@ export const defineGetDetectionEngineAlertsStatus = (router: CspRouter) =>
.get({
access: 'internal',
path: GET_DETECTION_RULE_ALERTS_STATUS_PATH,
options: {
tags: ['access:cloud-security-posture-read'],
},
})
.addVersion(
{