Skip to content
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

Integrate a mat2 plugin into Files to protect users from accidental metadata leakage? #1030

Open
4jNsY6fCVqZv opened this issue Aug 17, 2019 · 40 comments
Labels
Needs Design Waiting for input from the UX team

Comments

@4jNsY6fCVqZv
Copy link

4jNsY6fCVqZv commented Aug 17, 2019

mat2 is a metadata removal tool, supporting a wide range of commonly used file formats, written in python3: at its core, it's a library, used by an eponymous command-line interface, and a nautilus extension

MAT in version 1, for example, is a fixed component of Tails.
https://tails.boum.org/blueprint/doc/mat/

The development of mat2 takes place here
https://0xacab.org/jvoisin/mat2

Since I see the motivation of elementary OS to protect its users in the best possible way, I want to put this integration up for discussion.

And if there is already a Nautilus extension, doesn't it also make sense to integrate mat2 into Files in the sense of a secure handling of data as well?

@4jNsY6fCVqZv 4jNsY6fCVqZv changed the title Please integrate a mat2 plugin into Files Please integrate a mat2 plugin into Files to protect users from accidental metadata leakage Aug 17, 2019
@4jNsY6fCVqZv 4jNsY6fCVqZv changed the title Please integrate a mat2 plugin into Files to protect users from accidental metadata leakage Integrate a mat2 plugin into Files to protect users from accidental metadata leakage? Aug 17, 2019
@jeremypw
Copy link
Collaborator

I am not familiar with this package but it looks like it could also be used via the existing contractor plugin if a suitable contractor file were supplied. However, this package does not appear in the elementary (or ubuntu) repository afaict which is a problem.

@jeremypw
Copy link
Collaborator

Information on how to install it and an example of a suitable contractor file could be added to the Files wiki as a first step.

@4jNsY6fCVqZv
Copy link
Author

It's already part of Disco.
https://packages.ubuntu.com/disco/mat2
Is elementary OS not yet in the new development cycle?
Where do you see the problem?

@4jNsY6fCVqZv
Copy link
Author

Can you guide me on my way to a mat2 plugin for Files? I really want to get involved in contributing code and not just raise issues ;-)

@jvoisin
Copy link

jvoisin commented Aug 19, 2019

mat2's author here, which is currently packaged in Debian.
Can I do anything on my side to help you integrate mat2 into elementary?

@jeremypw
Copy link
Collaborator

@jvoisin @4jNsY6fCVqZv If you envisage elementary shipping mat2 by default either as a dependency of Files (with a new core plugin) or as a contractor (using the existing contractor plugin) then you need to open a discussion with the elementary project leader (Daniel Foré) first.

You could also develop a third-party package to be added to the elementary AppCenter (as either a free or paid-for app). See https://developer.elementary.io/ for more information. This could supply either an add-on plugin or a contractor file together with the mat2 application itself.

You should probably put together a specification for the UX before deciding on the technical details. If you can open a Files project you could do it there.

Elementary is currently based on Bionic LTS

@4jNsY6fCVqZv
Copy link
Author

@jeremypw @jvoisin When mat2 becomes an integral part of the elementary OS security concept, I would say: Outstanding!

What are the differences between the possible implementation paths in terms of difficulty or amount of work?

How can we open a discussion with Daniel Foré on this question?

The idea for the graphical user interface can be based on the mat2 Nautilus plugin, right? Otherwise it can be based on the other existing plugins for Files?

@jeremypw jeremypw added the Needs Design Waiting for input from the UX team label Aug 21, 2019
@jeremypw
Copy link
Collaborator

@4jNsY6fCVqZv I am not currently familiar with the existing mat2 plugin but any new plugin would have to use the existing Files plugin architecture and comply with the HIG https://elementary.io/docs/human-interface-guidelines#human-interface-guidelines. Using a contractor file is by far the simplest solution but this just adds a context menu item which launches the mat2 app with the selected file(s) as commandline parameters. If a more complex UX is required then a custom plugin would have to be supplied and installed in the Files plugin directory. There is only one optional plugin at the moment - for dropbox - and this has not been worked on for some time so the code is old (still in C) and so not an ideal example (see https://github.com/elementary/files/tree/dropbox-plugin). A new plugin would need to be written in Vala and built with meson. It should be based on the abstract plugin class (https://github.com/elementary/files/blob/master/libcore/Plugin.vala). I'll bring this to Dan's attention.

@jeremypw
Copy link
Collaborator

Looking at the mat2 homepage, it looks like a simple contractor file (just a few lines) would be enough to perform a default metadata removal from the selected file(s). It would not allow the user to e.g. select complete or partial removal however. What functionality does the Nautilus plugin provide?

@danirabbit
Copy link
Member

This seems pretty niche to me and the potential for users to accidentally lose data without understanding what they're doing seems high. My inclination is that editing metadata falls outside the scope of Files and should be left more to specific library implementations like Photos, Music, etc. We have to be careful to tightly scope Files so that it doesn't become a junk drawer of every feature of every app.

My guess would be that if upstream is okay with it, shipping a contractor file there would be the simplest way to add a blanket metadata stripping feature to all of our apps (including Files) in way that makes sure users know what's happening (because they installed it intentionally).

@4jNsY6fCVqZv
Copy link
Author

4jNsY6fCVqZv commented Aug 22, 2019

Hi Daniel, thank you for your supportive thoughts!

To the topic of not cluttering Files: I'm all with you on this one. I also like the idea via Contractor and the accessibility of the tool for all of elementary's apps!

should be left more to specific library implementations like Photos, Music, etc.

How exactly are you technically imagining this?

Do you think it makes sense to integrate such a function into the Switchboard Security & Privacy Plug? If users create new files in photos, music, files, etc., they might want metadata to be deleted directly by default. Similarly, if you don't want a history to be saved or no location to be made public or an automatic housekeeping takes place after x days.

Of course, users must also be able to learn how to deal with this. Maybe the new Onboarding app would be a good help for such a project?

You write " the potential for users to accidentally lose data without understanding what they're doing seems high." Still, with the new installer you're going a way that wants to make full disk encryption the standard, aren't you? I think this will be the first time for many users to set it up manually. I don't know how big the risk is that non-technical people there will lose access to their data. Today this is such an important feature for a safe handling of computers, isn't it? For important features, isn't the question of how to explain it to your users and introduce the feature simply the answer? That is perhaps a different perspective (->"installed it intentionally"), because it also makes users sensitive and empowered, who would otherwise never have asked, because they never thought about the problem of metadata.

What next steps do you suggest?

@jeremypw
Copy link
Collaborator

As I understand it, mat2 creates a new file stripped of metadata and retains the original file - is that right? If so, accidental loss of data is not such a problem. Still, the contractor is the quickest and simplest way to make this available now.

@jeremypw
Copy link
Collaborator

I would say the next step is for a package be put in the AppCenter that supplies mat2 and the necessary contractor file. Otherwise it means waiting for a release of elementary that is based on Disco and even then that package would have to detect elementary and install a contractor file.

@jeremypw
Copy link
Collaborator

More info on writing contractor files can be found here: https://github.com/elementary/contractor in the README

@jvoisin
Copy link

jvoisin commented Aug 22, 2019

Yup, the original file is kept, precisely because mistakes can (and will) happen.

@4jNsY6fCVqZv
Copy link
Author

4jNsY6fCVqZv commented Aug 24, 2019

@jeremypw Thank you for your productive suggestion! How can a package that supports mat2 be added to the current AppCenter? Or do you think it makes more sense to wait for elementary OS to work with Disco or later versions?
@jvoisin Do you have the ability to support this issue in the package deployment and in writing the contractor file?

@jeremypw
Copy link
Collaborator

@4jNsY6fCVqZv Getting an app into AppCenter is fairly straightforward (I have added an app I created). The instructions are available online here https://github.com/elementary/houston/wiki/Before-You-Publish and here https://developer.elementary.io/ . It will a great deal quicker than waiting for the next LTS release, I think.

@4jNsY6fCVqZv
Copy link
Author

https://github.com/elementary/houston/wiki/Before-You-Publish#technical-requirements

-> As I understood, mat2 is not a front-end app, but rather a library. Does a submission make sense anyway? You're probably right. Waiting for the next LTS will take a long time.

@jeremypw
Copy link
Collaborator

There are already libraries showing up in AppCenter (e.g. libnxt) so I don't see why not.

@jvoisin
Copy link

jvoisin commented Aug 26, 2019

mat2 is a library, but a command line interface is provided, as well as a File (nautilus) extension.

I don't plan on writing a contractor any time soon, or maybe even at all, since I don't use elementary, but I'll be more than happy to help anyone who wants to do it.

@jeremypw
Copy link
Collaborator

@jvoisin Writing a contractor file is very simple - its just a few lines - I can help with that if required. It will need to be shipped with a mat2 package for elementaryos though. Whether that is done through AppCenter or otherwise is up to you.

@jeremypw
Copy link
Collaborator

I suppose, it if came to it, I, or someone else, could fork mat2 and do the whole thing.

@jvoisin
Copy link

jvoisin commented Aug 28, 2019

Something like this ?
How do I add an icon?

@jeremypw
Copy link
Collaborator

jeremypw commented Aug 28, 2019 via email

@jvoisin
Copy link

jvoisin commented Aug 29, 2019

Do you need anything else form my side?

@jeremypw
Copy link
Collaborator

@jvoisin Are you interested in creating and submitting a suitable package for the elementary AppCenter? If not, it may be that a 3rd party may be willing to fork mat2 and do so.

@jvoisin
Copy link

jvoisin commented Aug 30, 2019

Since I'm not using elementary at all, I'm not sure that I'll be the best person to maintain a package there…

@jeremypw
Copy link
Collaborator

jeremypw commented Sep 1, 2019

You would need a partition or VM running elementary to check the package installs and Files picks up and runs the contractor file OK. You wouldn't need to use elementary to build the package, Elementary is based on Debian/Ubuntu so knowledge of any such distro would suffice.

@jeremypw
Copy link
Collaborator

jeremypw commented Sep 1, 2019

How much work is involved after release depends on how often new releases are required.

@4jNsY6fCVqZv
Copy link
Author

How do I add an icon?

@jvoisin Have you figured out how to add an icon yet?

@jvoisin
Copy link

jvoisin commented Sep 6, 2019

Here is the contractor:

[Contractor Entry]
Name=mat2
MimeType=application/epub+zip,application/pdf,application/vnd.oasis.opendocument.chart,application/vnd.oasis.opendocument.formula,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.image,application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/x-bittorrent,application/x-dtbncx+xml,application/x-tar,application/xhtml+xml,application/zip,audio/flac,audio/mpeg,audio/ogg,image/gif,image/jpeg,image/png,image/svg+xml,image/tiff,image/x-ms-bmp,text/css,text/html,text/plain,video/mp4,video/x-ms-wmv,video/x-msvideo
Description=Remove metadata from files
Exec=mat2 %f
Icon=mat2.png

But, again, I'll be happy to help anyone who wants to put this into elementary, but won't do it myself, because since I'm not using elementary, I don't want to maintain a package in it.

@4jNsY6fCVqZv
Copy link
Author

Aren't the packages for Debian/Ubuntu the same as a package for elementary OS? Because then there is no additional effort, is there?

@jeremypw
Copy link
Collaborator

jeremypw commented Sep 9, 2019

@4jNsY6fCVqZv While many Debian/Ubuntu packages will install and run OK on elementary, if you want to integrate with the elementary desktop (pantheon), window manager (gala) or one of the elementary apps (e.g. Files) then a modified package would be required. In this case the package would just have to include the contractor file and install it in the right place, so the modifications are fairly small. It would be possible to have a hybrid package that detects which OS it is being installed on and act accordingly but either way a certain amount of extra maintenance work is required.

@jeremypw jeremypw mentioned this issue Sep 9, 2019
@4jNsY6fCVqZv
Copy link
Author

@jvoisin Can you imagine some kind of hybrid package for mat2 like @jeremypw described above?

@jeremypw
Copy link
Collaborator

@jvoisin Elementary Juno is based on Ubuntu 18.04 so the repository contains mat not mat2. What is the difference between these versions? Is there any chance mat2 could be backported to Ubuntu 18.04? I could provide a small AppCenter app which provides a contractor file and other elementary glue, if necessary, but I am unsure whether it is worth it for mat.

@jvoisin
Copy link

jvoisin commented Oct 24, 2019

It seems that mat2 is packaged in Ubuntu (it should be, since it's packaged in debian )

@jeremypw
Copy link
Collaborator

@jvoisin Which version of Ubuntu?

@jvoisin
Copy link

jvoisin commented Oct 25, 2019

Everything is in the first link, versions of Ubuntu, versions of mat2, dates of the updates, …

https://launchpad.net/ubuntu/+source/mat2

@4jNsY6fCVqZv
Copy link
Author

@danrabbit

My guess would be that if upstream is okay with it, shipping a contractor file there would be the simplest way to add a blanket metadata stripping feature to all of our apps (including Files) in way that makes sure users know what's happening (because they installed it intentionally).

I think your idea is very good! @jeremypw and I are however a little irritated because we can't find mat2 in the package sources. Do you have an idea how we can realize your idea together?

@jeremypw
Copy link
Collaborator

I am working on a simple contractor for removing metadata here: https://github.com/jeremypw/mat-wrapper. This is a wrapper for the mat tool as this is the one in the Ubuntu Bionic repository, upon which Elementary OS is currently based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Waiting for input from the UX team
Projects
None yet
Development

No branches or pull requests

4 participants