Git Product home page Git Product logo

tamarin-prover / tamarin-prover Goto Github PK

View Code? Open in Web Editor NEW
392.0 392.0 126.0 43.32 MB

Main source code repository of the Tamarin prover for security protocol verification.

Home Page: https://tamarin-prover.com/

License: GNU General Public License v3.0

Haskell 86.74% CSS 1.07% JavaScript 2.70% Shell 0.31% Python 6.78% Makefile 1.20% Emacs Lisp 0.12% Dockerfile 0.12% Vim Script 0.43% HTML 0.18% TeX 0.35%

tamarin-prover's Introduction

The Tamarin prover repository

master branch build-status

This README describes the organization of the repository of the Tamarin prover for security protocol verification. Its intended audience are interested users and future developers of the Tamarin prover. For installation and usage instructions of the Tamarin prover see chapter 2 of the manual: https://tamarin-prover.github.io/manual/master/book/002_installation.html

Developing and contributing

See contributing instructions for instructions on how to develop, test and release changes to the Tamarin prover source code.

Version Numbering Policy

We use version numbers with four components.

  • The first component is the major version number. It indicates complete rewrites of the codebase.
  • The second component is the minor version number. We use odd minor version numbers to denote development releases intended for early adopters. We use even minor version numbers to denote public releases, which are also published.
  • The third component indicates bugfix releases.
  • The fourth component indicates documentation and meta-data changes.

We ensure that the external interface of a version of the Tamarin prover is backwards compatible with the external interface of all versions that agree on the major and minor version number.

We announce all releases of the Tamarin prover on: http://tamarin-prover.github.io

Manual

The manual is available as PDF or HTML at https://tamarin-prover.github.io/manual/index.html

Experimental improved graph output

You can use our experimental improved graph output which may be helpful for very large graphs that can be created for complicated protocols. To enable this feature read the instructions about improved graphs.

Spthy code editors

The project contains support for spthy syntax highlighting and support in the etc directory. This includes support for Sublime Text, VIM and Notepad++.

Example Protocol Models

All example protocol models are found in the directory

./examples/

All models that we consider stable are part of every installation of the Tamarin prover. See tamarin-prover.cabal for the list of installed protocols. We use the following sub-directories to organize the models.

accountability/ case studies using the accountability implementation presented in
                the "Verifying Accountability for Unbounded Sets of Participants" paper
