-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permit whitelisting VMs for copy/paste & copying logs via tags #533
Changes from 5 commits
956cc10
846105e
38dba62
3951038
d23dd8c
49916a2
a04589a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
- policy: qubes.ClipboardPaste | ||
starts_with: |- | ||
### BEGIN securedrop-workstation ### | ||
@tag:sd-send-app-clipboard sd-app ask | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also think using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can revisit this later, should this be an issue in developer's environment. It should be a small diff that is easily applied on new and existing workstations |
||
sd-app @tag:sd-receive-app-clipboard ask | ||
@anyvm @tag:sd-workstation deny | ||
@tag:sd-workstation @anyvm deny | ||
### END securedrop-workstation ### | ||
|
@@ -15,6 +17,8 @@ | |
- policy: qubes.Filecopy | ||
starts_with: |- | ||
### BEGIN securedrop-workstation ### | ||
sd-log @default ask | ||
sd-log @tag:sd-receive-logs ask | ||
sd-proxy @tag:sd-client allow | ||
@anyvm @tag:sd-workstation deny | ||
@tag:sd-workstation @anyvm deny | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it would make sense to invoke this script/cleanup via
sd-clean-all.sls
? The challenge is that the path in dev environment will be different than the one in staging and production environmentsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that seems like the better way to do it, will poke.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely fold into
clean-salt
, as @emkll suggests. If we use a separate script, then the RPM spec will need to be updated, as well. Consider using the less elegant, but more simplyxargs
-based approach outlined above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RPM spec already picks up the script by wildcard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I would propose is this:
remove-tags
fromscripts
todom0
sd-clean-all.sls
as we do forupdate-xfce-settings
resets.securedrop-admin
andMakefile
.Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eloquence Yes, those steps make sense. Moving the invocation to the salt clean-all state is sound at this point.
Ideally we'd call it from the scripts dir in /usr/share/, but before we can easily do that, we'll need to use the RPM in all environments, including make-dev, as described in #505 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 49916a2, not tested yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested now, seems to work as intended (this is via
securedrop-admin
):