Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Commit e41c250

Browse files
committed
Adds drush policy file to restrict sql-sync and rsync to staging server
1 parent b39a244 commit e41c250

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

provision/salt/roots/salt/dosomething.sls

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ drush-aliases:
55
- name: /home/vagrant/.drush/ds.aliases.drushrc.php
66
- source: salt://dosomething/ds.aliases.drushrc.php
77

8+
drush-policy:
9+
file.managed:
10+
- name: /home/vagrant/.drush/policy.drush.inc
11+
- source: salt://dosomething/policy.drush.inc
12+
813
ssh-host-access:
914
file.managed:
1015
- name: /home/vagrant/.ssh/config
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
4+
if ($destination == '@ds.staging') {
5+
return drush_set_error('POLICY_DENY', dt('You cannot overwrite the staging db from here'));
6+
}
7+
}
8+
9+
function drush_policy_core_rsync_validate($source, $destination, $additional_options = array()) {
10+
if ($destination == '@ds.staging') {
11+
return drush_set_error('POLICY_DENY', dt('You cannot overwrite the staging files from here'));
12+
}
13+
}

0 commit comments

Comments
 (0)