Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use cookie to ensure write to a valid rule dir #302

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inashivb
Copy link
Member

@inashivb inashivb commented Mar 24, 2022

Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/2691

Previous PR: #157

Changes since v1:
Entirely revamped. Used cookie approach suggested by Jason on Redmine

Known TODOs:

  • Same needs to be done for merged rule file

if os.path.exists(directory):
if not os.path.exists(cookie_path) and os.listdir(directory):
logger.error("{} -- doesn't look like a suricata-update rule directory".format(directory))
sys.exit(1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonish do you think this is as per your expectations?
Questions:

  1. How do we ensure that this does not break the current setups? Because we don't have a cookie already in the rule dir.
  2. Is checking for dir good enough for determining "first run"?
  3. Should the cookie be in say <prefix>/suricata or <prefix>/suricata/rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant