summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2017-08-01 21:06:41 +0100
committerRichard Maw <richard.maw@gmail.com>2017-08-01 21:07:07 +0100
commit74e0caadad82422ad41a56845ad323a8f6fb61d2 (patch)
tree70b44417600b536c33adc17dd86cf9ed1edf5254
parentee9bc487e49b20884cb55f86c2c610a8c4ae0279 (diff)
downloadgitano-richardmaw/test-as-auditable.tar.gz
Add yarn to ensure auditability of 'as' userichardmaw/test-as-auditable
-rw-r--r--testing/02-commands-as.yarn15
-rw-r--r--testing/library.yarn4
2 files changed, 19 insertions, 0 deletions
diff --git a/testing/02-commands-as.yarn b/testing/02-commands-as.yarn
index a10d7a4..9ee3aed 100644
--- a/testing/02-commands-as.yarn
+++ b/testing/02-commands-as.yarn
@@ -74,3 +74,18 @@ manages to typo a username, they get a useful error message.
AND stdout is empty
FINALLY the instance is torn down
+
+As well as not leaking information, use of `as` must not thwart auditability,
+so a user with elevated permissions must be able to frame another user.
+
+ SCENARIO Ensuring 'as' does not thwart auditability
+
+ GIVEN a standard instance
+ AND testinstance has keys called other
+ AND testinstance has keys called sneakybackdoor
+ WHEN testinstance, using adminkey, adds user other, using testinstance other
+ AND testinstance uses their ssh public key called sneakybackdoor as stdin
+ AND testinstance adminkey runs as other sshkey add sneakybackdoor
+ AND server-side gitano-admin reads git object HEAD^{commit}
+ THEN stdout contains Added sneakybackdoor for other
+ AND stdout contains committer Administrator
diff --git a/testing/library.yarn b/testing/library.yarn
index f678056..e25f6ac 100644
--- a/testing/library.yarn
+++ b/testing/library.yarn
@@ -106,6 +106,10 @@ Server-side repository checking for behind-the-scenes work
cd "$($GTT serverlocation "$MATCH_1")".git
git fsck
+ IMPLEMENTS WHEN server-side ([^ ]+) reads git object (.+)
+ cd "$($GTT serverlocation "$MATCH_1")".git
+ git cat-file -p "$MATCH_2" >"$DATADIR/stdout" 2>"$DATADIR/stderr"
+
Clone manipulation
------------------