Beispiel #1
0
    def searchall(self):
        """Search all servers not listed in resources (credits will be used).

        See https://app.yuleak.com/apidoc#post-searchall for endpoint details.

        Returns:
            (bool) True if the search has been launched
        """
        return YuleakClient.post_request('dashboard/{0}/searchall'.format(self.id))
Beispiel #2
0
    def renew_all(self):
        """Re-launch all resources of the current dashboard.

        See https://app.yuleak.com/apidoc#post-renewall for endpoint details.

        Returns:
            (bool) True if the search has been launched
        """
        return YuleakClient.post_request('dashboard/{0}/renewall'.format(self.id))
Beispiel #3
0
    def renew(self):
        """Launch a new search for the current resource (credits will be consumed)

        See https://app.yuleak.com/apidoc#post-renew for endpoint details.

        Returns:
            (bool) True if the search has been launched
        """
        return YuleakClient.post_request('dashboard/{0}/renew'.format(
            self.dashboard.id),
                                         data={'value': self.value})
Beispiel #4
0
    def search(self, search):
        """Launch a new search (credits will be used) in the current dashboard.

        See https://app.yuleak.com/apidoc#post-search for endpoint details.

        Args:
            search (str): Expression to search

        Returns:
            (bool) True if the search has been launched
        """
        return YuleakClient.post_request('dashboard/{0}/search'.format(self.id), data={'value': search})
Beispiel #5
0
    def add_bookmark(self):
        """Add a bookmark to the current server.

        See https://app.yuleak.com/apidoc#post-bookmark for endpoint details.

        Returns:
            (bool) True if the bookmark have been added
        """
        if self.bookmark:
            logger.warning('The server is already bookmarked.')
        if YuleakClient.post_request(
                'dashboard/{0}/server/{1}/bookmark'.format(
                    self.dashboard.id, self.id)):
            self.bookmark = True
        return self.bookmark
Beispiel #6
0
    def add_filter(self, category, value, type_='required'):
        """Add a filter to the current dashboard.

        See https://app.yuleak.com/apidoc#post-filters for endpoint details.

        Args:
            category (str): Filter category (server, domain, alert, date)
            value (str): Filter value (all, blacklist, cloudflare ...)
            type_ (str): Filter type: required (by default) or ignored

        Returns:
            True if the filter has been added
        """
        return YuleakClient.post_request('dashboard/{0}/filters'.format(self.id),
                                         data={'category': category,
                                               'value': value,
                                               'type': type_})