Ejemplo n.º 1
0
    def graph(self, id):
        investigation = get_object_or_404(Investigation, id=id)
        if group_user_permission(investigation):
            return render_template(
                "{}/graph.html".format(self.klass.__name__.lower()),
                investigation=bson_renderer(investigation.info()))

        abort(403)
Ejemplo n.º 2
0
    def import_from(self, id):
        investigation = get_object_or_404(Investigation, id=id)
        observables = Observable.from_string(investigation.import_text)

        return render_template(
            "{}/import_from.html".format(self.klass.__name__.lower()),
            investigation=investigation,
            observables=bson_renderer(observables))
Ejemplo n.º 3
0
def graph_node(klass, id):
    if klass == 'entity':
        node = get_object_or_404(Entity, id=id)
    else:
        node = get_object_or_404(Observable, id=id)

    investigation = Investigation().save()
    investigation.add([], [node])

    return render_template("graph.html", investigation=bson_renderer(investigation.info()))
Ejemplo n.º 4
0
    def graph_node(self, klass, id):
        if klass == 'entity':
            node = get_object_or_404(Entity, id=id)
        elif klass == 'indicator':
            node = get_object_or_404(Indicator, id=id)
        else:
            node = get_object_or_404(Observable, id=id)

        investigation = Investigation(created_by=current_user.username).save()
        investigation.add([], [node])

        return render_template(
            "{}/graph.html".format(self.klass.__name__.lower()),
            investigation=bson_renderer(investigation.info()))
Ejemplo n.º 5
0
def graph(id):
    investigation = get_object_or_404(Investigation, id=id)
    return render_template("graph.html", investigation=bson_renderer(investigation.info()))
Ejemplo n.º 6
0
 def graph(self, id):
     investigation = get_object_or_404(Investigation, id=id)
     return render_template(
         "{}/graph.html".format(self.klass.__name__.lower()),
         investigation=bson_renderer(investigation.info()))
Ejemplo n.º 7
0
    def graph_node(self, klass, id):
        if klass == 'entity':
            node = get_object_or_404(Entity, id=id)
        elif klass == 'indicator':
            node = get_object_or_404(Indicator, id=id)
        else:
            node = get_object_or_404(Observable, id=id)

        investigation = Investigation().save()
        investigation.add([], [node])

        return render_template("{}/graph.html".format(self.klass.__name__.lower()), investigation=bson_renderer(investigation.info()))
Ejemplo n.º 8
0
 def graph(self, id):
     investigation = get_object_or_404(Investigation, id=id)
     return render_template("{}/graph.html".format(self.klass.__name__.lower()), investigation=bson_renderer(investigation.info()))