csf12/          the AKE case studies from our CSF'12 paper.
classic/        classic security protocols like the ones from
                [SPORE](http://www.lsv.ens-cachan.fr/Software/spore/table.html)
loops/          experiments for testing loop-invariants and protocols with
                non-monotonic state
related_work/   examples from related work on protocols with loops or
                non-monotonic state
experiments/    all other experiments
ake/            more AKE examples including ID-based and tripartite group KE
                protocols based on bilinear pairing
features/       (small) models that demonstrate a given feature
ccs15/	        the observational equivalence case studies from our CCS'15 paper
csf-18/         the XOR case studies from the CSF'18 paper

Feel free to add more sub-directories and describe them here.

In general, we try use descriptive names for files containing the models. We also document all our findings as comments in the protocol model. Moreover, we use the following header in all files to make their context more explicit.

/*
   Protocol:    Example
   Modeler:     Simon Meier, Benedikt Schmidt
   Date:        January 2012

   Status:      working

   Description of protocol.

*/

tamarin-prover's People

Contributors

addap avatar archbung avatar beschmi avatar cascremers avatar cdumenil avatar charlie-j avatar davidbasin avatar dschoop avatar felixlinker avatar felixonmars avatar hong-thai avatar jdreier avatar jwoc avatar katrielalex avatar kevinmorio avatar kmilner avatar lcbh avatar lordqwerty avatar meiersi avatar niklasmedinger avatar philiplukertwork avatar racoucho1u avatar rkunnema avatar rsasse avatar sans-sucre avatar schmidla avatar steve-kremer avatar thomwiggers avatar valentinyuri avatar yavivanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tamarin-prover's Issues

Fix spacing in graph output

We should adapt the space-based indent to the space that is lost due to not using a fixed-width font in the GraphViz output.

Normalize instantiation constants for human parsing

A typical graph contains ~x.313, ~y.444, ~z.236, $R.11. It is cumbersome for a human to match them up and to remember which one he has already seen somewhere else in the graph - and image scrolling is usually necessary.

One solution, which I have also been using in Scyther, is to normalize these numbers when displaying the graphs. In particular:

Let I be the set of 'base' identifiers (in the above: ~x, ~y, ~z, $R).
Let occurs(i) be the set of instances of i in (the displayed part of) the graph.
Let #(i) be the number of instances in (the displayed part of) the graph, e.g. for a graph with occurs(i) = { i.313, i.400, i.600 } we have #(i) = 3.

for all identifiers i in I:
  if #(i) = 1
  then replace occurs(i)[0] by i
  else
    cnt = 1
    for x in occurs(i):
      replace x by 'i.cnt'
      cnt += 1

This would make at least one human happier.

Check CSF examples and add a few more example protocols.

For example JKL_TS3_2008 hardcodes '1' and '2' and it it seems like this should be the sorted identities.

It would also be cool to have some more finished and documented protocol models that we can publish with the tool in order to get our users up to speed more easily. I'm thinking TLS handshake, NSL3, minimal wrapping example with a comment on our future work (induction invariants).

Faster normal-form computation

As indicated by the profiling at the end of February, we spend more than 50% of the proof construction time on normalizing the terms due to our reliance on maude for this task. We should see a large speedup by implementing this functionality directly in Haskell.

Interactive proof HTML should check wether Javascript is enabled/supported

If Tamarin is started in interactive mode, but the browser does not support Javascript, the layout collapses to a mess without warning.

This can occur also for recent browsers with Javascript-disabling extensions (e.g. noscript).

In this case, we should give the user a fair warning instead of letting him guess what the cause of the broken page is.

Update installation instructions to cater for installing 'alex'

i.e., fix the issue noted below.

Yes, this helps. The real cause is that you don't have alex installed, which we can get either via Ubuntu's package repo or via cabal install. I'll add it to the installation instructions.

2012/4/5 Cremers Cas [email protected]:

Hi Simon:

I tried (something) like you suggested:

cas@doekoe:$ cabal install bytestring-lexing --reinstall --flag=reinstalls
Resolving dependencies...
Configuring bytestring-lexing-0.4.0...
cabal: The program alex version >=2.3 is required but it could not be found.
cabal: Error: some packages failed to install:
bytestring-lexing-0.4.0 failed during the configure step. The exception was:
ExitFailure 1
cas@doekoe:
$

Hope this helps,

Cas

On Wed, Apr 4, 2012 at 13:54, Simon Meier [email protected] wrote:

Hi Cas,

thanks for the input.

2012/4/4 Cremers  Cas [email protected]:

Hi guys,

I did a clean install on my Precise Pangolin beta according to the web
page. Here's my experience:

zlib-0.5.3.3 failed during the configure step. The exception was:
ExitFailure 1
zlib-bindings-0.0.3.2 depends on zlib-0.5.3.3 which failed to install.
zlib-conduit-0.2.0.1 depends on zlib-0.5.3.3 which failed to install.
make: *** [install] Error 1

Rereading the webpage, I noticed the fairly hidden dependency on
zlib1g-dev. Why don't we simply add this to the step 1 install line?

Added your fix. This makes sense as zlib1g-dev are external C-header files.

Then, proceeding, I got:

cabal: Error: some packages failed to install:
bytestring-lexing-0.4.0 failed during the configure step. The exception was:
ExitFailure 1
tamarin-prover-0.3.0.0 depends on bytestring-lexing-0.4.0 which failed to
install.
warp-1.1.0.1 depends on bytestring-lexing-0.4.0 which failed to install.
make: *** [install] Error 1

It took me a bit of googling to find I needed:

sudo apt-get install libghc-bytestring-lexing-dev

(a ghc expert might have guessed the prefix)

Hmm, this is strange. You should be able to install bytestring-lexing
using cabal.

Could you check the output of

'cabal install bytestring-lexing --reinstall --force-reinstalls'

Now it works.

So I recommend adding to the step 1 dependencies for ubuntu:

zlib1g-dev
libghc-bytestring-lexing-dev

Also, there is some discrepancy between the README in the sources (at
least in /devel) and the installation instructions on the webpage. I
recommend that we synchronise these as much as possible.

I agree. Noted in the corresponding issue.

Now it compiles and can be started. However,

cas@doekoe:~/src/tamarin-prover$ tamarin-prover --prove -Ocase-studies
+RTS -N -RTS examples/csf12/*.spthy
maude tool: 'maude'
 checking version: 2.6. OK.

analyzing: examples/csf12/Artificial.spthy

tamarin-prover: case-studies/Artificial_analyzed.spthy: openFile: does
not exist (No such file or directory)
cas@doekoe:~/src/tamarin-prover$

Any suggestions?

fixed in 9b085d4

best regards,
Simon

Userguide does not explain builtins

The builtins are currently (somewhat) described in the README, but this is not distributed currently. The description should be included in the userguide instead.

Use .svg files for displaying graphs in modern browsers

This will enable better scaling and opens the way to lots of great stuff like

  • making the goals clickable in the graph
  • providing additional roll-over information
  • use JavaScript to allow inline resizing of the graph
  • ...

Protocol specification v2.0 (incremental patch)

The current protocol specification format has some shortcomings that hamper further experimentation with proving and reusing inductive invariants and with exploiting filtering constructions in a more general way. This also reflects in the internal data structures representing security protocol theories. The following is an example outline of the extended/new protocol specification format. Afterwards, we'll explain the implications on the UI and some implications with respect to the implementation.

theory Name begin

// The sections must come in the following order: signature, protocol, properties

// The term signature is defined first. It consists of two named lists: functions and equations.
signature:
   functions:
   equations:

// rules and axioms can only be specified in the protocol section
protocol:
    rule blah:
    rule blih:

    // Axioms are trace formulas that filter the set of traces. They are not proven and reused by default.
    axiom blah:

// here come the properties
properties:
    // you can freely name your properties: claim, lemma, theorem -- this name has no semantic meaning
    claim secrecy[attributes]: 
      valid " formula "

   /* valid "formula"          means that we claim that the formula to hold for all traces.
       satisfiable "formula" means that we claim that the formula holds for at least one trace
   */

   /* possible attributes: 
         inductive (means induction should be used as first proof step)
         reuse (means that this validity claim should be reused by default)
         use: list-of-names (means that these names should be used additionally as lemmas in the proof)
         dont-use: list-of-names (means that these lemmas/claims/axioms/theorems should not be used in the proof)
   */

// Note that the layout-sensitive syntax is currently optional. 
// We might consider making it mandatory to avoid future parsing problems.

end

Internally axioms/claims/lemmas/theorems are represented uniformly. They all share a common flat name space. Duplicate names are disallowed. Their attributes classify them into their respective sets. We cache precomputed case distinctions indexed on the set of theorem names involved.

In the HTML view, every lemma has a link to the case distinctions (perhaps the full proof-context?) that are used for proving it.

Simple fix proposal for (attack) graph size problem

Running some case studies, where it is important to understand any attacks that are found, has again proven to be unnecessarily hard by the amount of detail in the current graphs (that are meant to support inspecting the proof state and therefore contain information that is not needed to understand attacks).

Clearly, there are many great ways of improving such outputs but they may involve a lot of work.

So here is a recommendation for a simple fix:
Add an option to the gui to collapse all non-protocol rule instances into single dots (just change the style and drop the box spec in the graphviz output). This means none of the dependencies need to be changed - edges can stay as-is, the only thing that changes is some node definitions.
Inevitably, the graph will be much simpler to inspect.

Allow invariants to reference conclusions of construction rules

Key wrapping like it is used in the PKCS#11 system requires stronger invariants to reason about the effect of handles. These invariants must be able to reference the deduced messages. Here, we follow the direct approach of logging the conclusion of every construction rule as a Ded(m) fact. Formulas referencing such facts denote invariants of normal dependency graphs.

In our constraint systems, we have to take special care when solving action constraints with such facts because we have no symbolic representation of the n-ary multiplication rule. We choose the approach to consider only Ded(m) @ i actions as open, if we can prove that m is neither a pair, an inversion, or a multiplication. This breaks our assumption that we can extract a P-solution from every solved form. We'll take care of that later.

Consistent usage of Tamarin name

At several points we are now using different ways to refer to Tamarin.

I've seen at least:

  • Tamarin
  • tamarin
  • tamarin-prover
  • the Tamarin prover

We should be as consistent as possible. I recommend:

  • Short: Tamarin
    (latex: {\sc Tamarin}) ("we used Tamarin")
  • Long: the Tamarin prover
    (latex: the {\sc Tamarin} prover)
  • Referring to the executable: tamarin-prover
    (latex: {\tt tamarin-prover})

In HTML, the small-caps can be accomplished by
<span style="font-variant:small-caps">Tamarin</span>

I've also defined a CSS style for the web server, so there you can use
<span class="sc">Tamarin</span>
Besides setting small caps, the "sc" style also modifies the font to 'roman' or at least to 'serif' for consistency with the other visuals.

Introduce a `safe` proof method

In the user interface, we often just want to expand all non-case-split goals. We therefore would like to introduce a further menu item that calls a corresponding safe proof method.

Implement trace output

The current graphs (even the condensed ones) are often unreadable because they are too big. They also contain quite a lot of information that is interesting for the internals or for interactive proving, but that is irrelevant for understanding attacks.

One way to solve this is to add another view/output mode, that just shows (one) trace of the system, possibly with listed open goals, possibly just the protocol rule transitions. This would enable understanding attacks and would also make the output more suitable for printing.

Introduce user defined sorts

We would like to allow for user defined sorts and a user-defined sort hierarchy. We do not plan to support overloaded functions; i.e., all functions must work on top-level sorts. The planned syntax is the following.

sorts: s1, s2, ..., sn
subsorts: s1 < s2 < ... sk, sk < ... sn

Once we have this change, we'll introduce a sort fact and require the user to define all fact symbols explicitly. We can then get rid of the Fact.hs module.

Implement a proper logging framework

Currently, we use Debug.Trace.trace to log output. All of this goes to stdout. However, some of the output should be visible in the GUI, some should be mixed with the batch output and other you want to drop. Designing and implementing a simple, but more powerful solution seems to make sense. Especially, as Windows users are not accustomed to having a shell display any output that they might need to look at :-)

