Skip to content

Commit 9a5602a

Browse files
committed
version 1.4.0 released
1 parent 9a4021c commit 9a5602a

File tree

4,838 files changed

+35690
-10061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,838 files changed

+35690
-10061
lines changed

docs/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</a>
4141
</div>
4242
<div>
43-
1.2.0 </div>
43+
1.4.0 </div>
4444
<div class="pull-right d-flex">
4545
<button id="theme-toggle-button"><span id="theme-toggle"></span></button>
4646
<div id="searchBar"></div>
@@ -63,9 +63,7 @@ <h2 class="">All modules:</h2>
6363
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-489827579%2FMain%2F0"></span>
6464
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
6565
</span></span></div>
66-
<div><span class="brief-comment">
67-
<p class="paragraph">Analysis module allows launching dataflow analyses of applications. It contains API to write custom analyses, along with several implemented ready-to-use analyses.</p>
68-
</span></div>
66+
<div><span class="brief-comment"></span></div>
6967
</div>
7068
</div>
7169
<a data-name="1074868007%2FMain%2F0" anchor-label="jacodb-api" id="1074868007%2FMain%2F0" data-filterable-set=""></a>

docs/jacodb-analysis/index.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="library-name">
3535
<a href="../index.html">
3636
<span>jacodb</span> </a> </div>
37-
<div>1.2.0
37+
<div>1.4.0
3838
</div>
3939
<div class="pull-right d-flex">
4040
<button id="theme-toggle-button"><span id="theme-toggle"></span></button>
@@ -50,7 +50,6 @@
5050
<div class="breadcrumbs"></div>
5151
<div class="cover ">
5252
<h1 class="cover"><span><span>jacodb-analysis</span></span></h1>
53-
<div class="platform-hinted UnderCoverText" data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jacodb-analysis:dokkaHtmlPartial/main"><p class="paragraph">Analysis module allows launching dataflow analyses of applications. It contains API to write custom analyses, along with several implemented ready-to-use analyses.</p><h2 class=""> Concept of units</h2><p class="paragraph">The <a href="https://dx.doi.org/10.1145/199448.199462">IFDS</a> framework is used as the basis for this module. However, in order to be scalable, the analyzed code is split into so-called units, so that the framework can analyze them concurrently. Information is shared between the units via summaries, but the lifecycle of each unit is controlled separately.</p><h2 class=""> Get started</h2><p class="paragraph">The entry point of the analysis is the <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis/run-analysis.html">runAnalysis</a> method. In order to call it, you have to provide:</p><ul><li><p class="paragraph"><code class="lang-kotlin">graph</code> — an application graph that is used for analysis. To obtain this graph, one should call the <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis/new-application-graph-for-analysis.html">newApplicationGraphForAnalysis</a> method.</p></li><li><p class="paragraph"><code class="lang-kotlin">unitResolver</code> — an object that groups methods into units. Choose one from <code class="lang-kotlin">UnitResolversLibrary</code>. Note that in general, larger units mean more precise but also more resource-consuming analysis.</p></li><li><p class="paragraph"><code class="lang-kotlin">ifdsUnitRunner</code> — an <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-unit-runner/index.html">IfdsUnitRunner</a> instance, which is used to analyze each unit. This is what defines concrete analysis. Ready-to-use runners are located in <code class="lang-kotlin">RunnersLibrary</code>.</p></li><li><p class="paragraph"><code class="lang-kotlin">methods</code> — a list of methods to analyze.</p></li></ul><p class="paragraph">For example, to detect unused variables in the given <code class="lang-kotlin">analyzedClass</code> methods, you may run the following code (assuming that <code class="lang-kotlin">classpath</code> is an instance of <a href="https://jacodb.org/docs/jacodb-api/org.jacodb.api/-jc-classpath/index.html">JcClasspath</a>):</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">val applicationGraph = runBlocking { <br> classpath.newApplicationGraphForAnalysis()<br>}<br><br>val methodsToAnalyze = analyzedClass.declaredMethods<br>val unitResolver = MethodUnitResolver<br>val runner = UnusedVariableRunner<br><br>runAnalysis(applicationGraph, unitResolver, runner, methodsToAnalyze)</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h2 class=""> Implemented runners</h2><p class="paragraph">By now, the following runners are implemented:</p><ul><li><p class="paragraph"><code class="lang-kotlin">UnusedVariableRunner</code> that can detect issues like unused variable declaration, unused return value, etc.</p></li><li><p class="paragraph"><code class="lang-kotlin">NpeRunner</code> that can find instructions with possible null-value dereference.</p></li><li><p class="paragraph">Generic <code class="lang-kotlin">TaintRunner</code> that can perform taint analysis.</p></li><li><p class="paragraph"><code class="lang-kotlin">SqlInjectionRunner</code> which find places vulnerable to sql injections, thus performing a specific kind of taint analysis.</p></li></ul><h2 class=""> Implementing your own analysis</h2><p class="paragraph">To implement a simple one-pass analysis, use <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-base-unit-runner/index.html">IfdsBaseUnitRunner</a>. To instantiate it, you need an <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer-factory/index.html">AnalyzerFactory</a> instance, which is an object that can create <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer/index.html">Analyzer</a> via <a href="https://jacodb.org/docs/jacodb-api/org.jacodb.api.analysis/-jc-application-graph/index.html">JcApplicationGraph</a>.</p><p class="paragraph">To instantiate an <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer/index.html">Analyzer</a> interface, you have to specify the following:</p><ul><li><p class="paragraph"><code class="lang-kotlin">flowFunctions</code> which describe dataflow facts and their transmissions during the analysis.</p></li><li><p class="paragraph">How vulnerabilities are produced by these facts, i.e. you have to implement <code class="lang-kotlin">getSummaryFacts</code> and <code class="lang-kotlin">getSummaryFactsPostIfds</code> methods.</p></li></ul><p class="paragraph">To implement bidirectional analysis, you may use composite <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-sequential-bidi-ifds-base-unit-runner/index.html">SequentialBidiIfdsUnitRunner</a> and <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-parallel-bidi-ifds-base-unit-runner/index.html">ParallelBidiIfdsUnitRunner</a>.</p><!-- MODULE jacodb-analysis --><!-- INDEX org.jacodb.analysis --></div></div>
5453
</div>
5554
<h2 class="">Packages</h2>
5655
<div class="table"><a data-name="-725659743%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis" id="-725659743%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
@@ -151,6 +150,20 @@ <h2 class="">Packages</h2>
151150
<div></div>
152151
</div>
153152
</div>
153+
<a data-name="-261361868%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.sarif" id="-261361868%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
154+
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
155+
<div>
156+
<div class="main-subrow ">
157+
<div class=""><span class="inline-flex">
158+
<div><a href="org.jacodb.analysis.sarif/index.html">org.jacodb.analysis.sarif</a></div>
159+
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-261361868%2FPackages%2F1000453906"></span>
160+
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
161+
</span></span></div>
162+
<div class="pull-right"></div>
163+
</div>
164+
<div></div>
165+
</div>
166+
</div>
154167
</div>
155168
</div>
156169
<div class="footer">

0 commit comments

Comments
 (0)