<div dir="ltr"><div>" Then install it and use 'snappy hw-assign' to give access to the<br>
device to your snap."<br><br></div>Is that "snappy hw-assign" necessary after every installation?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 30, 2015 at 6:58 PM, Jamie Strandboge <span dir="ltr"><<a href="mailto:jamie@canonical.com" target="_blank">jamie@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/30/2015 12:08 PM, Gábor Paller wrote:<br>
> "This is an old yaml format and the policy vendor and version you are using<br>
> indicate this is from tools from before the 15.04 release (and there was a lot<br>
> of snappy activity prior to release)."<br>
><br>
> I ran the new packaging tool and it generated an apparmor file like this:<br>
> {<br>
>   "template": "default",<br>
>   "policy_groups": [<br>
>     "networking"<br>
>   ],<br>
>   "policy_vendor": "ubuntu-core",<br>
>   "policy_version": 15.04<br>
> }<br>
><br>
> It would be tempting to insert my read_path and write_path statements like<br>
> previously except that the packaging tool always overwrites this file whenever I<br>
> generate the package.<br>
<br>
</span>Right, you aren't specifying the security policy correctly. The json file you<br>
are using is not how security policy is defined and you should be using the<br>
meta/package.yaml file instead and remove the .apparmor files you currently have<br>
(also, this intermediate json file is present for historical reasons and is<br>
currently in the process of being removed).<br>
<br>
Eg:<br>
<br>
<a href="http://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-examples/view/head:/python-xkcd-webserver/meta/package.yaml" rel="noreferrer" target="_blank">http://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-examples/view/head:/python-xkcd-webserver/meta/package.yaml</a><br>
<br>
For your particular case, simply remove any reference to security-* or caps in<br>
your binaries and services section and rebuild the snap. This will give you the<br>
default policy. Then install it and use 'snappy hw-assign' to give access to the<br>
device to your snap.<br>
<span class=""><br>
> It may be the limitation of my mental capabilities but a<br>
> file like this:<br>
> <a href="https://github.com/ubuntu-core/snappy-testdata/blob/master/hello-dbus/package-dir-fwk/meta/svc.apparmor" rel="noreferrer" target="_blank">https://github.com/ubuntu-core/snappy-testdata/blob/master/hello-dbus/package-dir-fwk/meta/svc.apparmor</a><br>
> or this:<br>
> <a href="https://github.com/ubuntu-core/snappy-testdata/blob/master/hello-dbus/package-dir-fwk/meta/svc.seccomp" rel="noreferrer" target="_blank">https://github.com/ubuntu-core/snappy-testdata/blob/master/hello-dbus/package-dir-fwk/meta/svc.seccomp</a><br>
> exceeds what I am capable of.<br>
><br>
> Is there any way to modify somehow the apparmor file that is generated into my<br>
> meta directory and make sure that the packaging tool does not overwrite my changes?<br>
><br>
</span>That isn't how it works for the typical cases (see above) and the URLs you gave<br>
are for framework snaps with hand-crafted policy.<br>
<br>
It seems perhaps you are familiar with the out of date tools and instructions; I<br>
recommend reading up on the latest documentation here:<br>
<br>
<a href="http://developer.ubuntu.com/snappy" rel="noreferrer" target="_blank">http://developer.ubuntu.com/snappy</a><br>
<br>
That should clear a lot of things up. Also, more documentation updates are<br>
pending and should hit the site in the coming weeks.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Jamie Strandboge                 <a href="http://www.ubuntu.com/" rel="noreferrer" target="_blank">http://www.ubuntu.com/</a><br>
<br>
</div></div></blockquote></div><br></div>