source: examples/access_tests/creddy_prover/s4_run_query @ 11ca336

mei_rt2
Last change on this file since 11ca336 was 2e9455f, checked in by Mei <mei@…>, 11 years ago

1) added namespace
2) tweak ?This,
3) allowing linking role/oset as constraining conditions
4) adding access_tests regression testing that uses GENI's access policy
5) added couple multi contexts regression tests
6) add compression/uncompression calls to abac_encode_string/abac_decode_string
(libstrongwan only allows 512 char for attribute rule storage)
7) add attribute_now option to creddy that takes a whole char string for attribute
rule

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/sh
2
3# geni s4_run_query
4# using aba_prover_yap
5
6echo "=====================s4_run_query=================="
7
8pwd=`pwd`
9
10eloc=`which abac_prover_yap | sed 's/\/abac_prover_yap//'`
11if [ "$eloc" = "" ]; then
12  echo "ERROR: abac_prover_yap is not in the search path!!!"
13  exit 1
14fi
15
16keyloc=$pwd
17
18g=`creddy --keyid --cert $keyloc/G_ID.pem`
19sa=`creddy --keyid --cert $keyloc/SA_ID.pem`
20
21drd=`creddy --keyid --cert $keyloc/Drd_ID.pem`
22frank=`creddy --keyid --cert $keyloc/Frank_ID.pem`
23dan=`creddy --keyid --cert $keyloc/Dan_ID.pem`
24jim=`creddy --keyid --cert $keyloc/Jim_ID.pem`
25nancy=`creddy --keyid --cert $keyloc/Nancy_ID.pem`
26lisa=`creddy --keyid --cert $keyloc/Lisa_ID.pem`
27cary=`creddy --keyid --cert $keyloc/Cary_ID.pem`
28alice=`creddy --keyid --cert $keyloc/Alice_ID.pem`
29
30## dump all credentials
31env ABAC_CN=1 $eloc/abac_prover_yap  --keystore $keyloc --dump s4_creds_dump
32
33#  runControls Cary $cary slice good bad
34runControls() {
35   id=$2 
36   slice="'$3'"
37   role="[keyid:$sa].role:controls_([string:$slice])"
38   prin="[keyid:$id]"
39   echo " "
40   echo "===$4============ SA.controls_($3)<-?-$1"
41   $eloc/abac_prover_yap --keystore $keyloc --role "$role" --principal "$prin"
42
43   role="[keyid:$sa].role:controls([string:$slice])"
44   prin="[keyid:$id]"
45   echo " "
46   echo "===$5============ SA.controls("$3")<-?-$1"
47   $eloc/abac_prover_yap --keystore $keyloc --role "$role" --principal "$prin"
48}
49
50
51## SA.controls_("sliceA") <- Cary
52#[keyid:SA].role:controls_([string:'sliceA']) <-?- [keyid:Cary]
53## SA.controls("sliceA") <- Cary
54#[keyid:SA].role:controls([string:'sliceA']) <-?- [keyid:Cary]
55
56runControls Frank $frank sliceA bad good
57runControls Dan $dan sliceA good good
58runControls Dan $dan sliceB good good
59runControls Jim $jim sliceA bad good
60runControls Nancy $nancy sliceA good good
61runControls Lisa $lisa sliceA bad good
62runControls Cary $cary sliceA bad good
63runControls Alice $alice sliceA good good
64runControls Drd $drd sliceA good good
65
66echo "\n\n"
Note: See TracBrowser for help on using the repository browser.