/sigma-rules-api

Sigma rules fun API. A restful API which contains most funny sigma rules. Sigma-rule-api made by subhranhsu sekhar choudhury.

Primary LanguageEJSApache License 2.0Apache-2.0

Men Sigma Rule API

  • This API provides funny sigma rules from memes.
  • Use it for fun, remeber all the rules are from internet.
  • Kindly don't take the rules seriously.
  • NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule


Fetch all the Sigma Rules:

//#### NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule
const URL = "http://sigmarule.herokuapp.com/sigmarule"
const getPosts = async () => {

    const response = await fetch(URL);
    if (!response.ok) {
        throw new Error("Error in fetching JSON data, Contact subhranshuchoudhury");
    }
    const data = await response.json();
    return data;

}

getPosts()
    .then(mydata => {
        getRule(mydata);
    })
    .catch(error => {
        alert(error);

    });

function getRule(Rules) {
    console.log(Rules); //Rules[index].rule
} 

Fetch random Sigma Rule:

//#### NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule
const URL = "http://sigmarule.herokuapp.com/sigmarule/random"
const getPosts = async () => {

    const response = await fetch(URL);
    if (!response.ok) {
        throw new Error("Error in fetching JSON data, Contact subhranshuchoudhury");
    }
    const data = await response.json();
    return data;

}

getPosts()
    .then(mydata => {
        getRule(mydata);
    })
    .catch(error => {
        alert(error);

    });

function getRule(Rules) {
    console.log(Rules.rule)
}

Endpoints:

NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule


Author: Subhranshu Choudhury