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

interfaces/builtin: add dbus interface #1613

Merged
merged 111 commits into from Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from 101 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
a289901
interfaces: add preliminary dbus-bind (TODO: attributes)
Jun 22, 2016
94736b4
implement SanitizeSlot with tests
Jun 23, 2016
57fb199
perform substitutions in PermanentSlotAppArmor policy
Jun 23, 2016
8b7e9f3
Merge remote-tracking branch 'upstream/master' into dbus-bind
Jun 23, 2016
98c39de
update comments and documentation
Jun 23, 2016
413e19c
Merge remote-tracking branch 'upstream/master' into dbus-bind
Jun 24, 2016
a624250
update receive and send rules for talking with dbus-daemon
Jun 27, 2016
34dd46f
add connected plug and connected slot policy. improve tests
Jun 27, 2016
eb2d79b
Merge remote-tracking branch 'upstream/master' into dbus-bind
Jun 27, 2016
2345399
add interfaces.SecurityMount to PermanentSlotSnippet
Jun 27, 2016
969be86
BROKEN TEST BRANCH
Jun 28, 2016
b743fe7
revert last commit
Jun 28, 2016
af16d22
Merge remote-tracking branch 'upstream/master' into dbus-bind
Jun 28, 2016
2f73a16
start conversion to proposed yaml
Jun 28, 2016
24fd251
update SanitizeSlot and tests for getBusNames()
Jun 28, 2016
12721f0
remove dbusBindBusNames, iterate through names for policy (TODO: clea…
Jun 29, 2016
0a62fc2
abstract out shared and individual dbus name rules, fix testsuite
Jun 29, 2016
a978d37
update TestPermanentSlotAppArmorSystem() to test abstraction
Jun 29, 2016
22aeba5
abstract out AppArmor abstraction calculation
Jun 29, 2016
6a865ce
abstract out individual policy generation to getAppArmorIndividualSni…
Jun 29, 2016
4861623
update comments and shuffle code around
Jun 29, 2016
a6af67f
update docs, implement plugs, refactor tests, add tests
Jun 29, 2016
ab91e06
Merge remote-tracking branch 'upstream/master' into dbus-bind
Jun 29, 2016
c2da833
add Introspectable policy
Jun 29, 2016
7954f99
go fmt changes
Jun 29, 2016
ce961f0
fix a couple typos and a the mocked test yaml
Jun 29, 2016
11d768c
ensure that connections specify the same bus and name
Jun 29, 2016
4915bd9
non-existent plug should skip. non-existent slot should error
Jun 29, 2016
28577f9
don't autoconnect
Jun 29, 2016
26b8e2e
Merge remote-tracking branch 'upstream/master' into dbus-bind
Jun 30, 2016
fa105bd
fix copy and waste in auto connect test
Jun 30, 2016
1d0019b
Merge remote-tracking branch 'upstream/master' into dbus-bind
Aug 1, 2016
0e80dfc
add dbus-app interface (LP: #1590679)
Aug 1, 2016
dcbcce7
remove some plugs yaml in tests
Aug 1, 2016
bee2592
update docs/interfaces.md for dbus-bind/dbus-app and new implementation
Aug 1, 2016
4d72745
make getBusNames() private
Aug 1, 2016
eba49a1
improve documentation with some example yaml
Aug 1, 2016
52104cc
remove commented out test for plug connection; we don't support it yet
Aug 3, 2016
a8b34ce
add comment for AutoConnect
Aug 3, 2016
63fe8cb
remove unused function that carried over from dbus-bind exploratory PR
Aug 3, 2016
7392e2a
small code cleanup suggested by mvo
Aug 3, 2016
6ded192
Merge remote-tracking branch 'upstream/master' into dbus-app
Aug 3, 2016
70b21d2
Merge remote-tracking branch 'upstream/master' into dbus-app
Sep 13, 2016
e0618e5
change policy 'var's to 'const' as per the new guidelines for interfa…
Sep 15, 2016
da0cb81
Merge remote-tracking branch 'upstream/master' into dbus-app
Sep 21, 2016
843c02a
update for ErrUnknownSecurity, TestUnused and TestUnknown tests
Sep 21, 2016
64c83c4
Merge remote-tracking branch 'upstream/master' into dbus-app
Sep 22, 2016
d6f9443
use '%q' instead of '%s' in fmt.Errof()
Sep 22, 2016
8023baf
move DBus bus name checks into ValidateDBusBusName() in core.go
Sep 22, 2016
dfc1eed
clarify comment in getAppArmorIndividualSnippet()
Sep 22, 2016
c6d7b62
Merge remote-tracking branch 'upstream/master' into dbus-app
Oct 16, 2016
0548657
update for new AutoConnect, LegacyAutoConnect and remove test
Oct 16, 2016
5126c3d
add dbus-app to base declaration
Oct 16, 2016
45772dc
adjust whitespace in docs/interfaces.md
Oct 16, 2016
caf636d
Merge remote-tracking branch 'upstream/master' into dbus-app
Oct 18, 2016
b2cc5e0
Merge remote-tracking branch 'upstream/master' into dbus-app
Nov 2, 2016
a2b8070
dbus-app should use 'deny-auto-connection: true'
Nov 2, 2016
d24897f
Merge remote-tracking branch 'upstream/master' into dbus-app
Nov 4, 2016
7ce23c9
Merge remote-tracking branch 'upstream/master' into dbus-app
Nov 17, 2016
4554657
rename as 'dbus'
Nov 17, 2016
7622c70
update basedeclaration and tests
Nov 17, 2016
9e2fa01
update attributes for new design
Nov 17, 2016
3533d68
adjust error string in ValidateDBusBusName() for clarity
Nov 17, 2016
cc1360b
move the helper get* functions above where they are first used
Nov 17, 2016
712cc6c
rename test names to reflect what they are reflecting now
Nov 18, 2016
df86460
implement ConnectedSlot policy, various small cleanups
Nov 18, 2016
755d0df
implement ConnectedPlug policy
Nov 18, 2016
3b77d40
move some code so that it flows in the same way organizationally
Nov 18, 2016
2b35752
add missing TestUsedSecuritySystems tests
Nov 18, 2016
0203c11
assign to bus and name after verifying val
Nov 18, 2016
d745963
various minor cleanups
Nov 18, 2016
6fe33cd
one more cleanup
Nov 18, 2016
3930158
go fmt fixes
Nov 18, 2016
52f9ebe
Merge remote-tracking branch 'upstream/master' into dbus-app
Nov 18, 2016
e518e1e
only connect matching attributes
Nov 18, 2016
528cdc1
add a few unconfined rules for introspection and fine-tune connection…
Nov 21, 2016
33a8b29
update testsuite for last commit
Nov 21, 2016
b2c3366
use ###DBUS_INTROSPECT_PATH### for introspection rule
Nov 21, 2016
0224642
update a few comments for clarity
Nov 21, 2016
122e1e0
Merge remote-tracking branch 'upstream/master' into dbus-app
Nov 21, 2016
3a65f1c
go fmt for last commit
Nov 21, 2016
17c0b2a
clarify comment for ###DBUS_PATH### rules
Nov 21, 2016
be0ab2b
one more clarifying comment
Nov 21, 2016
cef1975
support KDE's use of 'well-known' names
Nov 22, 2016
74fdc0d
adjust tests to not end with '-[0-9]+'
Nov 22, 2016
7344b6d
don't allow bus names to end with -[0-9]+
Nov 22, 2016
66b7ce6
adjust introspection rules for KDE applications
Nov 22, 2016
68b4ca0
fine-tune the pid alternation with something equivalent but prettier
Nov 22, 2016
72a1529
leave ValidateDBusBusName() as DBus validator and move snapd check to…
Nov 22, 2016
06cc998
address review feedback from niemeyer for getAttribs()
Nov 22, 2016
269da61
remove old comment that doesn't apply any more
Nov 22, 2016
486e07c
don't hard-code bus=system with registration rules
Nov 22, 2016
f5ba68f
also add abstraction to ConnectedPlug policy
Nov 22, 2016
7569e32
fix testsuite for last commit
Nov 23, 2016
3bb7e6e
add DBus security backend for system bus policy
Nov 23, 2016
f7f6840
change default context for dbus bus policy to allow for non-root
Nov 23, 2016
cc668af
Merge remote-tracking branch 'upstream/master' into dbus-app
Dec 5, 2016
7c36dc7
allow plugging side to connect to anything on the slot side via well-…
Dec 6, 2016
d9550f2
Merge remote-tracking branch 'upstream/master' into dbus-app
Dec 8, 2016
b9bc03e
Merge remote-tracking branch 'upstream/master' into dbus-app
Dec 12, 2016
316b439
Merge remote-tracking branch 'upstream/master' into dbus-app
Dec 12, 2016
a372d97
address feedback from tyhicks (thanks!) regarding comments
Dec 13, 2016
0ea491d
fix testsuite for last commit
Dec 13, 2016
d9a1dce
remove redundant checks (thanks pedronis)
Dec 13, 2016
38b3feb
simplify pathBuf (thanks pedronis)
Dec 13, 2016
bb7cc54
add TODO for using interface/policy checkers (thanks pedronis)
Dec 13, 2016
b070992
remove 'send' with classic policy and clarify comments (thanks tyhicks)
Dec 13, 2016
3f5acbf
update parser error with peer=(name=... for KDE plug rule
Dec 13, 2016
ead951b
update the comment for attributes not matching to be more clear
Dec 13, 2016
758cda9
Merge remote-tracking branch 'upstream/master' into dbus-app
Dec 14, 2016
50e6cf1
dbusPermanentSlotAppArmor: allow GetConnectionCredentials (thanks jhe…
Dec 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions interfaces/builtin/all.go
Expand Up @@ -28,6 +28,7 @@ var allInterfaces = []interfaces.Interface{
&BoolFileInterface{},
&BrowserSupportInterface{},
&ContentInterface{},
&DbusInterface{},
&DockerInterface{},
&DockerSupportInterface{},
&FwupdInterface{},
Expand Down
1 change: 1 addition & 0 deletions interfaces/builtin/all_test.go
Expand Up @@ -35,6 +35,7 @@ func (s *AllSuite) TestInterfaces(c *C) {
c.Check(all, Contains, &builtin.BluezInterface{})
c.Check(all, Contains, &builtin.BoolFileInterface{})
c.Check(all, Contains, &builtin.BrowserSupportInterface{})
c.Check(all, Contains, &builtin.DbusInterface{})
c.Check(all, Contains, &builtin.DockerInterface{})
c.Check(all, Contains, &builtin.DockerSupportInterface{})
c.Check(all, Contains, &builtin.FwupdInterface{})
Expand Down
8 changes: 8 additions & 0 deletions interfaces/builtin/basedeclaration.go
Expand Up @@ -203,6 +203,14 @@ slots:
slot-snap-type:
- core
deny-auto-connection: true
dbus:
allow-installation:
slot-snap-type:
- app
deny-connection:
slot-attributes:
name: .+
deny-auto-connection: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the denials here? This will prevent people from using the interface altogether until explicitly allowed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I thought we agreed that people would need to have their well-known dbus name approved in the store. This will trigger a manual review and enforce the use of a snap declaration to claim the well-known name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it doesn't prevent them from using the interface-- they can install a snap that slots this interface and get the bind rules needed to run; it is just that you can't connect other snaps to this interface until a snap declaration is present.

I think this is the right approach for this interface and others in general, but it sheds a light on a developer pain point as described in https://bugs.launchpad.net/snappy/+bug/1640874. I think this is perhaps solved by a locally signed snap declaration, but that needs your input (see my comments in the bug).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd indeed not auto-connect it, but is there a reason to disable the manual connection altogether? This would be the user manually establishing the allowance for dbus communication between two separate snaps, over a well defined API. I can't quite see why we'd reject this yet.

Copy link
Author

@jdstrand jdstrand Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We reject it because the snap has not claimed the name via the store and doesn't yet have a snap declaration. On initial upload with using this interface, the reviewer will issue a snap declaration that allows the connection, and then all is well for connections and subsequent uploads. I think this is in line with everything we've discussed regarding the base declaration and snap declarations-- slot implementations (typically) need some sort of snap declaration since they (typically) allow privileged access to the system. In this case the privilege is to claim a well-known name.

On a related note, the review tools are now considering the base declaration and prompting for manual review due to this constraint. If we remove the constraint today, the tools would let this through without prompting for manual review. If we decide that the constraint should not be there, then the tools will have to be modified to prompt for manual review based on factors outside of the base declaration for an interface review (which is totally doable, but I thought one goal of the base declaration was to be the one place the review tools would consult for how interface reviews should be performed).

dcdbas-control:
allow-installation:
slot-snap-type:
Expand Down
1 change: 1 addition & 0 deletions interfaces/builtin/basedeclaration_test.go
Expand Up @@ -349,6 +349,7 @@ var (
"bool-file": {"core", "gadget"},
"browser-support": {"core"},
"content": {"app", "gadget"},
"dbus": {"app"},
"docker-support": {"core"},
"fwupd": {"app"},
"gpio": {"core", "gadget"},
Expand Down