Skip to content

Commit

Permalink
feat: enable Dynamic Mute (#7574)
Browse files Browse the repository at this point in the history
feat: New values `EXPLOITATION_FOR_PRIVILEGE_ESCALATION` corresponding to T1068 and `INDICATOR_REMOVAL_FILE_DELETION` corresponding to T1070.004 are added to enum `Technique`
docs: T1068 is added for value `EXPLOITATION_FOR_PRIVILEGE_ESCALATION` and T1070.004 is added for value `INDICATOR_REMOVAL_FILE_DELETION` for enum `Technique
PiperOrigin-RevId: 658541020
Source-Link: googleapis/googleapis@c37b7f0
Source-Link: googleapis/googleapis-gen@2472a8c
Copy-Tag: eyJwIjoiU2VjdXJpdHlDZW50ZXIvLk93bEJvdC55YW1sIiwiaCI6IjI0NzJhOGMwY2QwYTJlOTc1OWFmOGUwNDEzNGJlMDhiNmEzYTVlZDUifQ==

* remove clouddeploy from PHPstan
Co-authored-by: Brent Shaffer <[email protected]>
  • Loading branch information
gcf-owl-bot[bot] and bshaffer authored Aug 2, 2024
1 parent f295a46 commit d177015
Show file tree
Hide file tree
Showing 59 changed files with 974 additions and 372 deletions.
8 changes: 4 additions & 4 deletions SecurityCenter/metadata/V2/BigqueryExport.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified SecurityCenter/metadata/V2/Finding.php
Binary file not shown.
Binary file modified SecurityCenter/metadata/V2/MitreAttack.php
Binary file not shown.
Binary file modified SecurityCenter/metadata/V2/MuteConfig.php
Binary file not shown.
Binary file modified SecurityCenter/metadata/V2/NotificationConfig.php
Binary file not shown.
Binary file modified SecurityCenter/metadata/V2/ResourceValueConfig.php
Binary file not shown.
Binary file modified SecurityCenter/metadata/V2/SecuritycenterService.php
Binary file not shown.
Binary file modified SecurityCenter/metadata/V2/Vulnerability.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,22 @@
* Creates a ResourceValueConfig for an organization. Maps user's tags to
* difference resource values for use by the attack path simulation.
*
* @param string $formattedParent Resource name of the new ResourceValueConfig's parent.
* The parent field in the CreateResourceValueConfigRequest
* messages must either be empty or match this field. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $formattedRequestsParent Resource name of the new ResourceValueConfig's parent. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $requestsResourceValueConfigTagValuesElement Tag values combined with <code>AND</code> to check against.
* Values in the form "tagValues/123"
* Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
* https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
* @param string $formattedParent Resource name of the new ResourceValueConfig's parent.
* The parent field in the CreateResourceValueConfigRequest
* messages must either be empty or match this field. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $formattedRequestsParent Resource name of the new ResourceValueConfig's parent. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function batch_create_resource_value_configs_sample(
string $formattedParent,
string $formattedRequestsParent,
string $requestsResourceValueConfigTagValuesElement
string $formattedRequestsParent
): void {
// Create a client.
$securityCenterClient = new SecurityCenterClient();

// Prepare the request message.
$requestsResourceValueConfigTagValues = [$requestsResourceValueConfigTagValuesElement,];
$requestsResourceValueConfig = (new ResourceValueConfig())
->setTagValues($requestsResourceValueConfigTagValues);
$requestsResourceValueConfig = new ResourceValueConfig();
$createResourceValueConfigRequest = (new CreateResourceValueConfigRequest())
->setParent($formattedRequestsParent)
->setResourceValueConfig($requestsResourceValueConfig);
Expand Down Expand Up @@ -91,12 +84,7 @@ function callSample(): void
'[ORGANIZATION]',
'[LOCATION]'
);
$requestsResourceValueConfigTagValuesElement = '[TAG_VALUES]';

batch_create_resource_value_configs_sample(
$formattedParent,
$formattedRequestsParent,
$requestsResourceValueConfigTagValuesElement
);
batch_create_resource_value_configs_sample($formattedParent, $formattedRequestsParent);
}
// [END securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
* Creates a BigQuery export.
*
* @param string $formattedParent The name of the parent resource of the new BigQuery export. Its
* format is "organizations/[organization_id]/locations/[location_id]",
* "folders/[folder_id]/locations/[location_id]", or
* "projects/[project_id]/locations/[location_id]". Please see
* format is `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $bigQueryExportId Unique identifier provided by the client within the parent scope.
* It must consist of only lowercase letters, numbers, and hyphens, must start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
* Creates a mute config.
*
* @param string $formattedParent Resource name of the new mute configs's parent. Its format is
* "organizations/[organization_id]/locations/[location_id]",
* "folders/[folder_id]/locations/[location_id]", or
* "projects/[project_id]/locations/[location_id]". Please see
* `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $muteConfigFilter An expression that defines the filter to apply across
* create/update events of findings. While creating a filter string, be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
* Creates a notification config.
*
* @param string $formattedParent Resource name of the new notification config's parent. Its format
* is "organizations/[organization_id]/locations/[location_id]",
* "folders/[folder_id]/locations/[location_id]", or
* "projects/[project_id]/locations/[location_id]". Please see
* is `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $configId Required.
* Unique identifier provided by the client within the parent scope.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Creates a source.
*
* @param string $formattedParent Resource name of the new source's parent. Its format should be
* "organizations/[organization_id]". Please see
* `organizations/[organization_id]`. Please see
* {@see SecurityCenterClient::organizationName()} for help formatting this field.
*/
function create_source_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* @param string $formattedName The organization name or simulation name of this simulation
*
* Valid format:
* "organizations/{organization}/simulations/latest"
* "organizations/{organization}/simulations/{simulation}"
* `organizations/{organization}/simulations/latest`
* `organizations/{organization}/simulations/{simulation}`
* Please see {@see SecurityCenterClient::simulationName()} for help formatting this field.
*/
function get_simulation_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Gets a source.
*
* @param string $formattedName Relative resource name of the source. Its format is
* "organizations/[organization_id]/source/[source_id]". Please see
* `organizations/[organization_id]/source/[source_id]`. Please see
* {@see SecurityCenterClient::sourceName()} for help formatting this field.
*/
function get_source_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @param string $formattedName The name of this valued resource
*
* Valid format:
* "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}"
* `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
* Please see {@see SecurityCenterClient::valuedResourceName()} for help formatting this field.
*/
function get_valued_resource_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
* @param string $formattedParent Name of parent to list attack paths.
*
* Valid formats:
* "organizations/{organization}",
* "organizations/{organization}/simulations/{simulation}"
* "organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}"
* "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}"
* `organizations/{organization}`,
* `organizations/{organization}/simulations/{simulation}`
* `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
* `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
* Please see {@see SecurityCenterClient::organizationValuedResourceName()} for help formatting this field.
*/
function list_attack_paths_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
* within the folder are returned.
*
* @param string $formattedParent The parent, which owns the collection of BigQuery exports. Its
* format is "organizations/[organization_id]/locations/[location_id]",
* "folders/[folder_id]/locations/[location_id]", or
* "projects/[project_id]/locations/[location_id]". Please see
* format is `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_big_query_exports_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
* global.
*
* @param string $formattedParent The parent, which owns the collection of mute configs. Its format
* is "organizations/[organization_id]", "folders/[folder_id]",
* "projects/[project_id]",
* "organizations/[organization_id]/locations/[location_id]",
* "folders/[folder_id]/locations/[location_id]",
* "projects/[project_id]/locations/[location_id]". Please see
* is `organizations/[organization_id]", "folders/[folder_id]`,
* `projects/[project_id]`,
* `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`,
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_mute_configs_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @param string $formattedParent The parent, which owns the collection of resource value configs.
* Its format is
* "organizations/[organization_id]"
* `organizations/[organization_id]`
* Please see {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_resource_value_configs_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
* Lists all sources belonging to an organization.
*
* @param string $formattedParent Resource name of the parent of sources to list. Its format should
* be "organizations/[organization_id]", "folders/[folder_id]", or
* "projects/[project_id]". Please see
* be `organizations/[organization_id]`, `folders/[folder_id]`, or
* `projects/[project_id]`. Please see
* {@see SecurityCenterClient::projectName()} for help formatting this field.
*/
function list_sources_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* @param string $formattedParent Name of parent to list exposed resources.
*
* Valid formats:
* "organizations/{organization}",
* "organizations/{organization}/simulations/{simulation}"
* "organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}"
* `organizations/{organization}`,
* `organizations/{organization}/simulations/{simulation}`
* `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
* Please see {@see SecurityCenterClient::simulationName()} for help formatting this field.
*/
function list_valued_resources_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@
/**
* Updates an existing ResourceValueConfigs with new rules.
*
* @param string $resourceValueConfigTagValuesElement Tag values combined with <code>AND</code> to check against.
* Values in the form "tagValues/123"
* Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
* https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_resource_value_config_sample(string $resourceValueConfigTagValuesElement): void
function update_resource_value_config_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();

// Prepare the request message.
$resourceValueConfigTagValues = [$resourceValueConfigTagValuesElement,];
$resourceValueConfig = (new ResourceValueConfig())
->setTagValues($resourceValueConfigTagValues);
$resourceValueConfig = new ResourceValueConfig();
$request = (new UpdateResourceValueConfigRequest())
->setResourceValueConfig($resourceValueConfig);

Expand All @@ -57,20 +56,4 @@ function update_resource_value_config_sample(string $resourceValueConfigTagValue
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resourceValueConfigTagValuesElement = '[TAG_VALUES]';

update_resource_value_config_sample($resourceValueConfigTagValuesElement);
}
// [END securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync]
8 changes: 4 additions & 4 deletions SecurityCenter/src/V2/AttackExposure.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d177015

Please sign in to comment.