-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #533 from freedomofpress/526-529-copy-paste-and-lo…
…g-rpc Permit whitelisting VMs for copy/paste & copying logs via tags
- Loading branch information
Showing
7 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Removes tags used for exempting VMs from default SecureDrop Workstation | ||
RPC policies from all VMs (including non-SecureDrop ones). | ||
""" | ||
import qubesadmin | ||
|
||
q = qubesadmin.Qubes() | ||
|
||
TAGS_TO_REMOVE = ["sd-send-app-clipboard", "sd-receive-app-clipboard", "sd-receive-logs"] | ||
|
||
|
||
def main(): | ||
tags_removed = False | ||
for vm in q.domains: | ||
for tag in TAGS_TO_REMOVE: | ||
if tag in q.domains[vm].tags: | ||
print("Removing tag '{}' from VM '{}'.".format(tag, vm)) | ||
try: | ||
q.domains[vm].tags.remove(tag) | ||
except Exception as error: | ||
print("Error removing tag: '{}'".format(error)) | ||
print("Aborting.") | ||
exit(1) | ||
tags_removed = True | ||
|
||
if tags_removed is False: | ||
print("Tags {} not set on any VMs, nothing removed.".format(TAGS_TO_REMOVE)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters