More privileged interfaces for strict aws-gadget snap

The PR using this new interface is fix: manually write value to /proc/sys/net/netfilter/nf_conntrack_max by toabctl · Pull Request #11 · canonical/aws-gadget · GitHub

This request has been added to the queue for review by the @reviewers team.

+1 (#voteFor) for allowing system-files auto-connect for /proc/sys/net/netfilter/nf_conntrack_max given the provided context.

@elisehdy thanks for the review. I had to adjust the interface requirements a bit (add write permissions to /proc/sys/net/ipv4/neigh/default/gc_thresh2 and /proc/sys/net/ipv4/neigh/default/gc_thresh3). could you have another look please?

Hey @toabctl

I think that network-control interface should be used instead. Any particular concern?

How would that look like (in snapcraft.yaml) and how would those settings persists after reboots? Looking at https://snapcraft.io/docs/network-control-interface isn’t very helpful here.

The network-control interface gives your app full write access to dirs underneath /proc/sys/net/ipv4 so it should be sufficient:

If you connected it (either from the gadget, manually or via an approved auto-connect request here in the forum (even via this thread)), the access will be persistent …

1 Like

Adjusted the linked PR and the request here.

Thanks a lot for the hints & help!

Thank you for the updates @toabctl! Looking at the PR, does this change mean that write access to /run/mnt/ubuntu-data/system-data/_writable_defaults/etc/sysctl.d/50-aws-gadget.conf can be revoked?

yes, this can be revoked.

1 Like

could I get more votes please?

looks good to me, +1 (#voteFor) from my side for auto-connection of network-control interface to aws-gadget snap

Thanks! +1 (#voteFor) for the modified request, auto-connection for network-control interface for the aws-gadget snap.

Per the interface policy, network-control has been configured for auto-connection: 2 votes in favour after a week. Thanks all!