Update user guide and README

The user guide has a few mistakes (Init_1 instad of Client_1) and I'm not sure if it has a proper explanation of the induction stuff. Check this before the release.

Moreover, we could also add the TLS.spthy handshake and NSL to get people going a bit easier.

The installation instructions in the README should be synchronized with the ones on the website.

Proposed keyboard shortcut '?' to display keyboard shortcuts

Often one starts digging into a proof, and then one realizes a keyboard shortcut would be handy. By then it is pretty hard to find what they are without backing up out of the proof. Not convenient.

What about a pop-up window? Also, semi-transparent help overlays are all the rage nowadays (unity, gmail,...)

"All x . P" when x does not occur in P should give more accurate error report (or maybe not fail at all)

While modeling a protocol, it frequently occurs that one removes a clause and subsequently all occurrences of a variable.
When this happens, we get something like

All x. P

where x does not occur in P. Currently this yields an error stating that the formula does not meet 'guardedness'. This can be mistifying/misleading.
There's two options:

  • Report error: quantified variable x does not occur in quantification formula
  • Ignore this case and do not give an error (implicit removal of x). Possibly a warning would just be fine.

Intuitively, the second option makes most sense. Clearly the guardedness is then not met by the given spec.

Use DAG representation for terms

After improving the communication with maude, the most expensive functions are unification and substitution application. Switching to a DAG style representation should yield further benefits here.

