repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
google/grr | grr/server/grr_response_server/keyword_index.py | AFF4KeywordIndex.AddKeywordsForName | def AddKeywordsForName(self, name, keywords):
"""Associates keywords with name.
Records that keywords are associated with name.
Args:
name: A name which should be associated with some keywords.
keywords: A collection of keywords to associate with name.
"""
data_store.DB.IndexAddKeyword... | python | def AddKeywordsForName(self, name, keywords):
"""Associates keywords with name.
Records that keywords are associated with name.
Args:
name: A name which should be associated with some keywords.
keywords: A collection of keywords to associate with name.
"""
data_store.DB.IndexAddKeyword... | [
"def",
"AddKeywordsForName",
"(",
"self",
",",
"name",
",",
"keywords",
")",
":",
"data_store",
".",
"DB",
".",
"IndexAddKeywordsForName",
"(",
"self",
".",
"urn",
",",
"name",
",",
"keywords",
")"
] | Associates keywords with name.
Records that keywords are associated with name.
Args:
name: A name which should be associated with some keywords.
keywords: A collection of keywords to associate with name. | [
"Associates",
"keywords",
"with",
"name",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/keyword_index.py#L83-L92 | train | Associates keywords with name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/keyword_index.py | AFF4KeywordIndex.RemoveKeywordsForName | def RemoveKeywordsForName(self, name, keywords):
"""Removes keywords for a name.
Args:
name: A name which should not be associated with some keywords anymore.
keywords: A collection of keywords.
"""
data_store.DB.IndexRemoveKeywordsForName(self.urn, name, keywords) | python | def RemoveKeywordsForName(self, name, keywords):
"""Removes keywords for a name.
Args:
name: A name which should not be associated with some keywords anymore.
keywords: A collection of keywords.
"""
data_store.DB.IndexRemoveKeywordsForName(self.urn, name, keywords) | [
"def",
"RemoveKeywordsForName",
"(",
"self",
",",
"name",
",",
"keywords",
")",
":",
"data_store",
".",
"DB",
".",
"IndexRemoveKeywordsForName",
"(",
"self",
".",
"urn",
",",
"name",
",",
"keywords",
")"
] | Removes keywords for a name.
Args:
name: A name which should not be associated with some keywords anymore.
keywords: A collection of keywords. | [
"Removes",
"keywords",
"for",
"a",
"name",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/keyword_index.py#L94-L101 | train | Removes keywords for a name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | ImportConfig | def ImportConfig(filename, config):
"""Reads an old config file and imports keys and user accounts."""
sections_to_import = ["PrivateKeys"]
entries_to_import = [
"Client.executable_signing_public_key", "CA.certificate",
"Frontend.certificate"
]
options_imported = 0
old_config = grr_config.CONFIG... | python | def ImportConfig(filename, config):
"""Reads an old config file and imports keys and user accounts."""
sections_to_import = ["PrivateKeys"]
entries_to_import = [
"Client.executable_signing_public_key", "CA.certificate",
"Frontend.certificate"
]
options_imported = 0
old_config = grr_config.CONFIG... | [
"def",
"ImportConfig",
"(",
"filename",
",",
"config",
")",
":",
"sections_to_import",
"=",
"[",
"\"PrivateKeys\"",
"]",
"entries_to_import",
"=",
"[",
"\"Client.executable_signing_public_key\"",
",",
"\"CA.certificate\"",
",",
"\"Frontend.certificate\"",
"]",
"options_im... | Reads an old config file and imports keys and user accounts. | [
"Reads",
"an",
"old",
"config",
"file",
"and",
"imports",
"keys",
"and",
"user",
"accounts",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L87-L108 | train | Reads an old config file and imports keys and user accounts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | RetryQuestion | def RetryQuestion(question_text, output_re="", default_val=None):
"""Continually ask a question until the output_re is matched."""
while True:
if default_val is not None:
new_text = "%s [%s]: " % (question_text, default_val)
else:
new_text = "%s: " % question_text
# pytype: disable=wrong-arg... | python | def RetryQuestion(question_text, output_re="", default_val=None):
"""Continually ask a question until the output_re is matched."""
while True:
if default_val is not None:
new_text = "%s [%s]: " % (question_text, default_val)
else:
new_text = "%s: " % question_text
# pytype: disable=wrong-arg... | [
"def",
"RetryQuestion",
"(",
"question_text",
",",
"output_re",
"=",
"\"\"",
",",
"default_val",
"=",
"None",
")",
":",
"while",
"True",
":",
"if",
"default_val",
"is",
"not",
"None",
":",
"new_text",
"=",
"\"%s [%s]: \"",
"%",
"(",
"question_text",
",",
"... | Continually ask a question until the output_re is matched. | [
"Continually",
"ask",
"a",
"question",
"until",
"the",
"output_re",
"is",
"matched",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L111-L126 | train | Continually ask a question until the output_re is matched. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | ConfigureHostnames | def ConfigureHostnames(config, external_hostname = None):
"""This configures the hostnames stored in the config."""
if not external_hostname:
try:
external_hostname = socket.gethostname()
except (OSError, IOError):
print("Sorry, we couldn't guess your hostname.\n")
external_hostname = Retry... | python | def ConfigureHostnames(config, external_hostname = None):
"""This configures the hostnames stored in the config."""
if not external_hostname:
try:
external_hostname = socket.gethostname()
except (OSError, IOError):
print("Sorry, we couldn't guess your hostname.\n")
external_hostname = Retry... | [
"def",
"ConfigureHostnames",
"(",
"config",
",",
"external_hostname",
"=",
"None",
")",
":",
"if",
"not",
"external_hostname",
":",
"try",
":",
"external_hostname",
"=",
"socket",
".",
"gethostname",
"(",
")",
"except",
"(",
"OSError",
",",
"IOError",
")",
"... | This configures the hostnames stored in the config. | [
"This",
"configures",
"the",
"hostnames",
"stored",
"in",
"the",
"config",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L139-L172 | train | This configures the hostnames stored in the config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | CheckMySQLConnection | def CheckMySQLConnection(db_options):
"""Checks whether a connection can be established to MySQL.
Args:
db_options: A dict mapping GRR MySQL config options to their values.
Returns:
A boolean indicating whether a connection could be made to a MySQL server
instance with the given options.
"""
for... | python | def CheckMySQLConnection(db_options):
"""Checks whether a connection can be established to MySQL.
Args:
db_options: A dict mapping GRR MySQL config options to their values.
Returns:
A boolean indicating whether a connection could be made to a MySQL server
instance with the given options.
"""
for... | [
"def",
"CheckMySQLConnection",
"(",
"db_options",
")",
":",
"for",
"tries_left",
"in",
"range",
"(",
"_MYSQL_MAX_RETRIES",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"try",
":",
"connection_options",
"=",
"dict",
"(",
"host",
"=",
"db_options",
"[",
"\"Mysql.... | Checks whether a connection can be established to MySQL.
Args:
db_options: A dict mapping GRR MySQL config options to their values.
Returns:
A boolean indicating whether a connection could be made to a MySQL server
instance with the given options. | [
"Checks",
"whether",
"a",
"connection",
"can",
"be",
"established",
"to",
"MySQL",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L175-L249 | train | Checks whether a MySQL connection is established to a MySQL server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | ConfigureMySQLDatastore | def ConfigureMySQLDatastore(config):
"""Prompts the user for configuration details for a MySQL datastore."""
print("GRR will use MySQL as its database backend. Enter connection details:")
datastore_init_complete = False
db_options = {}
while not datastore_init_complete:
db_options["Datastore.implementatio... | python | def ConfigureMySQLDatastore(config):
"""Prompts the user for configuration details for a MySQL datastore."""
print("GRR will use MySQL as its database backend. Enter connection details:")
datastore_init_complete = False
db_options = {}
while not datastore_init_complete:
db_options["Datastore.implementatio... | [
"def",
"ConfigureMySQLDatastore",
"(",
"config",
")",
":",
"print",
"(",
"\"GRR will use MySQL as its database backend. Enter connection details:\"",
")",
"datastore_init_complete",
"=",
"False",
"db_options",
"=",
"{",
"}",
"while",
"not",
"datastore_init_complete",
":",
"... | Prompts the user for configuration details for a MySQL datastore. | [
"Prompts",
"the",
"user",
"for",
"configuration",
"details",
"for",
"a",
"MySQL",
"datastore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L252-L301 | train | Configure a MySQL datastore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | ConfigureDatastore | def ConfigureDatastore(config):
"""Guides the user through configuration of the datastore."""
print("\n\n-=GRR Datastore=-\n"
"For GRR to work each GRR server has to be able to communicate with\n"
"the datastore. To do this we need to configure a datastore.\n")
existing_datastore = grr_config.CON... | python | def ConfigureDatastore(config):
"""Guides the user through configuration of the datastore."""
print("\n\n-=GRR Datastore=-\n"
"For GRR to work each GRR server has to be able to communicate with\n"
"the datastore. To do this we need to configure a datastore.\n")
existing_datastore = grr_config.CON... | [
"def",
"ConfigureDatastore",
"(",
"config",
")",
":",
"print",
"(",
"\"\\n\\n-=GRR Datastore=-\\n\"",
"\"For GRR to work each GRR server has to be able to communicate with\\n\"",
"\"the datastore. To do this we need to configure a datastore.\\n\"",
")",
"existing_datastore",
"=",
"grr_co... | Guides the user through configuration of the datastore. | [
"Guides",
"the",
"user",
"through",
"configuration",
"of",
"the",
"datastore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L304-L344 | train | Guides the user through configuration of the datastore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | ConfigureUrls | def ConfigureUrls(config, external_hostname = None):
"""Guides the user through configuration of various URLs used by GRR."""
print("\n\n-=GRR URLs=-\n"
"For GRR to work each client has to be able to communicate with the\n"
"server. To do this we normally need a public dns name or IP address\n"
... | python | def ConfigureUrls(config, external_hostname = None):
"""Guides the user through configuration of various URLs used by GRR."""
print("\n\n-=GRR URLs=-\n"
"For GRR to work each client has to be able to communicate with the\n"
"server. To do this we normally need a public dns name or IP address\n"
... | [
"def",
"ConfigureUrls",
"(",
"config",
",",
"external_hostname",
"=",
"None",
")",
":",
"print",
"(",
"\"\\n\\n-=GRR URLs=-\\n\"",
"\"For GRR to work each client has to be able to communicate with the\\n\"",
"\"server. To do this we normally need a public dns name or IP address\\n\"",
... | Guides the user through configuration of various URLs used by GRR. | [
"Guides",
"the",
"user",
"through",
"configuration",
"of",
"various",
"URLs",
"used",
"by",
"GRR",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L347-L380 | train | Guides the user through configuration of various URLs used by GRR. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | ConfigureEmails | def ConfigureEmails(config):
"""Guides the user through email setup."""
print("\n\n-=GRR Emails=-\n"
"GRR needs to be able to send emails for various logging and\n"
"alerting functions. The email domain will be appended to GRR\n"
"usernames when sending emails to users.\n")
existing_log_d... | python | def ConfigureEmails(config):
"""Guides the user through email setup."""
print("\n\n-=GRR Emails=-\n"
"GRR needs to be able to send emails for various logging and\n"
"alerting functions. The email domain will be appended to GRR\n"
"usernames when sending emails to users.\n")
existing_log_d... | [
"def",
"ConfigureEmails",
"(",
"config",
")",
":",
"print",
"(",
"\"\\n\\n-=GRR Emails=-\\n\"",
"\"GRR needs to be able to send emails for various logging and\\n\"",
"\"alerting functions. The email domain will be appended to GRR\\n\"",
"\"usernames when sending emails to users.\\n\"",
")",
... | Guides the user through email setup. | [
"Guides",
"the",
"user",
"through",
"email",
"setup",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L383-L421 | train | Configure emails for the GRR. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | InstallTemplatePackage | def InstallTemplatePackage():
"""Call pip to install the templates."""
virtualenv_bin = os.path.dirname(sys.executable)
extension = os.path.splitext(sys.executable)[1]
pip = "%s/pip%s" % (virtualenv_bin, extension)
# Install the GRR server component to satisfy the dependency below.
major_minor_version = ".... | python | def InstallTemplatePackage():
"""Call pip to install the templates."""
virtualenv_bin = os.path.dirname(sys.executable)
extension = os.path.splitext(sys.executable)[1]
pip = "%s/pip%s" % (virtualenv_bin, extension)
# Install the GRR server component to satisfy the dependency below.
major_minor_version = ".... | [
"def",
"InstallTemplatePackage",
"(",
")",
":",
"virtualenv_bin",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"sys",
".",
"executable",
")",
"extension",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"sys",
".",
"executable",
")",
"[",
"1",
"]",
"pip"... | Call pip to install the templates. | [
"Call",
"pip",
"to",
"install",
"the",
"templates",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L424-L439 | train | Call pip to install the templates. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | FinalizeConfigInit | def FinalizeConfigInit(config,
token,
admin_password = None,
redownload_templates = False,
repack_templates = True,
prompt = True):
"""Performs the final steps of config initialization."""
config.Set("... | python | def FinalizeConfigInit(config,
token,
admin_password = None,
redownload_templates = False,
repack_templates = True,
prompt = True):
"""Performs the final steps of config initialization."""
config.Set("... | [
"def",
"FinalizeConfigInit",
"(",
"config",
",",
"token",
",",
"admin_password",
"=",
"None",
",",
"redownload_templates",
"=",
"False",
",",
"repack_templates",
"=",
"True",
",",
"prompt",
"=",
"True",
")",
":",
"config",
".",
"Set",
"(",
"\"Server.initialize... | Performs the final steps of config initialization. | [
"Performs",
"the",
"final",
"steps",
"of",
"config",
"initialization",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L442-L482 | train | Finalizes the configuration initialization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | Initialize | def Initialize(config=None,
external_hostname = None,
admin_password = None,
redownload_templates = False,
repack_templates = True,
token = None):
"""Initialize or update a GRR configuration."""
print("Checking write access on config %s" % ... | python | def Initialize(config=None,
external_hostname = None,
admin_password = None,
redownload_templates = False,
repack_templates = True,
token = None):
"""Initialize or update a GRR configuration."""
print("Checking write access on config %s" % ... | [
"def",
"Initialize",
"(",
"config",
"=",
"None",
",",
"external_hostname",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"redownload_templates",
"=",
"False",
",",
"repack_templates",
"=",
"True",
",",
"token",
"=",
"None",
")",
":",
"print",
"(",
... | Initialize or update a GRR configuration. | [
"Initialize",
"or",
"update",
"a",
"GRR",
"configuration",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L485-L535 | train | Initialize or update a GRR configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | InitializeNoPrompt | def InitializeNoPrompt(config=None,
external_hostname = None,
admin_password = None,
mysql_hostname = None,
mysql_port = None,
mysql_username = None,
mysql_password = None,
... | python | def InitializeNoPrompt(config=None,
external_hostname = None,
admin_password = None,
mysql_hostname = None,
mysql_port = None,
mysql_username = None,
mysql_password = None,
... | [
"def",
"InitializeNoPrompt",
"(",
"config",
"=",
"None",
",",
"external_hostname",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"mysql_hostname",
"=",
"None",
",",
"mysql_port",
"=",
"None",
",",
"mysql_username",
"=",
"None",
",",
"mysql_password",
"... | Initialize GRR with no prompts.
Args:
config: config object
external_hostname: A hostname.
admin_password: A password used for the admin user.
mysql_hostname: A hostname used for establishing connection to MySQL.
mysql_port: A port used for establishing connection to MySQL.
mysql_username: A ... | [
"Initialize",
"GRR",
"with",
"no",
"prompts",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L538-L635 | train | Initialize GRR with no prompts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | UploadSignedBinary | def UploadSignedBinary(source_path,
binary_type,
platform,
upload_subdirectory=""):
"""Signs a binary and uploads it to the datastore.
Args:
source_path: Path to the binary to upload.
binary_type: Type of the binary, e.g python-hack or ex... | python | def UploadSignedBinary(source_path,
binary_type,
platform,
upload_subdirectory=""):
"""Signs a binary and uploads it to the datastore.
Args:
source_path: Path to the binary to upload.
binary_type: Type of the binary, e.g python-hack or ex... | [
"def",
"UploadSignedBinary",
"(",
"source_path",
",",
"binary_type",
",",
"platform",
",",
"upload_subdirectory",
"=",
"\"\"",
")",
":",
"file_size",
"=",
"os",
".",
"path",
".",
"getsize",
"(",
"source_path",
")",
"if",
"file_size",
">",
"_MAX_SIGNED_BINARY_BYT... | Signs a binary and uploads it to the datastore.
Args:
source_path: Path to the binary to upload.
binary_type: Type of the binary, e.g python-hack or executable.
platform: Client platform where the binary is intended to be run.
upload_subdirectory: Path of a subdirectory to upload the binary to,
... | [
"Signs",
"a",
"binary",
"and",
"uploads",
"it",
"to",
"the",
"datastore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L645-L686 | train | Uploads a binary to the datastore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | CreateUser | def CreateUser(username, password=None, is_admin=False):
"""Creates a new GRR user."""
grr_api = maintenance_utils.InitGRRRootAPI()
try:
user_exists = grr_api.GrrUser(username).Get() is not None
except api_errors.ResourceNotFoundError:
user_exists = False
if user_exists:
raise UserAlreadyExistsErr... | python | def CreateUser(username, password=None, is_admin=False):
"""Creates a new GRR user."""
grr_api = maintenance_utils.InitGRRRootAPI()
try:
user_exists = grr_api.GrrUser(username).Get() is not None
except api_errors.ResourceNotFoundError:
user_exists = False
if user_exists:
raise UserAlreadyExistsErr... | [
"def",
"CreateUser",
"(",
"username",
",",
"password",
"=",
"None",
",",
"is_admin",
"=",
"False",
")",
":",
"grr_api",
"=",
"maintenance_utils",
".",
"InitGRRRootAPI",
"(",
")",
"try",
":",
"user_exists",
"=",
"grr_api",
".",
"GrrUser",
"(",
"username",
"... | Creates a new GRR user. | [
"Creates",
"a",
"new",
"GRR",
"user",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L689-L701 | train | Creates a new GRR user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | UpdateUser | def UpdateUser(username, password=None, is_admin=False):
"""Updates the password or privilege-level for a user."""
user_type, password = _GetUserTypeAndPassword(
username, password=password, is_admin=is_admin)
grr_api = maintenance_utils.InitGRRRootAPI()
grr_user = grr_api.GrrUser(username).Get()
grr_us... | python | def UpdateUser(username, password=None, is_admin=False):
"""Updates the password or privilege-level for a user."""
user_type, password = _GetUserTypeAndPassword(
username, password=password, is_admin=is_admin)
grr_api = maintenance_utils.InitGRRRootAPI()
grr_user = grr_api.GrrUser(username).Get()
grr_us... | [
"def",
"UpdateUser",
"(",
"username",
",",
"password",
"=",
"None",
",",
"is_admin",
"=",
"False",
")",
":",
"user_type",
",",
"password",
"=",
"_GetUserTypeAndPassword",
"(",
"username",
",",
"password",
"=",
"password",
",",
"is_admin",
"=",
"is_admin",
")... | Updates the password or privilege-level for a user. | [
"Updates",
"the",
"password",
"or",
"privilege",
"-",
"level",
"for",
"a",
"user",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L704-L710 | train | Updates the password or privilege - level for a user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | GetUserSummary | def GetUserSummary(username):
"""Returns a string with summary info for a user."""
grr_api = maintenance_utils.InitGRRRootAPI()
try:
return _Summarize(grr_api.GrrUser(username).Get().data)
except api_errors.ResourceNotFoundError:
raise UserNotFoundError(username) | python | def GetUserSummary(username):
"""Returns a string with summary info for a user."""
grr_api = maintenance_utils.InitGRRRootAPI()
try:
return _Summarize(grr_api.GrrUser(username).Get().data)
except api_errors.ResourceNotFoundError:
raise UserNotFoundError(username) | [
"def",
"GetUserSummary",
"(",
"username",
")",
":",
"grr_api",
"=",
"maintenance_utils",
".",
"InitGRRRootAPI",
"(",
")",
"try",
":",
"return",
"_Summarize",
"(",
"grr_api",
".",
"GrrUser",
"(",
"username",
")",
".",
"Get",
"(",
")",
".",
"data",
")",
"e... | Returns a string with summary info for a user. | [
"Returns",
"a",
"string",
"with",
"summary",
"info",
"for",
"a",
"user",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L713-L719 | train | Returns a string with summary info for a user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | GetAllUserSummaries | def GetAllUserSummaries():
"""Returns a string containing summary info for all GRR users."""
grr_api = maintenance_utils.InitGRRRootAPI()
user_wrappers = sorted(grr_api.ListGrrUsers(), key=lambda x: x.username)
summaries = [_Summarize(w.data) for w in user_wrappers]
return "\n\n".join(summaries) | python | def GetAllUserSummaries():
"""Returns a string containing summary info for all GRR users."""
grr_api = maintenance_utils.InitGRRRootAPI()
user_wrappers = sorted(grr_api.ListGrrUsers(), key=lambda x: x.username)
summaries = [_Summarize(w.data) for w in user_wrappers]
return "\n\n".join(summaries) | [
"def",
"GetAllUserSummaries",
"(",
")",
":",
"grr_api",
"=",
"maintenance_utils",
".",
"InitGRRRootAPI",
"(",
")",
"user_wrappers",
"=",
"sorted",
"(",
"grr_api",
".",
"ListGrrUsers",
"(",
")",
",",
"key",
"=",
"lambda",
"x",
":",
"x",
".",
"username",
")"... | Returns a string containing summary info for all GRR users. | [
"Returns",
"a",
"string",
"containing",
"summary",
"info",
"for",
"all",
"GRR",
"users",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L722-L727 | train | Returns a string containing summary info for all GRR users. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | _Summarize | def _Summarize(user_info):
"""Returns a string with summary info for a user."""
return "Username: %s\nIs Admin: %s" % (
user_info.username,
user_info.user_type == api_user.ApiGrrUser.UserType.USER_TYPE_ADMIN) | python | def _Summarize(user_info):
"""Returns a string with summary info for a user."""
return "Username: %s\nIs Admin: %s" % (
user_info.username,
user_info.user_type == api_user.ApiGrrUser.UserType.USER_TYPE_ADMIN) | [
"def",
"_Summarize",
"(",
"user_info",
")",
":",
"return",
"\"Username: %s\\nIs Admin: %s\"",
"%",
"(",
"user_info",
".",
"username",
",",
"user_info",
".",
"user_type",
"==",
"api_user",
".",
"ApiGrrUser",
".",
"UserType",
".",
"USER_TYPE_ADMIN",
")"
] | Returns a string with summary info for a user. | [
"Returns",
"a",
"string",
"with",
"summary",
"info",
"for",
"a",
"user",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L730-L734 | train | Returns a string with summary info for a user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | DeleteUser | def DeleteUser(username):
"""Deletes a GRR user from the datastore."""
grr_api = maintenance_utils.InitGRRRootAPI()
try:
grr_api.GrrUser(username).Get().Delete()
except api_errors.ResourceNotFoundError:
raise UserNotFoundError(username) | python | def DeleteUser(username):
"""Deletes a GRR user from the datastore."""
grr_api = maintenance_utils.InitGRRRootAPI()
try:
grr_api.GrrUser(username).Get().Delete()
except api_errors.ResourceNotFoundError:
raise UserNotFoundError(username) | [
"def",
"DeleteUser",
"(",
"username",
")",
":",
"grr_api",
"=",
"maintenance_utils",
".",
"InitGRRRootAPI",
"(",
")",
"try",
":",
"grr_api",
".",
"GrrUser",
"(",
"username",
")",
".",
"Get",
"(",
")",
".",
"Delete",
"(",
")",
"except",
"api_errors",
".",... | Deletes a GRR user from the datastore. | [
"Deletes",
"a",
"GRR",
"user",
"from",
"the",
"datastore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L737-L743 | train | Deletes a GRR user from the datastore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/bin/config_updater_util.py | _GetUserTypeAndPassword | def _GetUserTypeAndPassword(username, password=None, is_admin=False):
"""Returns the user-type and password for a user.
Args:
username: Username for the user.
password: Password for the user. If None, or not provided, we will prompt
for one via the terminal.
is_admin: Indicates whether the user s... | python | def _GetUserTypeAndPassword(username, password=None, is_admin=False):
"""Returns the user-type and password for a user.
Args:
username: Username for the user.
password: Password for the user. If None, or not provided, we will prompt
for one via the terminal.
is_admin: Indicates whether the user s... | [
"def",
"_GetUserTypeAndPassword",
"(",
"username",
",",
"password",
"=",
"None",
",",
"is_admin",
"=",
"False",
")",
":",
"if",
"is_admin",
":",
"user_type",
"=",
"api_user",
".",
"ApiGrrUser",
".",
"UserType",
".",
"USER_TYPE_ADMIN",
"else",
":",
"user_type",... | Returns the user-type and password for a user.
Args:
username: Username for the user.
password: Password for the user. If None, or not provided, we will prompt
for one via the terminal.
is_admin: Indicates whether the user should have admin privileges. | [
"Returns",
"the",
"user",
"-",
"type",
"and",
"password",
"for",
"a",
"user",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/config_updater_util.py#L746-L765 | train | Returns the user - type and password for a user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flow_responses.py | Responses.FromResponses | def FromResponses(cls, request=None, responses=None):
"""Creates a Responses object from new style flow request and responses."""
res = cls()
res.request = request
if request:
res.request_data = request.request_data
for r in responses or []:
if isinstance(r, rdf_flow_objects.FlowRespons... | python | def FromResponses(cls, request=None, responses=None):
"""Creates a Responses object from new style flow request and responses."""
res = cls()
res.request = request
if request:
res.request_data = request.request_data
for r in responses or []:
if isinstance(r, rdf_flow_objects.FlowRespons... | [
"def",
"FromResponses",
"(",
"cls",
",",
"request",
"=",
"None",
",",
"responses",
"=",
"None",
")",
":",
"res",
"=",
"cls",
"(",
")",
"res",
".",
"request",
"=",
"request",
"if",
"request",
":",
"res",
".",
"request_data",
"=",
"request",
".",
"requ... | Creates a Responses object from new style flow request and responses. | [
"Creates",
"a",
"Responses",
"object",
"from",
"new",
"style",
"flow",
"request",
"and",
"responses",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flow_responses.py#L30-L47 | train | Creates a Responses object from new style flow request and responses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flow_responses.py | Responses.FromLegacyResponses | def FromLegacyResponses(cls, request=None, responses=None):
"""Creates a Responses object from old style flow request and responses."""
res = cls()
res.request = request
if request:
res.request_data = rdf_protodict.Dict(request.data)
dropped_responses = []
# The iterator that was returned ... | python | def FromLegacyResponses(cls, request=None, responses=None):
"""Creates a Responses object from old style flow request and responses."""
res = cls()
res.request = request
if request:
res.request_data = rdf_protodict.Dict(request.data)
dropped_responses = []
# The iterator that was returned ... | [
"def",
"FromLegacyResponses",
"(",
"cls",
",",
"request",
"=",
"None",
",",
"responses",
"=",
"None",
")",
":",
"res",
"=",
"cls",
"(",
")",
"res",
".",
"request",
"=",
"request",
"if",
"request",
":",
"res",
".",
"request_data",
"=",
"rdf_protodict",
... | Creates a Responses object from old style flow request and responses. | [
"Creates",
"a",
"Responses",
"object",
"from",
"old",
"style",
"flow",
"request",
"and",
"responses",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flow_responses.py#L50-L145 | train | Creates a Responses object from a legacy flow request and responses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/client_actions/admin.py | Kill.Run | def Run(self, unused_arg):
"""Run the kill."""
# Send a message back to the service to say that we are about to shutdown.
reply = rdf_flows.GrrStatus(status=rdf_flows.GrrStatus.ReturnedStatus.OK)
# Queue up the response message, jump the queue.
self.SendReply(reply, message_type=rdf_flows.GrrMessage... | python | def Run(self, unused_arg):
"""Run the kill."""
# Send a message back to the service to say that we are about to shutdown.
reply = rdf_flows.GrrStatus(status=rdf_flows.GrrStatus.ReturnedStatus.OK)
# Queue up the response message, jump the queue.
self.SendReply(reply, message_type=rdf_flows.GrrMessage... | [
"def",
"Run",
"(",
"self",
",",
"unused_arg",
")",
":",
"# Send a message back to the service to say that we are about to shutdown.",
"reply",
"=",
"rdf_flows",
".",
"GrrStatus",
"(",
"status",
"=",
"rdf_flows",
".",
"GrrStatus",
".",
"ReturnedStatus",
".",
"OK",
")",... | Run the kill. | [
"Run",
"the",
"kill",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/admin.py#L80-L92 | train | Runs the kill. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/client_actions/admin.py | GetConfiguration.Run | def Run(self, unused_arg):
"""Retrieve the configuration except for the blocked parameters."""
out = self.out_rdfvalues[0]()
for descriptor in config.CONFIG.type_infos:
if descriptor.name in self.BLOCKED_PARAMETERS:
value = "[Redacted]"
else:
try:
value = config.CONFIG... | python | def Run(self, unused_arg):
"""Retrieve the configuration except for the blocked parameters."""
out = self.out_rdfvalues[0]()
for descriptor in config.CONFIG.type_infos:
if descriptor.name in self.BLOCKED_PARAMETERS:
value = "[Redacted]"
else:
try:
value = config.CONFIG... | [
"def",
"Run",
"(",
"self",
",",
"unused_arg",
")",
":",
"out",
"=",
"self",
".",
"out_rdfvalues",
"[",
"0",
"]",
"(",
")",
"for",
"descriptor",
"in",
"config",
".",
"CONFIG",
".",
"type_infos",
":",
"if",
"descriptor",
".",
"name",
"in",
"self",
".",... | Retrieve the configuration except for the blocked parameters. | [
"Retrieve",
"the",
"configuration",
"except",
"for",
"the",
"blocked",
"parameters",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/admin.py#L143-L160 | train | Retrieve the configuration except for the blocked parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/client_actions/admin.py | UpdateConfiguration.Run | def Run(self, arg):
"""Does the actual work."""
try:
if self.grr_worker.client.FleetspeakEnabled():
raise ValueError("Not supported on Fleetspeak enabled clients.")
except AttributeError:
pass
smart_arg = {str(field): value for field, value in iteritems(arg)}
disallowed_fields ... | python | def Run(self, arg):
"""Does the actual work."""
try:
if self.grr_worker.client.FleetspeakEnabled():
raise ValueError("Not supported on Fleetspeak enabled clients.")
except AttributeError:
pass
smart_arg = {str(field): value for field, value in iteritems(arg)}
disallowed_fields ... | [
"def",
"Run",
"(",
"self",
",",
"arg",
")",
":",
"try",
":",
"if",
"self",
".",
"grr_worker",
".",
"client",
".",
"FleetspeakEnabled",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"Not supported on Fleetspeak enabled clients.\"",
")",
"except",
"AttributeError",... | Does the actual work. | [
"Does",
"the",
"actual",
"work",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/admin.py#L228-L274 | train | Does the actual work. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/client_actions/admin.py | GetClientStats.Run | def Run(self, arg):
"""Returns the client stats."""
if arg is None:
arg = rdf_client_action.GetClientStatsRequest()
proc = psutil.Process(os.getpid())
meminfo = proc.memory_info()
boot_time = rdfvalue.RDFDatetime.FromSecondsSinceEpoch(psutil.boot_time())
create_time = rdfvalue.RDFDatetime... | python | def Run(self, arg):
"""Returns the client stats."""
if arg is None:
arg = rdf_client_action.GetClientStatsRequest()
proc = psutil.Process(os.getpid())
meminfo = proc.memory_info()
boot_time = rdfvalue.RDFDatetime.FromSecondsSinceEpoch(psutil.boot_time())
create_time = rdfvalue.RDFDatetime... | [
"def",
"Run",
"(",
"self",
",",
"arg",
")",
":",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"rdf_client_action",
".",
"GetClientStatsRequest",
"(",
")",
"proc",
"=",
"psutil",
".",
"Process",
"(",
"os",
".",
"getpid",
"(",
")",
")",
"meminfo",
"=",
... | Returns the client stats. | [
"Returns",
"the",
"client",
"stats",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/admin.py#L299-L324 | train | Returns the client stats. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/client_actions/admin.py | SendStartupInfo.Run | def Run(self, unused_arg, ttl=None):
"""Returns the startup information."""
logging.debug("Sending startup information.")
boot_time = rdfvalue.RDFDatetime.FromSecondsSinceEpoch(psutil.boot_time())
response = rdf_client.StartupInfo(
boot_time=boot_time, client_info=GetClientInformation())
se... | python | def Run(self, unused_arg, ttl=None):
"""Returns the startup information."""
logging.debug("Sending startup information.")
boot_time = rdfvalue.RDFDatetime.FromSecondsSinceEpoch(psutil.boot_time())
response = rdf_client.StartupInfo(
boot_time=boot_time, client_info=GetClientInformation())
se... | [
"def",
"Run",
"(",
"self",
",",
"unused_arg",
",",
"ttl",
"=",
"None",
")",
":",
"logging",
".",
"debug",
"(",
"\"Sending startup information.\"",
")",
"boot_time",
"=",
"rdfvalue",
".",
"RDFDatetime",
".",
"FromSecondsSinceEpoch",
"(",
"psutil",
".",
"boot_ti... | Returns the startup information. | [
"Returns",
"the",
"startup",
"information",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/admin.py#L350-L364 | train | Sends the startup information. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/data_stores/common.py | ConvertStringToFilename | def ConvertStringToFilename(name):
"""Converts an unicode string to a filesystem safe filename.
For maximum compatibility we escape all chars which are not alphanumeric (in
the unicode sense).
Args:
name: a unicode string that is part of a subject.
Returns:
A safe filename with escaped special chars... | python | def ConvertStringToFilename(name):
"""Converts an unicode string to a filesystem safe filename.
For maximum compatibility we escape all chars which are not alphanumeric (in
the unicode sense).
Args:
name: a unicode string that is part of a subject.
Returns:
A safe filename with escaped special chars... | [
"def",
"ConvertStringToFilename",
"(",
"name",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r\"\\W\"",
",",
"lambda",
"x",
":",
"\"%%%02X\"",
"%",
"ord",
"(",
"x",
".",
"group",
"(",
"0",
")",
")",
",",
"name",
",",
"flags",
"=",
"re",
".",
"UNICODE... | Converts an unicode string to a filesystem safe filename.
For maximum compatibility we escape all chars which are not alphanumeric (in
the unicode sense).
Args:
name: a unicode string that is part of a subject.
Returns:
A safe filename with escaped special chars. | [
"Converts",
"an",
"unicode",
"string",
"to",
"a",
"filesystem",
"safe",
"filename",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/data_stores/common.py#L16-L30 | train | Converts an unicode string to a filesystem safe filename. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/data_stores/common.py | ResolveSubjectDestination | def ResolveSubjectDestination(subject, regexes):
"""Returns the directory/filename where the subject will be stored.
Args:
subject: The subject.
regexes: The list of regular expressions by priority.
Returns:
File name and directory.
"""
components = Components(subject)
if not components:
# No... | python | def ResolveSubjectDestination(subject, regexes):
"""Returns the directory/filename where the subject will be stored.
Args:
subject: The subject.
regexes: The list of regular expressions by priority.
Returns:
File name and directory.
"""
components = Components(subject)
if not components:
# No... | [
"def",
"ResolveSubjectDestination",
"(",
"subject",
",",
"regexes",
")",
":",
"components",
"=",
"Components",
"(",
"subject",
")",
"if",
"not",
"components",
":",
"# No components to work with.",
"return",
"\"aff4\"",
",",
"\"\"",
"# Make all the components safe to use... | Returns the directory/filename where the subject will be stored.
Args:
subject: The subject.
regexes: The list of regular expressions by priority.
Returns:
File name and directory. | [
"Returns",
"the",
"directory",
"/",
"filename",
"where",
"the",
"subject",
"will",
"be",
"stored",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/data_stores/common.py#L40-L65 | train | Resolves the destination of a subject. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/data_stores/common.py | MakeDestinationKey | def MakeDestinationKey(directory, filename):
"""Creates a name that identifies a database file."""
return utils.SmartStr(utils.JoinPath(directory, filename)).lstrip("/") | python | def MakeDestinationKey(directory, filename):
"""Creates a name that identifies a database file."""
return utils.SmartStr(utils.JoinPath(directory, filename)).lstrip("/") | [
"def",
"MakeDestinationKey",
"(",
"directory",
",",
"filename",
")",
":",
"return",
"utils",
".",
"SmartStr",
"(",
"utils",
".",
"JoinPath",
"(",
"directory",
",",
"filename",
")",
")",
".",
"lstrip",
"(",
"\"/\"",
")"
] | Creates a name that identifies a database file. | [
"Creates",
"a",
"name",
"that",
"identifies",
"a",
"database",
"file",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/data_stores/common.py#L68-L70 | train | Creates a name that identifies a database file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/data_stores/common.py | DatabaseDirectorySize | def DatabaseDirectorySize(root_path, extension):
"""Compute size (in bytes) and number of files of a file-based data store."""
directories = collections.deque([root_path])
total_size = 0
total_files = 0
while directories:
directory = directories.popleft()
try:
items = os.listdir(directory)
e... | python | def DatabaseDirectorySize(root_path, extension):
"""Compute size (in bytes) and number of files of a file-based data store."""
directories = collections.deque([root_path])
total_size = 0
total_files = 0
while directories:
directory = directories.popleft()
try:
items = os.listdir(directory)
e... | [
"def",
"DatabaseDirectorySize",
"(",
"root_path",
",",
"extension",
")",
":",
"directories",
"=",
"collections",
".",
"deque",
"(",
"[",
"root_path",
"]",
")",
"total_size",
"=",
"0",
"total_files",
"=",
"0",
"while",
"directories",
":",
"directory",
"=",
"d... | Compute size (in bytes) and number of files of a file-based data store. | [
"Compute",
"size",
"(",
"in",
"bytes",
")",
"and",
"number",
"of",
"files",
"of",
"a",
"file",
"-",
"based",
"data",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/data_stores/common.py#L73-L98 | train | Compute size ( in bytes ) and number of files of a file - based data store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | FileStore.GetChildrenByPriority | def GetChildrenByPriority(self, allow_external=True):
"""Generator that yields active filestore children in priority order."""
for child in sorted(self.OpenChildren(), key=lambda x: x.PRIORITY):
if not allow_external and child.EXTERNAL:
continue
if child.Get(child.Schema.ACTIVE):
yie... | python | def GetChildrenByPriority(self, allow_external=True):
"""Generator that yields active filestore children in priority order."""
for child in sorted(self.OpenChildren(), key=lambda x: x.PRIORITY):
if not allow_external and child.EXTERNAL:
continue
if child.Get(child.Schema.ACTIVE):
yie... | [
"def",
"GetChildrenByPriority",
"(",
"self",
",",
"allow_external",
"=",
"True",
")",
":",
"for",
"child",
"in",
"sorted",
"(",
"self",
".",
"OpenChildren",
"(",
")",
",",
"key",
"=",
"lambda",
"x",
":",
"x",
".",
"PRIORITY",
")",
":",
"if",
"not",
"... | Generator that yields active filestore children in priority order. | [
"Generator",
"that",
"yields",
"active",
"filestore",
"children",
"in",
"priority",
"order",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L42-L48 | train | Generator that yields active filestore children in priority order. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | FileStore.CheckHashes | def CheckHashes(self, hashes, external=True):
"""Checks a list of hashes for presence in the store.
Sub stores need to pass back the original HashDigest objects since they
carry state about the original file source.
Only unique hashes are checked, if there is duplication in the hashes input
it is ... | python | def CheckHashes(self, hashes, external=True):
"""Checks a list of hashes for presence in the store.
Sub stores need to pass back the original HashDigest objects since they
carry state about the original file source.
Only unique hashes are checked, if there is duplication in the hashes input
it is ... | [
"def",
"CheckHashes",
"(",
"self",
",",
"hashes",
",",
"external",
"=",
"True",
")",
":",
"hashes",
"=",
"set",
"(",
"hashes",
")",
"for",
"child",
"in",
"self",
".",
"GetChildrenByPriority",
"(",
"allow_external",
"=",
"external",
")",
":",
"for",
"urn"... | Checks a list of hashes for presence in the store.
Sub stores need to pass back the original HashDigest objects since they
carry state about the original file source.
Only unique hashes are checked, if there is duplication in the hashes input
it is the caller's responsibility to maintain any necessary... | [
"Checks",
"a",
"list",
"of",
"hashes",
"for",
"presence",
"in",
"the",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L57-L82 | train | Checks a list of hashes for presence in the store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | FileStore.AddFile | def AddFile(self, fd, external=True):
"""Create a new file in the file store.
We delegate the actual file addition to our contained
implementations. Implementations can either implement the AddFile() method,
returning a file like object which will be written on, or directly support
the AddBlobToSto... | python | def AddFile(self, fd, external=True):
"""Create a new file in the file store.
We delegate the actual file addition to our contained
implementations. Implementations can either implement the AddFile() method,
returning a file like object which will be written on, or directly support
the AddBlobToSto... | [
"def",
"AddFile",
"(",
"self",
",",
"fd",
",",
"external",
"=",
"True",
")",
":",
"files_for_write",
"=",
"[",
"]",
"for",
"sub_store",
"in",
"self",
".",
"GetChildrenByPriority",
"(",
"allow_external",
"=",
"external",
")",
":",
"new_file",
"=",
"sub_stor... | Create a new file in the file store.
We delegate the actual file addition to our contained
implementations. Implementations can either implement the AddFile() method,
returning a file like object which will be written on, or directly support
the AddBlobToStore() method which can copy the VFSBlobImage e... | [
"Create",
"a",
"new",
"file",
"in",
"the",
"file",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L84-L114 | train | Add a file to the file store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore.Query | def Query(cls, index_urn, target_prefix="", limit=100, token=None):
"""Search the index for matches starting with target_prefix.
Args:
index_urn: The index to use. Should be a urn that points to the sha256
namespace.
target_prefix: The prefix to match against the index.
limit: Eit... | python | def Query(cls, index_urn, target_prefix="", limit=100, token=None):
"""Search the index for matches starting with target_prefix.
Args:
index_urn: The index to use. Should be a urn that points to the sha256
namespace.
target_prefix: The prefix to match against the index.
limit: Eit... | [
"def",
"Query",
"(",
"cls",
",",
"index_urn",
",",
"target_prefix",
"=",
"\"\"",
",",
"limit",
"=",
"100",
",",
"token",
"=",
"None",
")",
":",
"return",
"data_store",
".",
"DB",
".",
"FileHashIndexQuery",
"(",
"index_urn",
",",
"target_prefix",
",",
"li... | Search the index for matches starting with target_prefix.
Args:
index_urn: The index to use. Should be a urn that points to the sha256
namespace.
target_prefix: The prefix to match against the index.
limit: Either a tuple of (start, limit) or a maximum number of results to
re... | [
"Search",
"the",
"index",
"for",
"matches",
"starting",
"with",
"target_prefix",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L212-L228 | train | Query the index for matches starting with target_prefix. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore.CheckHashes | def CheckHashes(self, hashes):
"""Check hashes against the filestore.
Blobs use the hash in the schema:
aff4:/files/hash/generic/sha256/[sha256hash]
Args:
hashes: A list of Hash objects to check.
Yields:
Tuples of (RDFURN, hash object) that exist in the store.
"""
hash_map = {... | python | def CheckHashes(self, hashes):
"""Check hashes against the filestore.
Blobs use the hash in the schema:
aff4:/files/hash/generic/sha256/[sha256hash]
Args:
hashes: A list of Hash objects to check.
Yields:
Tuples of (RDFURN, hash object) that exist in the store.
"""
hash_map = {... | [
"def",
"CheckHashes",
"(",
"self",
",",
"hashes",
")",
":",
"hash_map",
"=",
"{",
"}",
"for",
"hsh",
"in",
"hashes",
":",
"if",
"hsh",
".",
"HasField",
"(",
"\"sha256\"",
")",
":",
"# The canonical name of the file is where we store the file hash.",
"hash_map",
... | Check hashes against the filestore.
Blobs use the hash in the schema:
aff4:/files/hash/generic/sha256/[sha256hash]
Args:
hashes: A list of Hash objects to check.
Yields:
Tuples of (RDFURN, hash object) that exist in the store. | [
"Check",
"hashes",
"against",
"the",
"filestore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L253-L273 | train | Checks the hashes against the filestore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore._HashFile | def _HashFile(self, fd):
"""Look for the required hashes in the file."""
hashes = data_store_utils.GetFileHashEntry(fd)
if hashes:
found_all = True
for fingerprint_type, hash_types in iteritems(self.HASH_TYPES):
for hash_type in hash_types:
if fingerprint_type == "pecoff":
... | python | def _HashFile(self, fd):
"""Look for the required hashes in the file."""
hashes = data_store_utils.GetFileHashEntry(fd)
if hashes:
found_all = True
for fingerprint_type, hash_types in iteritems(self.HASH_TYPES):
for hash_type in hash_types:
if fingerprint_type == "pecoff":
... | [
"def",
"_HashFile",
"(",
"self",
",",
"fd",
")",
":",
"hashes",
"=",
"data_store_utils",
".",
"GetFileHashEntry",
"(",
"fd",
")",
"if",
"hashes",
":",
"found_all",
"=",
"True",
"for",
"fingerprint_type",
",",
"hash_types",
"in",
"iteritems",
"(",
"self",
"... | Look for the required hashes in the file. | [
"Look",
"for",
"the",
"required",
"hashes",
"in",
"the",
"file",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L282-L336 | train | Get the required hashes in the file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore.AddFile | def AddFile(self, fd):
"""Adds a file to the hash file store.
We take a file in the client space:
aff4:/C.123123123/fs/os/usr/local/blah
Hash it, update the hash in the original file if its different to the
one calculated on the client, and copy the original AFF4 object to
aff4:/files/has... | python | def AddFile(self, fd):
"""Adds a file to the hash file store.
We take a file in the client space:
aff4:/C.123123123/fs/os/usr/local/blah
Hash it, update the hash in the original file if its different to the
one calculated on the client, and copy the original AFF4 object to
aff4:/files/has... | [
"def",
"AddFile",
"(",
"self",
",",
"fd",
")",
":",
"hashes",
"=",
"self",
".",
"_HashFile",
"(",
"fd",
")",
"# The empty file is very common, we don't keep the back references for it",
"# in the DB since it just takes up too much space.",
"empty_hash",
"=",
"(",
"\"e3b0c44... | Adds a file to the hash file store.
We take a file in the client space:
aff4:/C.123123123/fs/os/usr/local/blah
Hash it, update the hash in the original file if its different to the
one calculated on the client, and copy the original AFF4 object to
aff4:/files/hash/generic/sha256/123123123 (ca... | [
"Adds",
"a",
"file",
"to",
"the",
"hash",
"file",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L338-L415 | train | Adds a file to the hash file store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore.ListHashes | def ListHashes(age=aff4.NEWEST_TIME):
"""Yields all the hashes in the file store.
Args:
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be aff4.NEWEST_TIME or a time range given as a tuple
(start, end) in microseconds since Jan 1st, 1970. If just a m... | python | def ListHashes(age=aff4.NEWEST_TIME):
"""Yields all the hashes in the file store.
Args:
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be aff4.NEWEST_TIME or a time range given as a tuple
(start, end) in microseconds since Jan 1st, 1970. If just a m... | [
"def",
"ListHashes",
"(",
"age",
"=",
"aff4",
".",
"NEWEST_TIME",
")",
":",
"if",
"age",
"==",
"aff4",
".",
"ALL_TIMES",
":",
"raise",
"ValueError",
"(",
"\"age==aff4.ALL_TIMES is not allowed.\"",
")",
"urns",
"=",
"[",
"]",
"for",
"fingerprint_type",
",",
"... | Yields all the hashes in the file store.
Args:
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be aff4.NEWEST_TIME or a time range given as a tuple
(start, end) in microseconds since Jan 1st, 1970. If just a microseconds
value is given it's treat... | [
"Yields",
"all",
"the",
"hashes",
"in",
"the",
"file",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L418-L444 | train | Returns all the hashes in the file store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore.GetClientsForHash | def GetClientsForHash(cls, hash_obj, token=None, age=aff4.NEWEST_TIME):
"""Yields client_files for the specified file store hash.
Args:
hash_obj: RDFURN that we want to get hits for.
token: Security token.
age: AFF4 age specification. Only get hits corresponding to the given age
spec.... | python | def GetClientsForHash(cls, hash_obj, token=None, age=aff4.NEWEST_TIME):
"""Yields client_files for the specified file store hash.
Args:
hash_obj: RDFURN that we want to get hits for.
token: Security token.
age: AFF4 age specification. Only get hits corresponding to the given age
spec.... | [
"def",
"GetClientsForHash",
"(",
"cls",
",",
"hash_obj",
",",
"token",
"=",
"None",
",",
"age",
"=",
"aff4",
".",
"NEWEST_TIME",
")",
":",
"if",
"age",
"==",
"aff4",
".",
"ALL_TIMES",
":",
"raise",
"ValueError",
"(",
"\"age==aff4.ALL_TIMES is not supported.\""... | Yields client_files for the specified file store hash.
Args:
hash_obj: RDFURN that we want to get hits for.
token: Security token.
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be aff4.NEWEST_TIME or a time range given as a tuple
(start, en... | [
"Yields",
"client_files",
"for",
"the",
"specified",
"file",
"store",
"hash",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L447-L472 | train | Retrieves all clients for the given hash. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | HashFileStore.GetClientsForHashes | def GetClientsForHashes(cls, hashes, token=None, age=aff4.NEWEST_TIME):
"""Yields (hash, client_files) pairs for all the specified hashes.
Args:
hashes: List of RDFURN's.
token: Security token.
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be a... | python | def GetClientsForHashes(cls, hashes, token=None, age=aff4.NEWEST_TIME):
"""Yields (hash, client_files) pairs for all the specified hashes.
Args:
hashes: List of RDFURN's.
token: Security token.
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be a... | [
"def",
"GetClientsForHashes",
"(",
"cls",
",",
"hashes",
",",
"token",
"=",
"None",
",",
"age",
"=",
"aff4",
".",
"NEWEST_TIME",
")",
":",
"if",
"age",
"==",
"aff4",
".",
"ALL_TIMES",
":",
"raise",
"ValueError",
"(",
"\"age==aff4.ALL_TIMES is not supported.\""... | Yields (hash, client_files) pairs for all the specified hashes.
Args:
hashes: List of RDFURN's.
token: Security token.
age: AFF4 age specification. Only get hits corresponding to the given age
spec. Should be aff4.NEWEST_TIME or a time range given as a tuple
(start, end) in micros... | [
"Yields",
"(",
"hash",
"client_files",
")",
"pairs",
"for",
"all",
"the",
"specified",
"hashes",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L475-L508 | train | Retrieves all the clients for the given hashes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | NSRLFileStore.CheckHashes | def CheckHashes(self, hashes, unused_external=True):
"""Checks a list of hashes for presence in the store.
Only unique sha1 hashes are checked, if there is duplication in the hashes
input it is the caller's responsibility to maintain any necessary mappings.
Args:
hashes: A list of Hash objects t... | python | def CheckHashes(self, hashes, unused_external=True):
"""Checks a list of hashes for presence in the store.
Only unique sha1 hashes are checked, if there is duplication in the hashes
input it is the caller's responsibility to maintain any necessary mappings.
Args:
hashes: A list of Hash objects t... | [
"def",
"CheckHashes",
"(",
"self",
",",
"hashes",
",",
"unused_external",
"=",
"True",
")",
":",
"hash_map",
"=",
"{",
"}",
"for",
"hsh",
"in",
"hashes",
":",
"if",
"hsh",
".",
"HasField",
"(",
"\"sha1\"",
")",
":",
"hash_urn",
"=",
"self",
".",
"PAT... | Checks a list of hashes for presence in the store.
Only unique sha1 hashes are checked, if there is duplication in the hashes
input it is the caller's responsibility to maintain any necessary mappings.
Args:
hashes: A list of Hash objects to check.
unused_external: Ignored.
Yields:
... | [
"Checks",
"a",
"list",
"of",
"hashes",
"for",
"presence",
"in",
"the",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L568-L589 | train | Checks a list of hashes for presence in the store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | NSRLFileStore.AddHash | def AddHash(self, sha1, md5, crc, file_name, file_size, product_code_list,
op_system_code_list, special_code):
"""Adds a new file from the NSRL hash database.
We create a new subject in:
aff4:/files/nsrl/<sha1>
with all the other arguments as attributes.
Args:
sha1: SHA1 dige... | python | def AddHash(self, sha1, md5, crc, file_name, file_size, product_code_list,
op_system_code_list, special_code):
"""Adds a new file from the NSRL hash database.
We create a new subject in:
aff4:/files/nsrl/<sha1>
with all the other arguments as attributes.
Args:
sha1: SHA1 dige... | [
"def",
"AddHash",
"(",
"self",
",",
"sha1",
",",
"md5",
",",
"crc",
",",
"file_name",
",",
"file_size",
",",
"product_code_list",
",",
"op_system_code_list",
",",
"special_code",
")",
":",
"file_store_urn",
"=",
"self",
".",
"PATH",
".",
"Add",
"(",
"sha1"... | Adds a new file from the NSRL hash database.
We create a new subject in:
aff4:/files/nsrl/<sha1>
with all the other arguments as attributes.
Args:
sha1: SHA1 digest as a hex encoded string.
md5: MD5 digest as a hex encoded string.
crc: File CRC as an integer.
file_name: Filen... | [
"Adds",
"a",
"new",
"file",
"from",
"the",
"NSRL",
"hash",
"database",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L591-L624 | train | Adds a new file from the NSRL hash database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/aff4_objects/filestore.py | FileStoreInit.Run | def Run(self):
"""Create FileStore and HashFileStore namespaces."""
if not data_store.AFF4Enabled():
return
try:
filestore = aff4.FACTORY.Create(
FileStore.PATH, FileStore, mode="rw", token=aff4.FACTORY.root_token)
filestore.Close()
hash_filestore = aff4.FACTORY.Create(
... | python | def Run(self):
"""Create FileStore and HashFileStore namespaces."""
if not data_store.AFF4Enabled():
return
try:
filestore = aff4.FACTORY.Create(
FileStore.PATH, FileStore, mode="rw", token=aff4.FACTORY.root_token)
filestore.Close()
hash_filestore = aff4.FACTORY.Create(
... | [
"def",
"Run",
"(",
"self",
")",
":",
"if",
"not",
"data_store",
".",
"AFF4Enabled",
"(",
")",
":",
"return",
"try",
":",
"filestore",
"=",
"aff4",
".",
"FACTORY",
".",
"Create",
"(",
"FileStore",
".",
"PATH",
",",
"FileStore",
",",
"mode",
"=",
"\"rw... | Create FileStore and HashFileStore namespaces. | [
"Create",
"FileStore",
"and",
"HashFileStore",
"namespaces",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/aff4_objects/filestore.py#L636-L660 | train | Create FileStore and HashFileStore namespaces. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/databases/mysql_artifacts.py | MySQLDBArtifactsMixin.WriteArtifact | def WriteArtifact(self, artifact, cursor=None):
"""Writes new artifact to the database."""
name = Text(artifact.name)
try:
cursor.execute("INSERT INTO artifacts (name, definition) VALUES (%s, %s)",
[name, artifact.SerializeToString()])
except MySQLdb.IntegrityError as error:
... | python | def WriteArtifact(self, artifact, cursor=None):
"""Writes new artifact to the database."""
name = Text(artifact.name)
try:
cursor.execute("INSERT INTO artifacts (name, definition) VALUES (%s, %s)",
[name, artifact.SerializeToString()])
except MySQLdb.IntegrityError as error:
... | [
"def",
"WriteArtifact",
"(",
"self",
",",
"artifact",
",",
"cursor",
"=",
"None",
")",
":",
"name",
"=",
"Text",
"(",
"artifact",
".",
"name",
")",
"try",
":",
"cursor",
".",
"execute",
"(",
"\"INSERT INTO artifacts (name, definition) VALUES (%s, %s)\"",
",",
... | Writes new artifact to the database. | [
"Writes",
"new",
"artifact",
"to",
"the",
"database",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_artifacts.py#L24-L35 | train | Writes a new artifact to the database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/databases/mysql_artifacts.py | MySQLDBArtifactsMixin.ReadArtifact | def ReadArtifact(self, name, cursor=None):
"""Looks up an artifact with given name from the database."""
cursor.execute("SELECT definition FROM artifacts WHERE name = %s", [name])
row = cursor.fetchone()
if row is None:
raise db.UnknownArtifactError(name)
else:
return _RowToArtifact(row... | python | def ReadArtifact(self, name, cursor=None):
"""Looks up an artifact with given name from the database."""
cursor.execute("SELECT definition FROM artifacts WHERE name = %s", [name])
row = cursor.fetchone()
if row is None:
raise db.UnknownArtifactError(name)
else:
return _RowToArtifact(row... | [
"def",
"ReadArtifact",
"(",
"self",
",",
"name",
",",
"cursor",
"=",
"None",
")",
":",
"cursor",
".",
"execute",
"(",
"\"SELECT definition FROM artifacts WHERE name = %s\"",
",",
"[",
"name",
"]",
")",
"row",
"=",
"cursor",
".",
"fetchone",
"(",
")",
"if",
... | Looks up an artifact with given name from the database. | [
"Looks",
"up",
"an",
"artifact",
"with",
"given",
"name",
"from",
"the",
"database",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_artifacts.py#L38-L46 | train | Reads an artifact from the database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/databases/mysql_artifacts.py | MySQLDBArtifactsMixin.ReadAllArtifacts | def ReadAllArtifacts(self, cursor=None):
"""Lists all artifacts that are stored in the database."""
cursor.execute("SELECT definition FROM artifacts")
return [_RowToArtifact(row) for row in cursor.fetchall()] | python | def ReadAllArtifacts(self, cursor=None):
"""Lists all artifacts that are stored in the database."""
cursor.execute("SELECT definition FROM artifacts")
return [_RowToArtifact(row) for row in cursor.fetchall()] | [
"def",
"ReadAllArtifacts",
"(",
"self",
",",
"cursor",
"=",
"None",
")",
":",
"cursor",
".",
"execute",
"(",
"\"SELECT definition FROM artifacts\"",
")",
"return",
"[",
"_RowToArtifact",
"(",
"row",
")",
"for",
"row",
"in",
"cursor",
".",
"fetchall",
"(",
")... | Lists all artifacts that are stored in the database. | [
"Lists",
"all",
"artifacts",
"that",
"are",
"stored",
"in",
"the",
"database",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_artifacts.py#L49-L52 | train | Reads all artifacts from the database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/databases/mysql_artifacts.py | MySQLDBArtifactsMixin.DeleteArtifact | def DeleteArtifact(self, name, cursor=None):
"""Deletes an artifact with given name from the database."""
cursor.execute("DELETE FROM artifacts WHERE name = %s", [name])
if cursor.rowcount == 0:
raise db.UnknownArtifactError(name) | python | def DeleteArtifact(self, name, cursor=None):
"""Deletes an artifact with given name from the database."""
cursor.execute("DELETE FROM artifacts WHERE name = %s", [name])
if cursor.rowcount == 0:
raise db.UnknownArtifactError(name) | [
"def",
"DeleteArtifact",
"(",
"self",
",",
"name",
",",
"cursor",
"=",
"None",
")",
":",
"cursor",
".",
"execute",
"(",
"\"DELETE FROM artifacts WHERE name = %s\"",
",",
"[",
"name",
"]",
")",
"if",
"cursor",
".",
"rowcount",
"==",
"0",
":",
"raise",
"db",... | Deletes an artifact with given name from the database. | [
"Deletes",
"an",
"artifact",
"with",
"given",
"name",
"from",
"the",
"database",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_artifacts.py#L55-L61 | train | Deletes an artifact with given name from the database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/ca_enroller.py | Enroler.ProcessMessage | def ProcessMessage(self, message):
"""Begins an enrollment flow for this client.
Args:
message: The Certificate sent by the client. Note that this message is
not authenticated.
"""
cert = rdf_crypto.Certificate(message.payload)
queue = self.well_known_session_id.Queue()
clie... | python | def ProcessMessage(self, message):
"""Begins an enrollment flow for this client.
Args:
message: The Certificate sent by the client. Note that this message is
not authenticated.
"""
cert = rdf_crypto.Certificate(message.payload)
queue = self.well_known_session_id.Queue()
clie... | [
"def",
"ProcessMessage",
"(",
"self",
",",
"message",
")",
":",
"cert",
"=",
"rdf_crypto",
".",
"Certificate",
"(",
"message",
".",
"payload",
")",
"queue",
"=",
"self",
".",
"well_known_session_id",
".",
"Queue",
"(",
")",
"client_id",
"=",
"message",
"."... | Begins an enrollment flow for this client.
Args:
message: The Certificate sent by the client. Note that this message is
not authenticated. | [
"Begins",
"an",
"enrollment",
"flow",
"for",
"this",
"client",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/ca_enroller.py#L107-L158 | train | Processes a certificate message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/fleetspeak_client.py | GRRFleetspeakClient.Run | def Run(self):
"""The main run method of the client."""
for thread in itervalues(self._threads):
thread.start()
logging.info(START_STRING)
while True:
dead_threads = [
tn for (tn, t) in iteritems(self._threads) if not t.isAlive()
]
if dead_threads:
raise FatalE... | python | def Run(self):
"""The main run method of the client."""
for thread in itervalues(self._threads):
thread.start()
logging.info(START_STRING)
while True:
dead_threads = [
tn for (tn, t) in iteritems(self._threads) if not t.isAlive()
]
if dead_threads:
raise FatalE... | [
"def",
"Run",
"(",
"self",
")",
":",
"for",
"thread",
"in",
"itervalues",
"(",
"self",
".",
"_threads",
")",
":",
"thread",
".",
"start",
"(",
")",
"logging",
".",
"info",
"(",
"START_STRING",
")",
"while",
"True",
":",
"dead_threads",
"=",
"[",
"tn"... | The main run method of the client. | [
"The",
"main",
"run",
"method",
"of",
"the",
"client",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/fleetspeak_client.py#L107-L120 | train | The main run method of the client. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/fleetspeak_client.py | GRRFleetspeakClient._ForemanOp | def _ForemanOp(self):
"""Sends Foreman checks periodically."""
period = config.CONFIG["Client.foreman_check_frequency"]
self._threads["Worker"].SendReply(
rdf_protodict.DataBlob(),
session_id=rdfvalue.FlowSessionID(flow_name="Foreman"),
require_fastpoll=False)
time.sleep(period) | python | def _ForemanOp(self):
"""Sends Foreman checks periodically."""
period = config.CONFIG["Client.foreman_check_frequency"]
self._threads["Worker"].SendReply(
rdf_protodict.DataBlob(),
session_id=rdfvalue.FlowSessionID(flow_name="Foreman"),
require_fastpoll=False)
time.sleep(period) | [
"def",
"_ForemanOp",
"(",
"self",
")",
":",
"period",
"=",
"config",
".",
"CONFIG",
"[",
"\"Client.foreman_check_frequency\"",
"]",
"self",
".",
"_threads",
"[",
"\"Worker\"",
"]",
".",
"SendReply",
"(",
"rdf_protodict",
".",
"DataBlob",
"(",
")",
",",
"sess... | Sends Foreman checks periodically. | [
"Sends",
"Foreman",
"checks",
"periodically",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/fleetspeak_client.py#L122-L129 | train | Sends Foreman checks periodically. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/fleetspeak_client.py | GRRFleetspeakClient._SendMessages | def _SendMessages(self, grr_msgs, background=False):
"""Sends a block of messages through Fleetspeak."""
message_list = rdf_flows.PackedMessageList()
communicator.Communicator.EncodeMessageList(
rdf_flows.MessageList(job=grr_msgs), message_list)
fs_msg = fs_common_pb2.Message(
message_ty... | python | def _SendMessages(self, grr_msgs, background=False):
"""Sends a block of messages through Fleetspeak."""
message_list = rdf_flows.PackedMessageList()
communicator.Communicator.EncodeMessageList(
rdf_flows.MessageList(job=grr_msgs), message_list)
fs_msg = fs_common_pb2.Message(
message_ty... | [
"def",
"_SendMessages",
"(",
"self",
",",
"grr_msgs",
",",
"background",
"=",
"False",
")",
":",
"message_list",
"=",
"rdf_flows",
".",
"PackedMessageList",
"(",
")",
"communicator",
".",
"Communicator",
".",
"EncodeMessageList",
"(",
"rdf_flows",
".",
"MessageL... | Sends a block of messages through Fleetspeak. | [
"Sends",
"a",
"block",
"of",
"messages",
"through",
"Fleetspeak",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/fleetspeak_client.py#L131-L149 | train | Sends a block of messages through Fleetspeak. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/fleetspeak_client.py | GRRFleetspeakClient._SendOp | def _SendOp(self):
"""Sends messages through Fleetspeak."""
msg = self._sender_queue.get()
msgs = []
background_msgs = []
if not msg.require_fastpoll:
background_msgs.append(msg)
else:
msgs.append(msg)
count = 1
size = len(msg.SerializeToString())
while count < 100 and ... | python | def _SendOp(self):
"""Sends messages through Fleetspeak."""
msg = self._sender_queue.get()
msgs = []
background_msgs = []
if not msg.require_fastpoll:
background_msgs.append(msg)
else:
msgs.append(msg)
count = 1
size = len(msg.SerializeToString())
while count < 100 and ... | [
"def",
"_SendOp",
"(",
"self",
")",
":",
"msg",
"=",
"self",
".",
"_sender_queue",
".",
"get",
"(",
")",
"msgs",
"=",
"[",
"]",
"background_msgs",
"=",
"[",
"]",
"if",
"not",
"msg",
".",
"require_fastpoll",
":",
"background_msgs",
".",
"append",
"(",
... | Sends messages through Fleetspeak. | [
"Sends",
"messages",
"through",
"Fleetspeak",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/fleetspeak_client.py#L151-L179 | train | Sends messages through Fleetspeak. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/fleetspeak_client.py | GRRFleetspeakClient._ReceiveOp | def _ReceiveOp(self):
"""Receives a single message through Fleetspeak."""
try:
fs_msg, received_bytes = self._fs.Recv()
except (IOError, struct.error):
logging.critical("Broken local Fleetspeak connection (read end).")
raise
received_type = fs_msg.data.TypeName()
if not received_t... | python | def _ReceiveOp(self):
"""Receives a single message through Fleetspeak."""
try:
fs_msg, received_bytes = self._fs.Recv()
except (IOError, struct.error):
logging.critical("Broken local Fleetspeak connection (read end).")
raise
received_type = fs_msg.data.TypeName()
if not received_t... | [
"def",
"_ReceiveOp",
"(",
"self",
")",
":",
"try",
":",
"fs_msg",
",",
"received_bytes",
"=",
"self",
".",
"_fs",
".",
"Recv",
"(",
")",
"except",
"(",
"IOError",
",",
"struct",
".",
"error",
")",
":",
"logging",
".",
"critical",
"(",
"\"Broken local F... | Receives a single message through Fleetspeak. | [
"Receives",
"a",
"single",
"message",
"through",
"Fleetspeak",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/fleetspeak_client.py#L181-L202 | train | Receives a single message through Fleetspeak. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | DeleteArtifactsFromDatastore | def DeleteArtifactsFromDatastore(artifact_names, reload_artifacts=True):
"""Deletes a list of artifacts from the data store."""
artifacts_list = sorted(
REGISTRY.GetArtifacts(reload_datastore_artifacts=reload_artifacts))
to_delete = set(artifact_names)
deps = set()
for artifact_obj in artifacts_list:
... | python | def DeleteArtifactsFromDatastore(artifact_names, reload_artifacts=True):
"""Deletes a list of artifacts from the data store."""
artifacts_list = sorted(
REGISTRY.GetArtifacts(reload_datastore_artifacts=reload_artifacts))
to_delete = set(artifact_names)
deps = set()
for artifact_obj in artifacts_list:
... | [
"def",
"DeleteArtifactsFromDatastore",
"(",
"artifact_names",
",",
"reload_artifacts",
"=",
"True",
")",
":",
"artifacts_list",
"=",
"sorted",
"(",
"REGISTRY",
".",
"GetArtifacts",
"(",
"reload_datastore_artifacts",
"=",
"reload_artifacts",
")",
")",
"to_delete",
"=",... | Deletes a list of artifacts from the data store. | [
"Deletes",
"a",
"list",
"of",
"artifacts",
"from",
"the",
"data",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L522-L572 | train | Deletes a list of artifacts from the data store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ValidateSyntax | def ValidateSyntax(rdf_artifact):
"""Validates artifact syntax.
This method can be used to validate individual artifacts as they are loaded,
without needing all artifacts to be loaded first, as for Validate().
Args:
rdf_artifact: RDF object artifact.
Raises:
ArtifactSyntaxError: If artifact syntax ... | python | def ValidateSyntax(rdf_artifact):
"""Validates artifact syntax.
This method can be used to validate individual artifacts as they are loaded,
without needing all artifacts to be loaded first, as for Validate().
Args:
rdf_artifact: RDF object artifact.
Raises:
ArtifactSyntaxError: If artifact syntax ... | [
"def",
"ValidateSyntax",
"(",
"rdf_artifact",
")",
":",
"if",
"not",
"rdf_artifact",
".",
"doc",
":",
"raise",
"rdf_artifacts",
".",
"ArtifactSyntaxError",
"(",
"rdf_artifact",
",",
"\"missing doc\"",
")",
"for",
"supp_os",
"in",
"rdf_artifact",
".",
"supported_os... | Validates artifact syntax.
This method can be used to validate individual artifacts as they are loaded,
without needing all artifacts to be loaded first, as for Validate().
Args:
rdf_artifact: RDF object artifact.
Raises:
ArtifactSyntaxError: If artifact syntax is invalid. | [
"Validates",
"artifact",
"syntax",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L575-L629 | train | Validates artifact syntax. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ValidateDependencies | def ValidateDependencies(rdf_artifact):
"""Validates artifact dependencies.
This method checks whether all dependencies of the artifact are present
and contain no errors.
This method can be called only after all other artifacts have been loaded.
Args:
rdf_artifact: RDF object artifact.
Raises:
A... | python | def ValidateDependencies(rdf_artifact):
"""Validates artifact dependencies.
This method checks whether all dependencies of the artifact are present
and contain no errors.
This method can be called only after all other artifacts have been loaded.
Args:
rdf_artifact: RDF object artifact.
Raises:
A... | [
"def",
"ValidateDependencies",
"(",
"rdf_artifact",
")",
":",
"for",
"dependency",
"in",
"GetArtifactDependencies",
"(",
"rdf_artifact",
")",
":",
"try",
":",
"dependency_obj",
"=",
"REGISTRY",
".",
"GetArtifact",
"(",
"dependency",
")",
"except",
"rdf_artifacts",
... | Validates artifact dependencies.
This method checks whether all dependencies of the artifact are present
and contain no errors.
This method can be called only after all other artifacts have been loaded.
Args:
rdf_artifact: RDF object artifact.
Raises:
ArtifactDependencyError: If a dependency is mi... | [
"Validates",
"artifact",
"dependencies",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L632-L656 | train | Validates artifact dependencies. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | GetArtifactDependencies | def GetArtifactDependencies(rdf_artifact, recursive=False, depth=1):
"""Return a set of artifact dependencies.
Args:
rdf_artifact: RDF object artifact.
recursive: If True recurse into dependencies to find their dependencies.
depth: Used for limiting recursion depth.
Returns:
A set of strings con... | python | def GetArtifactDependencies(rdf_artifact, recursive=False, depth=1):
"""Return a set of artifact dependencies.
Args:
rdf_artifact: RDF object artifact.
recursive: If True recurse into dependencies to find their dependencies.
depth: Used for limiting recursion depth.
Returns:
A set of strings con... | [
"def",
"GetArtifactDependencies",
"(",
"rdf_artifact",
",",
"recursive",
"=",
"False",
",",
"depth",
"=",
"1",
")",
":",
"deps",
"=",
"set",
"(",
")",
"for",
"source",
"in",
"rdf_artifact",
".",
"sources",
":",
"# ARTIFACT is the legacy name for ARTIFACT_GROUP",
... | Return a set of artifact dependencies.
Args:
rdf_artifact: RDF object artifact.
recursive: If True recurse into dependencies to find their dependencies.
depth: Used for limiting recursion depth.
Returns:
A set of strings containing the dependent artifact names.
Raises:
RuntimeError: If maxi... | [
"Return",
"a",
"set",
"of",
"artifact",
"dependencies",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L675-L710 | train | Returns a set of artifact names that depend on the given artifact. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | GetArtifactsDependenciesClosure | def GetArtifactsDependenciesClosure(name_list, os_name=None):
"""For all the artifacts in the list returns them and their dependencies."""
artifacts = set(REGISTRY.GetArtifacts(os_name=os_name, name_list=name_list))
dependencies = set()
for art in artifacts:
dependencies.update(GetArtifactDependencies(art... | python | def GetArtifactsDependenciesClosure(name_list, os_name=None):
"""For all the artifacts in the list returns them and their dependencies."""
artifacts = set(REGISTRY.GetArtifacts(os_name=os_name, name_list=name_list))
dependencies = set()
for art in artifacts:
dependencies.update(GetArtifactDependencies(art... | [
"def",
"GetArtifactsDependenciesClosure",
"(",
"name_list",
",",
"os_name",
"=",
"None",
")",
":",
"artifacts",
"=",
"set",
"(",
"REGISTRY",
".",
"GetArtifacts",
"(",
"os_name",
"=",
"os_name",
",",
"name_list",
"=",
"name_list",
")",
")",
"dependencies",
"=",... | For all the artifacts in the list returns them and their dependencies. | [
"For",
"all",
"the",
"artifacts",
"in",
"the",
"list",
"returns",
"them",
"and",
"their",
"dependencies",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L715-L729 | train | Returns all the artifacts in the list returns them and their dependencies. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | GetArtifactPathDependencies | def GetArtifactPathDependencies(rdf_artifact):
"""Return a set of knowledgebase path dependencies.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"]
"""
deps = set()
for source in rdf_artifact.sources:
for ar... | python | def GetArtifactPathDependencies(rdf_artifact):
"""Return a set of knowledgebase path dependencies.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"]
"""
deps = set()
for source in rdf_artifact.sources:
for ar... | [
"def",
"GetArtifactPathDependencies",
"(",
"rdf_artifact",
")",
":",
"deps",
"=",
"set",
"(",
")",
"for",
"source",
"in",
"rdf_artifact",
".",
"sources",
":",
"for",
"arg",
",",
"value",
"in",
"iteritems",
"(",
"source",
".",
"attributes",
")",
":",
"paths... | Return a set of knowledgebase path dependencies.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"] | [
"Return",
"a",
"set",
"of",
"knowledgebase",
"path",
"dependencies",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L732-L757 | train | Returns a set of knowledgebase path dependencies for the given artifact. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | GetArtifactParserDependencies | def GetArtifactParserDependencies(rdf_artifact):
"""Return the set of knowledgebase path dependencies required by the parser.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"]
"""
deps = set()
processors = parser... | python | def GetArtifactParserDependencies(rdf_artifact):
"""Return the set of knowledgebase path dependencies required by the parser.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"]
"""
deps = set()
processors = parser... | [
"def",
"GetArtifactParserDependencies",
"(",
"rdf_artifact",
")",
":",
"deps",
"=",
"set",
"(",
")",
"processors",
"=",
"parser",
".",
"Parser",
".",
"GetClassesByArtifact",
"(",
"rdf_artifact",
".",
"name",
")",
"for",
"p",
"in",
"processors",
":",
"deps",
... | Return the set of knowledgebase path dependencies required by the parser.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"] | [
"Return",
"the",
"set",
"of",
"knowledgebase",
"path",
"dependencies",
"required",
"by",
"the",
"parser",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L760-L774 | train | Returns the set of knowledgebase path dependencies required by the parser. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistrySources.AddDir | def AddDir(self, dirpath):
"""Adds a directory path as a source.
Args:
dirpath: a string representing a path to the directory.
Returns:
True if the directory is not an already existing source.
"""
if dirpath not in self._dirs:
self._dirs.add(dirpath)
return True
return ... | python | def AddDir(self, dirpath):
"""Adds a directory path as a source.
Args:
dirpath: a string representing a path to the directory.
Returns:
True if the directory is not an already existing source.
"""
if dirpath not in self._dirs:
self._dirs.add(dirpath)
return True
return ... | [
"def",
"AddDir",
"(",
"self",
",",
"dirpath",
")",
":",
"if",
"dirpath",
"not",
"in",
"self",
".",
"_dirs",
":",
"self",
".",
"_dirs",
".",
"add",
"(",
"dirpath",
")",
"return",
"True",
"return",
"False"
] | Adds a directory path as a source.
Args:
dirpath: a string representing a path to the directory.
Returns:
True if the directory is not an already existing source. | [
"Adds",
"a",
"directory",
"path",
"as",
"a",
"source",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L40-L52 | train | Adds a directory path as a source. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistrySources.AddFile | def AddFile(self, filepath):
"""Adds a file path as a source.
Args:
filepath: a string representing a path to the file.
Returns:
True if the file is not an already existing source.
"""
if filepath not in self._files:
self._files.add(filepath)
return True
return False | python | def AddFile(self, filepath):
"""Adds a file path as a source.
Args:
filepath: a string representing a path to the file.
Returns:
True if the file is not an already existing source.
"""
if filepath not in self._files:
self._files.add(filepath)
return True
return False | [
"def",
"AddFile",
"(",
"self",
",",
"filepath",
")",
":",
"if",
"filepath",
"not",
"in",
"self",
".",
"_files",
":",
"self",
".",
"_files",
".",
"add",
"(",
"filepath",
")",
"return",
"True",
"return",
"False"
] | Adds a file path as a source.
Args:
filepath: a string representing a path to the file.
Returns:
True if the file is not an already existing source. | [
"Adds",
"a",
"file",
"path",
"as",
"a",
"source",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L54-L66 | train | Adds a file path as a source. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistrySources.AddDatastore | def AddDatastore(self, urn):
"""Adds a datastore URN as a source.
Args:
urn: an RDF URN value of the datastore.
Returns:
True if the datastore is not an already existing source.
"""
if urn not in self._datastores:
self._datastores.add(urn)
return True
return False | python | def AddDatastore(self, urn):
"""Adds a datastore URN as a source.
Args:
urn: an RDF URN value of the datastore.
Returns:
True if the datastore is not an already existing source.
"""
if urn not in self._datastores:
self._datastores.add(urn)
return True
return False | [
"def",
"AddDatastore",
"(",
"self",
",",
"urn",
")",
":",
"if",
"urn",
"not",
"in",
"self",
".",
"_datastores",
":",
"self",
".",
"_datastores",
".",
"add",
"(",
"urn",
")",
"return",
"True",
"return",
"False"
] | Adds a datastore URN as a source.
Args:
urn: an RDF URN value of the datastore.
Returns:
True if the datastore is not an already existing source. | [
"Adds",
"a",
"datastore",
"URN",
"as",
"a",
"source",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L68-L80 | train | Adds a datastore URN as a source. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistrySources.GetAllFiles | def GetAllFiles(self):
"""Yields all defined source file paths.
This includes file paths defined directly and those defined implicitly by
defining a directory.
"""
for filepath in self._files:
yield filepath
for dirpath in self._dirs:
for filepath in ArtifactRegistrySources._GetDir... | python | def GetAllFiles(self):
"""Yields all defined source file paths.
This includes file paths defined directly and those defined implicitly by
defining a directory.
"""
for filepath in self._files:
yield filepath
for dirpath in self._dirs:
for filepath in ArtifactRegistrySources._GetDir... | [
"def",
"GetAllFiles",
"(",
"self",
")",
":",
"for",
"filepath",
"in",
"self",
".",
"_files",
":",
"yield",
"filepath",
"for",
"dirpath",
"in",
"self",
".",
"_dirs",
":",
"for",
"filepath",
"in",
"ArtifactRegistrySources",
".",
"_GetDirYamlFiles",
"(",
"dirpa... | Yields all defined source file paths.
This includes file paths defined directly and those defined implicitly by
defining a directory. | [
"Yields",
"all",
"defined",
"source",
"file",
"paths",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L99-L112 | train | Yields all defined source file paths. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry._LoadArtifactsFromDatastore | def _LoadArtifactsFromDatastore(self):
"""Load artifacts from the data store."""
loaded_artifacts = []
# TODO(hanuszczak): Why do we have to remove anything? If some artifact
# tries to shadow system artifact shouldn't we just ignore them and perhaps
# issue some warning instead? The datastore bein... | python | def _LoadArtifactsFromDatastore(self):
"""Load artifacts from the data store."""
loaded_artifacts = []
# TODO(hanuszczak): Why do we have to remove anything? If some artifact
# tries to shadow system artifact shouldn't we just ignore them and perhaps
# issue some warning instead? The datastore bein... | [
"def",
"_LoadArtifactsFromDatastore",
"(",
"self",
")",
":",
"loaded_artifacts",
"=",
"[",
"]",
"# TODO(hanuszczak): Why do we have to remove anything? If some artifact",
"# tries to shadow system artifact shouldn't we just ignore them and perhaps",
"# issue some warning instead? The datasto... | Load artifacts from the data store. | [
"Load",
"artifacts",
"from",
"the",
"data",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L135-L196 | train | Load artifacts from the data store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry.ArtifactsFromYaml | def ArtifactsFromYaml(self, yaml_content):
"""Get a list of Artifacts from yaml."""
raw_list = yaml.ParseMany(yaml_content)
# TODO(hanuszczak): I am very sceptical about that "doing the right thing"
# below. What are the real use cases?
# Try to do the right thing with json/yaml formatted as a lis... | python | def ArtifactsFromYaml(self, yaml_content):
"""Get a list of Artifacts from yaml."""
raw_list = yaml.ParseMany(yaml_content)
# TODO(hanuszczak): I am very sceptical about that "doing the right thing"
# below. What are the real use cases?
# Try to do the right thing with json/yaml formatted as a lis... | [
"def",
"ArtifactsFromYaml",
"(",
"self",
",",
"yaml_content",
")",
":",
"raw_list",
"=",
"yaml",
".",
"ParseMany",
"(",
"yaml_content",
")",
"# TODO(hanuszczak): I am very sceptical about that \"doing the right thing\"",
"# below. What are the real use cases?",
"# Try to do the r... | Get a list of Artifacts from yaml. | [
"Get",
"a",
"list",
"of",
"Artifacts",
"from",
"yaml",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L199-L227 | train | Get a list of Artifacts from a yaml file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry._LoadArtifactsFromFiles | def _LoadArtifactsFromFiles(self, file_paths, overwrite_if_exists=True):
"""Load artifacts from file paths as json or yaml."""
loaded_files = []
loaded_artifacts = []
for file_path in file_paths:
try:
with io.open(file_path, mode="r", encoding="utf-8") as fh:
logging.debug("Loadi... | python | def _LoadArtifactsFromFiles(self, file_paths, overwrite_if_exists=True):
"""Load artifacts from file paths as json or yaml."""
loaded_files = []
loaded_artifacts = []
for file_path in file_paths:
try:
with io.open(file_path, mode="r", encoding="utf-8") as fh:
logging.debug("Loadi... | [
"def",
"_LoadArtifactsFromFiles",
"(",
"self",
",",
"file_paths",
",",
"overwrite_if_exists",
"=",
"True",
")",
":",
"loaded_files",
"=",
"[",
"]",
"loaded_artifacts",
"=",
"[",
"]",
"for",
"file_path",
"in",
"file_paths",
":",
"try",
":",
"with",
"io",
".",... | Load artifacts from file paths as json or yaml. | [
"Load",
"artifacts",
"from",
"file",
"paths",
"as",
"json",
"or",
"yaml",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L229-L256 | train | Load artifacts from a list of file paths as json or yaml. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry.RegisterArtifact | def RegisterArtifact(self,
artifact_rdfvalue,
source="datastore",
overwrite_if_exists=False,
overwrite_system_artifacts=False):
"""Registers a new artifact."""
artifact_name = artifact_rdfvalue.name
if artifact_name ... | python | def RegisterArtifact(self,
artifact_rdfvalue,
source="datastore",
overwrite_if_exists=False,
overwrite_system_artifacts=False):
"""Registers a new artifact."""
artifact_name = artifact_rdfvalue.name
if artifact_name ... | [
"def",
"RegisterArtifact",
"(",
"self",
",",
"artifact_rdfvalue",
",",
"source",
"=",
"\"datastore\"",
",",
"overwrite_if_exists",
"=",
"False",
",",
"overwrite_system_artifacts",
"=",
"False",
")",
":",
"artifact_name",
"=",
"artifact_rdfvalue",
".",
"name",
"if",
... | Registers a new artifact. | [
"Registers",
"a",
"new",
"artifact",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L293-L316 | train | Registers a new artifact. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry._ReloadArtifacts | def _ReloadArtifacts(self):
"""Load artifacts from all sources."""
self._artifacts = {}
self._LoadArtifactsFromFiles(self._sources.GetAllFiles())
self.ReloadDatastoreArtifacts() | python | def _ReloadArtifacts(self):
"""Load artifacts from all sources."""
self._artifacts = {}
self._LoadArtifactsFromFiles(self._sources.GetAllFiles())
self.ReloadDatastoreArtifacts() | [
"def",
"_ReloadArtifacts",
"(",
"self",
")",
":",
"self",
".",
"_artifacts",
"=",
"{",
"}",
"self",
".",
"_LoadArtifactsFromFiles",
"(",
"self",
".",
"_sources",
".",
"GetAllFiles",
"(",
")",
")",
"self",
".",
"ReloadDatastoreArtifacts",
"(",
")"
] | Load artifacts from all sources. | [
"Load",
"artifacts",
"from",
"all",
"sources",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L330-L334 | train | Reloads artifacts from all sources. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry._UnregisterDatastoreArtifacts | def _UnregisterDatastoreArtifacts(self):
"""Remove artifacts that came from the datastore."""
to_remove = []
for name, artifact in iteritems(self._artifacts):
if artifact.loaded_from.startswith("datastore"):
to_remove.append(name)
for key in to_remove:
self._artifacts.pop(key) | python | def _UnregisterDatastoreArtifacts(self):
"""Remove artifacts that came from the datastore."""
to_remove = []
for name, artifact in iteritems(self._artifacts):
if artifact.loaded_from.startswith("datastore"):
to_remove.append(name)
for key in to_remove:
self._artifacts.pop(key) | [
"def",
"_UnregisterDatastoreArtifacts",
"(",
"self",
")",
":",
"to_remove",
"=",
"[",
"]",
"for",
"name",
",",
"artifact",
"in",
"iteritems",
"(",
"self",
".",
"_artifacts",
")",
":",
"if",
"artifact",
".",
"loaded_from",
".",
"startswith",
"(",
"\"datastore... | Remove artifacts that came from the datastore. | [
"Remove",
"artifacts",
"that",
"came",
"from",
"the",
"datastore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L336-L343 | train | Remove artifacts that came from the datastore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry.GetArtifacts | def GetArtifacts(self,
os_name=None,
name_list=None,
source_type=None,
exclude_dependents=False,
provides=None,
reload_datastore_artifacts=False):
"""Retrieve artifact classes with optional filtering.
... | python | def GetArtifacts(self,
os_name=None,
name_list=None,
source_type=None,
exclude_dependents=False,
provides=None,
reload_datastore_artifacts=False):
"""Retrieve artifact classes with optional filtering.
... | [
"def",
"GetArtifacts",
"(",
"self",
",",
"os_name",
"=",
"None",
",",
"name_list",
"=",
"None",
",",
"source_type",
"=",
"None",
",",
"exclude_dependents",
"=",
"False",
",",
"provides",
"=",
"None",
",",
"reload_datastore_artifacts",
"=",
"False",
")",
":",... | Retrieve artifact classes with optional filtering.
All filters must match for the artifact to be returned.
Args:
os_name: string to match against supported_os
name_list: list of strings to match against artifact names
source_type: rdf_artifacts.ArtifactSource.SourceType to match against
... | [
"Retrieve",
"artifact",
"classes",
"with",
"optional",
"filtering",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L360-L411 | train | Returns a set of artifacts that match the given filters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry.GetArtifact | def GetArtifact(self, name):
"""Get artifact by name.
Args:
name: artifact name string.
Returns:
artifact object.
Raises:
ArtifactNotRegisteredError: if artifact doesn't exist in the registy.
"""
self._CheckDirty()
result = self._artifacts.get(name)
if not result:
... | python | def GetArtifact(self, name):
"""Get artifact by name.
Args:
name: artifact name string.
Returns:
artifact object.
Raises:
ArtifactNotRegisteredError: if artifact doesn't exist in the registy.
"""
self._CheckDirty()
result = self._artifacts.get(name)
if not result:
... | [
"def",
"GetArtifact",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"_CheckDirty",
"(",
")",
"result",
"=",
"self",
".",
"_artifacts",
".",
"get",
"(",
"name",
")",
"if",
"not",
"result",
":",
"raise",
"rdf_artifacts",
".",
"ArtifactNotRegisteredError",... | Get artifact by name.
Args:
name: artifact name string.
Returns:
artifact object.
Raises:
ArtifactNotRegisteredError: if artifact doesn't exist in the registy. | [
"Get",
"artifact",
"by",
"name",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L418-L435 | train | Get an artifact by name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry.SearchDependencies | def SearchDependencies(self,
os_name,
artifact_name_list,
existing_artifact_deps=None,
existing_expansion_deps=None):
"""Return a set of artifact names needed to fulfill dependencies.
Search the path dependency ... | python | def SearchDependencies(self,
os_name,
artifact_name_list,
existing_artifact_deps=None,
existing_expansion_deps=None):
"""Return a set of artifact names needed to fulfill dependencies.
Search the path dependency ... | [
"def",
"SearchDependencies",
"(",
"self",
",",
"os_name",
",",
"artifact_name_list",
",",
"existing_artifact_deps",
"=",
"None",
",",
"existing_expansion_deps",
"=",
"None",
")",
":",
"artifact_deps",
"=",
"existing_artifact_deps",
"or",
"set",
"(",
")",
"expansion_... | Return a set of artifact names needed to fulfill dependencies.
Search the path dependency tree for all artifacts that can fulfill
dependencies of artifact_name_list. If multiple artifacts provide a
dependency, they are all included.
Args:
os_name: operating system string
artifact_name_lis... | [
"Return",
"a",
"set",
"of",
"artifact",
"names",
"needed",
"to",
"fulfill",
"dependencies",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L442-L491 | train | Search the path dependency tree for all artifacts that satisfy the given artifact names. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/artifact_registry.py | ArtifactRegistry.DumpArtifactsToYaml | def DumpArtifactsToYaml(self, sort_by_os=True):
"""Dump a list of artifacts into a yaml string."""
artifact_list = self.GetArtifacts()
if sort_by_os:
# Sort so its easier to split these if necessary.
yaml_list = []
done_set = set()
for os_name in rdf_artifacts.Artifact.SUPPORTED_OS_L... | python | def DumpArtifactsToYaml(self, sort_by_os=True):
"""Dump a list of artifacts into a yaml string."""
artifact_list = self.GetArtifacts()
if sort_by_os:
# Sort so its easier to split these if necessary.
yaml_list = []
done_set = set()
for os_name in rdf_artifacts.Artifact.SUPPORTED_OS_L... | [
"def",
"DumpArtifactsToYaml",
"(",
"self",
",",
"sort_by_os",
"=",
"True",
")",
":",
"artifact_list",
"=",
"self",
".",
"GetArtifacts",
"(",
")",
"if",
"sort_by_os",
":",
"# Sort so its easier to split these if necessary.",
"yaml_list",
"=",
"[",
"]",
"done_set",
... | Dump a list of artifacts into a yaml string. | [
"Dump",
"a",
"list",
"of",
"artifacts",
"into",
"a",
"yaml",
"string",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/artifact_registry.py#L494-L512 | train | Dump a list of artifacts into a yaml string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/fleetspeak_utils.py | IsFleetspeakEnabledClient | def IsFleetspeakEnabledClient(grr_id, token=None):
"""Returns whether the provided GRR id is a Fleetspeak client."""
if grr_id is None:
return False
if data_store.RelationalDBEnabled():
md = data_store.REL_DB.ReadClientMetadata(grr_id)
if not md:
return False
return md.fleetspeak_enabled
... | python | def IsFleetspeakEnabledClient(grr_id, token=None):
"""Returns whether the provided GRR id is a Fleetspeak client."""
if grr_id is None:
return False
if data_store.RelationalDBEnabled():
md = data_store.REL_DB.ReadClientMetadata(grr_id)
if not md:
return False
return md.fleetspeak_enabled
... | [
"def",
"IsFleetspeakEnabledClient",
"(",
"grr_id",
",",
"token",
"=",
"None",
")",
":",
"if",
"grr_id",
"is",
"None",
":",
"return",
"False",
"if",
"data_store",
".",
"RelationalDBEnabled",
"(",
")",
":",
"md",
"=",
"data_store",
".",
"REL_DB",
".",
"ReadC... | Returns whether the provided GRR id is a Fleetspeak client. | [
"Returns",
"whether",
"the",
"provided",
"GRR",
"id",
"is",
"a",
"Fleetspeak",
"client",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/fleetspeak_utils.py#L19-L36 | train | Returns True if the GRR id is a Fleetspeak client. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/fleetspeak_utils.py | SendGrrMessageThroughFleetspeak | def SendGrrMessageThroughFleetspeak(grr_id, msg):
"""Sends the given GrrMessage through FS."""
fs_msg = fs_common_pb2.Message(
message_type="GrrMessage",
destination=fs_common_pb2.Address(
client_id=GRRIDToFleetspeakID(grr_id), service_name="GRR"))
fs_msg.data.Pack(msg.AsPrimitiveProto())
... | python | def SendGrrMessageThroughFleetspeak(grr_id, msg):
"""Sends the given GrrMessage through FS."""
fs_msg = fs_common_pb2.Message(
message_type="GrrMessage",
destination=fs_common_pb2.Address(
client_id=GRRIDToFleetspeakID(grr_id), service_name="GRR"))
fs_msg.data.Pack(msg.AsPrimitiveProto())
... | [
"def",
"SendGrrMessageThroughFleetspeak",
"(",
"grr_id",
",",
"msg",
")",
":",
"fs_msg",
"=",
"fs_common_pb2",
".",
"Message",
"(",
"message_type",
"=",
"\"GrrMessage\"",
",",
"destination",
"=",
"fs_common_pb2",
".",
"Address",
"(",
"client_id",
"=",
"GRRIDToFlee... | Sends the given GrrMessage through FS. | [
"Sends",
"the",
"given",
"GrrMessage",
"through",
"FS",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/fleetspeak_utils.py#L39-L46 | train | Sends the given GrrMessage through FS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/fleetspeak_utils.py | GetLabelFromFleetspeak | def GetLabelFromFleetspeak(client_id):
"""Returns the primary GRR label to use for a fleetspeak client."""
res = fleetspeak_connector.CONN.outgoing.ListClients(
admin_pb2.ListClientsRequest(client_ids=[GRRIDToFleetspeakID(client_id)]))
if not res.clients or not res.clients[0].labels:
return fleetspeak_c... | python | def GetLabelFromFleetspeak(client_id):
"""Returns the primary GRR label to use for a fleetspeak client."""
res = fleetspeak_connector.CONN.outgoing.ListClients(
admin_pb2.ListClientsRequest(client_ids=[GRRIDToFleetspeakID(client_id)]))
if not res.clients or not res.clients[0].labels:
return fleetspeak_c... | [
"def",
"GetLabelFromFleetspeak",
"(",
"client_id",
")",
":",
"res",
"=",
"fleetspeak_connector",
".",
"CONN",
".",
"outgoing",
".",
"ListClients",
"(",
"admin_pb2",
".",
"ListClientsRequest",
"(",
"client_ids",
"=",
"[",
"GRRIDToFleetspeakID",
"(",
"client_id",
")... | Returns the primary GRR label to use for a fleetspeak client. | [
"Returns",
"the",
"primary",
"GRR",
"label",
"to",
"use",
"for",
"a",
"fleetspeak",
"client",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/fleetspeak_utils.py#L63-L76 | train | Returns the GRR label to use for a fleetspeak client. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.Start | def Start(self,
file_size=0,
maximum_pending_files=1000,
use_external_stores=False):
"""Initialize our state."""
super(MultiGetFileLogic, self).Start()
self.state.files_hashed = 0
self.state.use_external_stores = use_external_stores
self.state.file_size = file_si... | python | def Start(self,
file_size=0,
maximum_pending_files=1000,
use_external_stores=False):
"""Initialize our state."""
super(MultiGetFileLogic, self).Start()
self.state.files_hashed = 0
self.state.use_external_stores = use_external_stores
self.state.file_size = file_si... | [
"def",
"Start",
"(",
"self",
",",
"file_size",
"=",
"0",
",",
"maximum_pending_files",
"=",
"1000",
",",
"use_external_stores",
"=",
"False",
")",
":",
"super",
"(",
"MultiGetFileLogic",
",",
"self",
")",
".",
"Start",
"(",
")",
"self",
".",
"state",
"."... | Initialize our state. | [
"Initialize",
"our",
"state",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L270-L313 | train | Initialize our state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.StartFileFetch | def StartFileFetch(self, pathspec, request_data=None):
"""The entry point for this flow mixin - Schedules new file transfer."""
# Create an index so we can find this pathspec later.
self.state.indexed_pathspecs.append(pathspec)
self.state.request_data_list.append(request_data)
self._TryToStartNextPa... | python | def StartFileFetch(self, pathspec, request_data=None):
"""The entry point for this flow mixin - Schedules new file transfer."""
# Create an index so we can find this pathspec later.
self.state.indexed_pathspecs.append(pathspec)
self.state.request_data_list.append(request_data)
self._TryToStartNextPa... | [
"def",
"StartFileFetch",
"(",
"self",
",",
"pathspec",
",",
"request_data",
"=",
"None",
")",
":",
"# Create an index so we can find this pathspec later.",
"self",
".",
"state",
".",
"indexed_pathspecs",
".",
"append",
"(",
"pathspec",
")",
"self",
".",
"state",
"... | The entry point for this flow mixin - Schedules new file transfer. | [
"The",
"entry",
"point",
"for",
"this",
"flow",
"mixin",
"-",
"Schedules",
"new",
"file",
"transfer",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L315-L320 | train | Starts a new file fetch. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic._TryToStartNextPathspec | def _TryToStartNextPathspec(self):
"""Try to schedule the next pathspec if there is enough capacity."""
# Nothing to do here.
if self.state.maximum_pending_files <= len(self.state.pending_files):
return
if self.state.maximum_pending_files <= len(self.state.pending_hashes):
return
try:... | python | def _TryToStartNextPathspec(self):
"""Try to schedule the next pathspec if there is enough capacity."""
# Nothing to do here.
if self.state.maximum_pending_files <= len(self.state.pending_files):
return
if self.state.maximum_pending_files <= len(self.state.pending_hashes):
return
try:... | [
"def",
"_TryToStartNextPathspec",
"(",
"self",
")",
":",
"# Nothing to do here.",
"if",
"self",
".",
"state",
".",
"maximum_pending_files",
"<=",
"len",
"(",
"self",
".",
"state",
".",
"pending_files",
")",
":",
"return",
"if",
"self",
".",
"state",
".",
"ma... | Try to schedule the next pathspec if there is enough capacity. | [
"Try",
"to",
"schedule",
"the",
"next",
"pathspec",
"if",
"there",
"is",
"enough",
"capacity",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L322-L377 | train | Try to start the next pathspec. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic._RemoveCompletedPathspec | def _RemoveCompletedPathspec(self, index):
"""Removes a pathspec from the list of pathspecs."""
pathspec = self.state.indexed_pathspecs[index]
request_data = self.state.request_data_list[index]
self.state.indexed_pathspecs[index] = None
self.state.request_data_list[index] = None
self.state.pend... | python | def _RemoveCompletedPathspec(self, index):
"""Removes a pathspec from the list of pathspecs."""
pathspec = self.state.indexed_pathspecs[index]
request_data = self.state.request_data_list[index]
self.state.indexed_pathspecs[index] = None
self.state.request_data_list[index] = None
self.state.pend... | [
"def",
"_RemoveCompletedPathspec",
"(",
"self",
",",
"index",
")",
":",
"pathspec",
"=",
"self",
".",
"state",
".",
"indexed_pathspecs",
"[",
"index",
"]",
"request_data",
"=",
"self",
".",
"state",
".",
"request_data_list",
"[",
"index",
"]",
"self",
".",
... | Removes a pathspec from the list of pathspecs. | [
"Removes",
"a",
"pathspec",
"from",
"the",
"list",
"of",
"pathspecs",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L379-L392 | train | Removes a pathspec from the list of pathspecs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic._ReceiveFetchedFile | def _ReceiveFetchedFile(self, tracker):
"""Remove pathspec for this index and call the ReceiveFetchedFile method."""
index = tracker["index"]
_, request_data = self._RemoveCompletedPathspec(index)
# Report the request_data for this flow's caller.
self.ReceiveFetchedFile(
tracker["stat_entr... | python | def _ReceiveFetchedFile(self, tracker):
"""Remove pathspec for this index and call the ReceiveFetchedFile method."""
index = tracker["index"]
_, request_data = self._RemoveCompletedPathspec(index)
# Report the request_data for this flow's caller.
self.ReceiveFetchedFile(
tracker["stat_entr... | [
"def",
"_ReceiveFetchedFile",
"(",
"self",
",",
"tracker",
")",
":",
"index",
"=",
"tracker",
"[",
"\"index\"",
"]",
"_",
",",
"request_data",
"=",
"self",
".",
"_RemoveCompletedPathspec",
"(",
"index",
")",
"# Report the request_data for this flow's caller.",
"self... | Remove pathspec for this index and call the ReceiveFetchedFile method. | [
"Remove",
"pathspec",
"for",
"this",
"index",
"and",
"call",
"the",
"ReceiveFetchedFile",
"method",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L394-L402 | train | Called by the FileFlow when a file is fetched. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic._FileFetchFailed | def _FileFetchFailed(self, index, request_name):
"""Remove pathspec for this index and call the FileFetchFailed method."""
pathspec, request_data = self._RemoveCompletedPathspec(index)
# Report the request_data for this flow's caller.
self.FileFetchFailed(pathspec, request_name, request_data=request_d... | python | def _FileFetchFailed(self, index, request_name):
"""Remove pathspec for this index and call the FileFetchFailed method."""
pathspec, request_data = self._RemoveCompletedPathspec(index)
# Report the request_data for this flow's caller.
self.FileFetchFailed(pathspec, request_name, request_data=request_d... | [
"def",
"_FileFetchFailed",
"(",
"self",
",",
"index",
",",
"request_name",
")",
":",
"pathspec",
",",
"request_data",
"=",
"self",
".",
"_RemoveCompletedPathspec",
"(",
"index",
")",
"# Report the request_data for this flow's caller.",
"self",
".",
"FileFetchFailed",
... | Remove pathspec for this index and call the FileFetchFailed method. | [
"Remove",
"pathspec",
"for",
"this",
"index",
"and",
"call",
"the",
"FileFetchFailed",
"method",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L414-L420 | train | Remove the pathspec for this index and call the FileFetchFailed method. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.StoreStat | def StoreStat(self, responses):
"""Stores stat entry in the flow's state."""
index = responses.request_data["index"]
if not responses.success:
self.Log("Failed to stat file: %s", responses.status)
# Report failure.
self._FileFetchFailed(index, responses.request_data["request_name"])
... | python | def StoreStat(self, responses):
"""Stores stat entry in the flow's state."""
index = responses.request_data["index"]
if not responses.success:
self.Log("Failed to stat file: %s", responses.status)
# Report failure.
self._FileFetchFailed(index, responses.request_data["request_name"])
... | [
"def",
"StoreStat",
"(",
"self",
",",
"responses",
")",
":",
"index",
"=",
"responses",
".",
"request_data",
"[",
"\"index\"",
"]",
"if",
"not",
"responses",
".",
"success",
":",
"self",
".",
"Log",
"(",
"\"Failed to stat file: %s\"",
",",
"responses",
".",
... | Stores stat entry in the flow's state. | [
"Stores",
"stat",
"entry",
"in",
"the",
"flow",
"s",
"state",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L432-L442 | train | Stores the stat entry in the flow s state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.ReceiveFileHash | def ReceiveFileHash(self, responses):
"""Add hash digest to tracker and check with filestore."""
index = responses.request_data["index"]
if not responses.success:
self.Log("Failed to hash file: %s", responses.status)
self.state.pending_hashes.pop(index, None)
# Report the error.
self... | python | def ReceiveFileHash(self, responses):
"""Add hash digest to tracker and check with filestore."""
index = responses.request_data["index"]
if not responses.success:
self.Log("Failed to hash file: %s", responses.status)
self.state.pending_hashes.pop(index, None)
# Report the error.
self... | [
"def",
"ReceiveFileHash",
"(",
"self",
",",
"responses",
")",
":",
"index",
"=",
"responses",
".",
"request_data",
"[",
"\"index\"",
"]",
"if",
"not",
"responses",
".",
"success",
":",
"self",
".",
"Log",
"(",
"\"Failed to hash file: %s\"",
",",
"responses",
... | Add hash digest to tracker and check with filestore. | [
"Add",
"hash",
"digest",
"to",
"tracker",
"and",
"check",
"with",
"filestore",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L444-L490 | train | Add hash digest to the tracker and check with filestore. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic._LegacyCheckHashesWithFileStore | def _LegacyCheckHashesWithFileStore(self):
"""Check all queued up hashes for existence in file store (legacy).
Hashes which do not exist in the file store will be downloaded. This
function flushes the entire queue (self.state.pending_hashes) in order to
minimize the round trips to the file store.
... | python | def _LegacyCheckHashesWithFileStore(self):
"""Check all queued up hashes for existence in file store (legacy).
Hashes which do not exist in the file store will be downloaded. This
function flushes the entire queue (self.state.pending_hashes) in order to
minimize the round trips to the file store.
... | [
"def",
"_LegacyCheckHashesWithFileStore",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"state",
".",
"pending_hashes",
":",
"return",
"# This map represents all the hashes in the pending urns.",
"file_hashes",
"=",
"{",
"}",
"# Store a mapping of hash to tracker. Keys are... | Check all queued up hashes for existence in file store (legacy).
Hashes which do not exist in the file store will be downloaded. This
function flushes the entire queue (self.state.pending_hashes) in order to
minimize the round trips to the file store.
If a file was found in the file store it is copied... | [
"Check",
"all",
"queued",
"up",
"hashes",
"for",
"existence",
"in",
"file",
"store",
"(",
"legacy",
")",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L492-L620 | train | Checks all queued up hashes for existence in file store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic._CheckHashesWithFileStore | def _CheckHashesWithFileStore(self):
"""Check all queued up hashes for existence in file store.
Hashes which do not exist in the file store will be downloaded. This
function flushes the entire queue (self.state.pending_hashes) in order to
minimize the round trips to the file store.
If a file was f... | python | def _CheckHashesWithFileStore(self):
"""Check all queued up hashes for existence in file store.
Hashes which do not exist in the file store will be downloaded. This
function flushes the entire queue (self.state.pending_hashes) in order to
minimize the round trips to the file store.
If a file was f... | [
"def",
"_CheckHashesWithFileStore",
"(",
"self",
")",
":",
"if",
"not",
"data_store",
".",
"RelationalDBEnabled",
"(",
")",
":",
"return",
"self",
".",
"_LegacyCheckHashesWithFileStore",
"(",
")",
"if",
"not",
"self",
".",
"state",
".",
"pending_hashes",
":",
... | Check all queued up hashes for existence in file store.
Hashes which do not exist in the file store will be downloaded. This
function flushes the entire queue (self.state.pending_hashes) in order to
minimize the round trips to the file store.
If a file was found in the file store it is not scheduled f... | [
"Check",
"all",
"queued",
"up",
"hashes",
"for",
"existence",
"in",
"file",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L622-L737 | train | Checks all queued up hashes for existence in file store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.CheckHash | def CheckHash(self, responses):
"""Adds the block hash to the file tracker responsible for this vfs URN."""
index = responses.request_data["index"]
if index not in self.state.pending_files:
# This is a blobhash for a file we already failed to read and logged as
# below, check here to avoid logg... | python | def CheckHash(self, responses):
"""Adds the block hash to the file tracker responsible for this vfs URN."""
index = responses.request_data["index"]
if index not in self.state.pending_files:
# This is a blobhash for a file we already failed to read and logged as
# below, check here to avoid logg... | [
"def",
"CheckHash",
"(",
"self",
",",
"responses",
")",
":",
"index",
"=",
"responses",
".",
"request_data",
"[",
"\"index\"",
"]",
"if",
"index",
"not",
"in",
"self",
".",
"state",
".",
"pending_files",
":",
"# This is a blobhash for a file we already failed to r... | Adds the block hash to the file tracker responsible for this vfs URN. | [
"Adds",
"the",
"block",
"hash",
"to",
"the",
"file",
"tracker",
"responsible",
"for",
"this",
"vfs",
"URN",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L739-L762 | train | Checks the block hash for a file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.FetchFileContent | def FetchFileContent(self):
"""Fetch as much as the file's content as possible.
This drains the pending_files store by checking which blobs we already have
in the store and issuing calls to the client to receive outstanding blobs.
"""
if not self.state.pending_files:
return
# Check what ... | python | def FetchFileContent(self):
"""Fetch as much as the file's content as possible.
This drains the pending_files store by checking which blobs we already have
in the store and issuing calls to the client to receive outstanding blobs.
"""
if not self.state.pending_files:
return
# Check what ... | [
"def",
"FetchFileContent",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"state",
".",
"pending_files",
":",
"return",
"# Check what blobs we already have in the blob store.",
"blob_hashes",
"=",
"[",
"]",
"for",
"file_tracker",
"in",
"itervalues",
"(",
"self",
... | Fetch as much as the file's content as possible.
This drains the pending_files store by checking which blobs we already have
in the store and issuing calls to the client to receive outstanding blobs. | [
"Fetch",
"as",
"much",
"as",
"the",
"file",
"s",
"content",
"as",
"possible",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L764-L803 | train | Fetch the file s content as possible. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | MultiGetFileLogic.WriteBuffer | def WriteBuffer(self, responses):
"""Write the hash received to the blob image."""
index = responses.request_data["index"]
if index not in self.state.pending_files:
return
# Failed to read the file - ignore it.
if not responses.success:
self._FileFetchFailed(index, responses.request.re... | python | def WriteBuffer(self, responses):
"""Write the hash received to the blob image."""
index = responses.request_data["index"]
if index not in self.state.pending_files:
return
# Failed to read the file - ignore it.
if not responses.success:
self._FileFetchFailed(index, responses.request.re... | [
"def",
"WriteBuffer",
"(",
"self",
",",
"responses",
")",
":",
"index",
"=",
"responses",
".",
"request_data",
"[",
"\"index\"",
"]",
"if",
"index",
"not",
"in",
"self",
".",
"state",
".",
"pending_files",
":",
"return",
"# Failed to read the file - ignore it.",... | Write the hash received to the blob image. | [
"Write",
"the",
"hash",
"received",
"to",
"the",
"blob",
"image",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L805-L894 | train | Write the hash received to the blob image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/flows/general/transfer.py | LegacyFileStoreCreateFile.ProcessMessages | def ProcessMessages(self, msgs=None, token=None):
"""Process the new file and add to the file store."""
if not data_store.AFF4Enabled():
return
filestore_fd = aff4.FACTORY.Create(
legacy_filestore.FileStore.PATH,
legacy_filestore.FileStore,
mode="w",
token=token)
... | python | def ProcessMessages(self, msgs=None, token=None):
"""Process the new file and add to the file store."""
if not data_store.AFF4Enabled():
return
filestore_fd = aff4.FACTORY.Create(
legacy_filestore.FileStore.PATH,
legacy_filestore.FileStore,
mode="w",
token=token)
... | [
"def",
"ProcessMessages",
"(",
"self",
",",
"msgs",
"=",
"None",
",",
"token",
"=",
"None",
")",
":",
"if",
"not",
"data_store",
".",
"AFF4Enabled",
"(",
")",
":",
"return",
"filestore_fd",
"=",
"aff4",
".",
"FACTORY",
".",
"Create",
"(",
"legacy_filesto... | Process the new file and add to the file store. | [
"Process",
"the",
"new",
"file",
"and",
"add",
"to",
"the",
"file",
"store",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/transfer.py#L962-L978 | train | Process the new file and add it to the file store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/hunts/standard.py | CreateGenericHuntFlow.Start | def Start(self):
"""Create the hunt, in the paused state."""
# Anyone can create the hunt but it will be created in the paused
# state. Permissions are required to actually start it.
with implementation.StartHunt(
runner_args=self.args.hunt_runner_args,
args=self.args.hunt_args,
... | python | def Start(self):
"""Create the hunt, in the paused state."""
# Anyone can create the hunt but it will be created in the paused
# state. Permissions are required to actually start it.
with implementation.StartHunt(
runner_args=self.args.hunt_runner_args,
args=self.args.hunt_args,
... | [
"def",
"Start",
"(",
"self",
")",
":",
"# Anyone can create the hunt but it will be created in the paused",
"# state. Permissions are required to actually start it.",
"with",
"implementation",
".",
"StartHunt",
"(",
"runner_args",
"=",
"self",
".",
"args",
".",
"hunt_runner_arg... | Create the hunt, in the paused state. | [
"Create",
"the",
"hunt",
"in",
"the",
"paused",
"state",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/hunts/standard.py#L90-L102 | train | Create the hunt in the paused state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/hunts/standard.py | SampleHunt.StoreResults | def StoreResults(self, responses):
"""Stores the responses."""
client_id = responses.request.client_id
if responses.success:
logging.info("Client %s has a file %s.", client_id, self.args.filename)
else:
logging.info("Client %s has no file %s.", client_id, self.args.filename)
self.MarkC... | python | def StoreResults(self, responses):
"""Stores the responses."""
client_id = responses.request.client_id
if responses.success:
logging.info("Client %s has a file %s.", client_id, self.args.filename)
else:
logging.info("Client %s has no file %s.", client_id, self.args.filename)
self.MarkC... | [
"def",
"StoreResults",
"(",
"self",
",",
"responses",
")",
":",
"client_id",
"=",
"responses",
".",
"request",
".",
"client_id",
"if",
"responses",
".",
"success",
":",
"logging",
".",
"info",
"(",
"\"Client %s has a file %s.\"",
",",
"client_id",
",",
"self",... | Stores the responses. | [
"Stores",
"the",
"responses",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/hunts/standard.py#L173-L182 | train | Stores the responses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/hunts/standard.py | GenericHunt.GetLaunchedFlows | def GetLaunchedFlows(self, flow_type="outstanding"):
"""Returns the session IDs of all the flows we launched.
Args:
flow_type: The type of flows to fetch. Can be "all", "outstanding" or
"finished".
Returns:
A list of flow URNs.
"""
result = None
all_clients = set(self.ListA... | python | def GetLaunchedFlows(self, flow_type="outstanding"):
"""Returns the session IDs of all the flows we launched.
Args:
flow_type: The type of flows to fetch. Can be "all", "outstanding" or
"finished".
Returns:
A list of flow URNs.
"""
result = None
all_clients = set(self.ListA... | [
"def",
"GetLaunchedFlows",
"(",
"self",
",",
"flow_type",
"=",
"\"outstanding\"",
")",
":",
"result",
"=",
"None",
"all_clients",
"=",
"set",
"(",
"self",
".",
"ListAllClients",
"(",
")",
")",
"finished_clients",
"=",
"set",
"(",
"self",
".",
"ListFinishedCl... | Returns the session IDs of all the flows we launched.
Args:
flow_type: The type of flows to fetch. Can be "all", "outstanding" or
"finished".
Returns:
A list of flow URNs. | [
"Returns",
"the",
"session",
"IDs",
"of",
"all",
"the",
"flows",
"we",
"launched",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/hunts/standard.py#L276-L302 | train | Retrieves the session IDs of all the flows we launched. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/hunts/standard.py | GenericHunt.MarkDone | def MarkDone(self, responses):
"""Mark a client as done."""
client_id = responses.request.client_id
self.AddResultsToCollection(responses, client_id)
self.MarkClientDone(client_id) | python | def MarkDone(self, responses):
"""Mark a client as done."""
client_id = responses.request.client_id
self.AddResultsToCollection(responses, client_id)
self.MarkClientDone(client_id) | [
"def",
"MarkDone",
"(",
"self",
",",
"responses",
")",
":",
"client_id",
"=",
"responses",
".",
"request",
".",
"client_id",
"self",
".",
"AddResultsToCollection",
"(",
"responses",
",",
"client_id",
")",
"self",
".",
"MarkClientDone",
"(",
"client_id",
")"
] | Mark a client as done. | [
"Mark",
"a",
"client",
"as",
"done",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/hunts/standard.py#L304-L308 | train | Mark a client as done. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/server/grr_response_server/hunts/standard.py | VariableGenericHunt.ManuallyScheduleClients | def ManuallyScheduleClients(self, token=None):
"""Schedule all flows without using the Foreman.
Since we know all the client ids to run on we might as well just schedule
all the flows and wait for the results.
Args:
token: A datastore access token.
"""
client_ids = set()
for flow_re... | python | def ManuallyScheduleClients(self, token=None):
"""Schedule all flows without using the Foreman.
Since we know all the client ids to run on we might as well just schedule
all the flows and wait for the results.
Args:
token: A datastore access token.
"""
client_ids = set()
for flow_re... | [
"def",
"ManuallyScheduleClients",
"(",
"self",
",",
"token",
"=",
"None",
")",
":",
"client_ids",
"=",
"set",
"(",
")",
"for",
"flow_request",
"in",
"self",
".",
"args",
".",
"flows",
":",
"for",
"client_id",
"in",
"flow_request",
".",
"client_ids",
":",
... | Schedule all flows without using the Foreman.
Since we know all the client ids to run on we might as well just schedule
all the flows and wait for the results.
Args:
token: A datastore access token. | [
"Schedule",
"all",
"flows",
"without",
"using",
"the",
"Foreman",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/hunts/standard.py#L359-L374 | train | Schedules all flows without using the Foreman.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
google/grr | grr/client/grr_response_client/client_actions/cloud.py | GetCloudVMMetadata.IsCloud | def IsCloud(self, request, bios_version, services):
"""Test to see if we're on a cloud machine."""
if request.bios_version_regex and bios_version:
if re.match(request.bios_version_regex, bios_version):
return True
if request.service_name_regex and services:
if re.search(request.service_n... | python | def IsCloud(self, request, bios_version, services):
"""Test to see if we're on a cloud machine."""
if request.bios_version_regex and bios_version:
if re.match(request.bios_version_regex, bios_version):
return True
if request.service_name_regex and services:
if re.search(request.service_n... | [
"def",
"IsCloud",
"(",
"self",
",",
"request",
",",
"bios_version",
",",
"services",
")",
":",
"if",
"request",
".",
"bios_version_regex",
"and",
"bios_version",
":",
"if",
"re",
".",
"match",
"(",
"request",
".",
"bios_version_regex",
",",
"bios_version",
"... | Test to see if we're on a cloud machine. | [
"Test",
"to",
"see",
"if",
"we",
"re",
"on",
"a",
"cloud",
"machine",
"."
] | 5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74 | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/cloud.py#L34-L42 | train | Test to see if we re on a cloud machine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.