[718ad924] | 1 | |
---|
[9502c50] | 2 | # acme_rockets_rt0_typed |
---|
[da5afdf] | 3 | |
---|
[c469edf] | 4 | pwd=`pwd` |
---|
| 5 | |
---|
[5110d42] | 6 | eloc=${ABAC_PROVER_PATH} |
---|
[34ea038] | 7 | keyloc=$pwd |
---|
[718ad924] | 8 | |
---|
| 9 | acme=`creddy --keyid --cert $keyloc/Acme_ID.pem` |
---|
| 10 | coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem` |
---|
| 11 | |
---|
[da5afdf] | 12 | preferred_customer="[keyid:$acme].role:preferred_customer" |
---|
| 13 | buy_rockets="[keyid:$acme].role:buy_rockets" |
---|
| 14 | coyote_prin="[keyid:$coyote]" |
---|
| 15 | friend="[keyid:$acme].role:friend" |
---|
| 16 | acme_prin="[keyid:$acme]" |
---|
| 17 | |
---|
| 18 | ## dump all credentials |
---|
| 19 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
| 20 | |
---|
[9502c50] | 21 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] |
---|
[718ad924] | 22 | #isMember(pCoyote, role(pAcme,preferred_customer), C). |
---|
| 23 | echo " " |
---|
[9502c50] | 24 | echo "===good============ Acme.preferred_customer <- Coyote" |
---|
[da5afdf] | 25 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 26 | --role "$preferred_customer" --principal "$coyote_prin" |
---|
[718ad924] | 27 | |
---|
[9502c50] | 28 | #[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote] |
---|
[718ad924] | 29 | #isMember(pCoyote, role(pAcme,buy_rockets), C). |
---|
| 30 | echo " " |
---|
[9502c50] | 31 | echo "===good=============== Acme.buy_rockets <- Coyote" |
---|
[da5afdf] | 32 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 33 | --role "$buy_rockets" --principal "$coyote_prin" |
---|
[718ad924] | 34 | |
---|
| 35 | ## this is not suppose to work |
---|
[9502c50] | 36 | #[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer |
---|
[718ad924] | 37 | echo " " |
---|
[9502c50] | 38 | echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer" |
---|
[da5afdf] | 39 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 40 | --role "$buy_rockets" --principal "$preferred_customer" |
---|
[718ad924] | 41 | |
---|
[9502c50] | 42 | #[keyid:Coyote].role:friend <-?- [keyid:Acme] |
---|
[718ad924] | 43 | #isMember(pAcme, role(pCoyote,friend), C). |
---|
| 44 | echo " " |
---|
[9502c50] | 45 | echo "===bad=============== Coyote.friend <- Acme" |
---|
[da5afdf] | 46 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 47 | --role "$friend" --principal "$acme_prin" |
---|
[718ad924] | 48 | |
---|