Allow non-reducible function symbols in formulas

I wanted to write 'Init' somewhere in a formula to filter out Session ID's for the initiator, without introducing a role-specific fact.
In the session ID I have a constant for the role. However, this yielded an error.

A simple way to reproduce the core of the issue is to modify NAXOS to include a nested constant 'x', e.g., as in:

lemma eCK_key_secrecy:
  "not (Ex #i1 #i2 #i3 s A B minfo k .
            Sid(s, A, B, minfo) @ i1 & K( k ) @ i2 & Accept(s, ) @ i3

This yields:

/*
Error: the following well-formedness checks failed!

formula terms:
  lemma `eCK_key_secrecy' uses terms of the wrong form:
    `pair(Bound 3,'x')'
  
  The only allowed terms are public names and bound node and message
  variables. If you encounter free message variables, then you might
  have forgotten a #-prefix. Sort prefixes can only be dropped where
  this is unambiguous
*/

I think there's nothing problematic about the formula and it should therefore work just fine.

Any thoughts/fixes?

Protocol with syntax/missing builtin problem gives incomprehensible Maude error

The following spec gives an incomprehensible Maude error. The problem is that I forgot 'builtin: diffie-hellman' so '^' is not defined. However the user won't easily be able to tell what is going on.

theory maude_error_but_should_work
begin
   
section{* Test *}
   
rule the_test:
   [ In(x^z) ] --> []

end

On a side note, running this simple spec with the added "builtin: diffie-hellman" takes an unreasonable 13 seconds on my machine. That's plain weird.

Clicking on proof method changes focus wrongly

Most of the the times, when clicking on a proof method in the HTML GUI, the focus does not change in the same way, as when executing the proof method using the keyboard shortcuts. The detail view shows the standard startup page instead of the next open branch in the proof.

This should be fixed. The desired behavior is the one implemented for the keyboard shortcuts.

Different instances of the ISend rule

We are programmatically producing different ISend rule instances. This is a possible soundness bug. Fix and ensure that for every built-in rule there is exactly one function to create it.

Bump version to 0.4.0.0, merge into master, release

We use even version numbers for stable releases and odd numbers for development versions. Add comments to this issue for further stuff I should not forget to do before releasing to hackage. Currently, I know of the following:

  • [DONE] Make sure that all issues in the csf-12-release milestone are resolved
  • [DONE] Rerun all case-studies to ensure no regression has crept in
  • [DONE] Update reference in paper to point to http://hackage.haskell.org/package/tamarin-prover-0.4.0.0
  • [DONE] Check that tarballs compile with the three GHC 7.Xs

Annotate cases stemming from equation splits

The equation splits often yield many cases and it would be interesting to be able to quickly see which branch belongs to which equation. I imagine annotation (just as is done now with some other text):

case split_case_02 // x = y^z

Properly parse Unicode input

The lexer is currently based on alex and has trouble parsing Unicode tokens. Moreover, some operators allow internal spacing, which is rather strange. Switching to a parsec based solution will allow us to simplify the code and tighten the grammar.

Include wellformedness checking output in summary

A failing wellformedness check indicates that the model is likely to be flawed. This is easily forgotten when looking at a summary which just states NewKey_secrecy (all-traces): verified (5 steps).

Manually defining uninterpreted functions can lead to core dump

Here's a nice core dump:

The reason does not seem to be the 'let'. Instead, the dump is caused by me using H1/H2 as below. This causes Maude to bork (in some examples silently, in this one with an error) but Tamarin core dumps.

theory NAXOS_eCK
begin

builtin: diffie-hellman

functions: H1/1
functions: H2/1

section{* NAXOS *}

rule generate_ltk:
   let pkA = 'g'^~lkA
   in
   [ Fr(~lkA) ] -->
   [ !Ltk( $A, ~lkA ), !Pk( $A, pkA ), Out( pkA ) ]


rule Resp_1:
  let pkI    = ('g'^~lkI)
      exR    = H1(< ~ekR, ~lkR >)
      hkr    = 'g'^'4'
      seskey = H2(< pkI^exR, X^~lkR, X^'6', $I, $R >)
  in
   [ In( X ), Fr( ~ekR ), !Ltk($R, ~lkR), !Pk($I, pkI) ]
   --[ SidR_1( ~ekR, $I, $R, X, hkr, seskey) ]->
   [ Out( hkr ),
     !Ephk(~ekR),
     !Sessk( ~ekR, seskey) ]

end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.