golden hour
/opt/osquery/share/osquery/lenses
⬆️ Go Up
Upload
File/Folder
Size
Actions
COPYING
25.91 KB
Del
OK
access.aug
3.58 KB
Del
OK
activemq_conf.aug
1.47 KB
Del
OK
activemq_xml.aug
864 B
Del
OK
afs_cellalias.aug
1.56 KB
Del
OK
aliases.aug
2.18 KB
Del
OK
anaconda.aug
775 B
Del
OK
anacron.aug
2.49 KB
Del
OK
approx.aug
1.26 KB
Del
OK
apt_update_manager.aug
1.11 KB
Del
OK
aptcacherngsecurity.aug
726 B
Del
OK
aptconf.aug
3.9 KB
Del
OK
aptpreferences.aug
1.79 KB
Del
OK
aptsources.aug
1.98 KB
Del
OK
authorized_keys.aug
1.84 KB
Del
OK
automaster.aug
3.31 KB
Del
OK
automounter.aug
4.05 KB
Del
OK
avahi.aug
1.38 KB
Del
OK
backuppchosts.aug
1014 B
Del
OK
bbhosts.aug
4.24 KB
Del
OK
bootconf.aug
3.65 KB
Del
OK
build.aug
16.65 KB
Del
OK
cachefilesd.aug
2 KB
Del
OK
carbon.aug
1.54 KB
Del
OK
ceph.aug
719 B
Del
OK
cgconfig.aug
3.37 KB
Del
OK
cgrules.aug
2.38 KB
Del
OK
channels.aug
3.84 KB
Del
OK
chrony.aug
12.87 KB
Del
OK
clamav.aug
1.53 KB
Del
OK
cobblermodules.aug
398 B
Del
OK
cobblersettings.aug
2.24 KB
Del
OK
collectd.aug
869 B
Del
OK
cpanel.aug
824 B
Del
OK
cron.aug
4.05 KB
Del
OK
cron_user.aug
1.26 KB
Del
OK
crypttab.aug
3.01 KB
Del
OK
csv.aug
1.18 KB
Del
OK
cups.aug
459 B
Del
OK
cyrus_imapd.aug
1.51 KB
Del
OK
darkice.aug
773 B
Del
OK
debctrl.aug
3.61 KB
Del
OK
desktop.aug
1.39 KB
Del
OK
devfsrules.aug
619 B
Del
OK
device_map.aug
620 B
Del
OK
dhclient.aug
6.69 KB
Del
OK
dhcpd.aug
20.88 KB
Del
OK
dns_zone.aug
2.89 KB
Del
OK
dnsmasq.aug
2.16 KB
Del
OK
dovecot.aug
3.98 KB
Del
OK
dpkg.aug
2.78 KB
Del
OK
dput.aug
2.16 KB
Del
OK
erlang.aug
4.33 KB
Del
OK
ethers.aug
663 B
Del
OK
exports.aug
2.37 KB
Del
OK
fai_diskconfig.aug
9.28 KB
Del
OK
fonts.aug
819 B
Del
OK
fstab.aug
1.23 KB
Del
OK
fuse.aug
871 B
Del
OK
gdm.aug
1.8 KB
Del
OK
getcap.aug
1.57 KB
Del
OK
group.aug
1.66 KB
Del
OK
grub.aug
11.04 KB
Del
OK
grubenv.aug
508 B
Del
OK
gshadow.aug
2.19 KB
Del
OK
gtkbookmarks.aug
855 B
Del
OK
host_conf.aug
1.9 KB
Del
OK
hostname.aug
435 B
Del
OK
hosts.aug
485 B
Del
OK
hosts_access.aug
4.32 KB
Del
OK
htpasswd.aug
1.02 KB
Del
OK
httpd.aug
7.35 KB
Del
OK
inetd.aug
6.22 KB
Del
OK
inifile.aug
15.49 KB
Del
OK
inittab.aug
780 B
Del
OK
inputrc.aug
1.62 KB
Del
OK
interfaces.aug
4.62 KB
Del
OK
iproute2.aug
323 B
Del
OK
iptables.aug
2.64 KB
Del
OK
iscsid.aug
684 B
Del
OK
jaas.aug
1.57 KB
Del
OK
jettyrealm.aug
1.52 KB
Del
OK
jmxaccess.aug
1.35 KB
Del
OK
jmxpassword.aug
1.34 KB
Del
OK
json.aug
2.15 KB
Del
OK
kdump.aug
2.91 KB
Del
OK
keepalived.aug
10.7 KB
Del
OK
known_hosts.aug
1.93 KB
Del
OK
koji.aug
898 B
Del
OK
krb5.aug
6.16 KB
Del
OK
ldif.aug
7.65 KB
Del
OK
ldso.aug
1.06 KB
Del
OK
lightdm.aug
1.75 KB
Del
OK
limits.aug
2.02 KB
Del
OK
login_defs.aug
615 B
Del
OK
logrotate.aug
4.22 KB
Del
OK
logwatch.aug
1.44 KB
Del
OK
lokkit.aug
2.16 KB
Del
OK
lvm.aug
2.03 KB
Del
OK
mailscanner.aug
1.66 KB
Del
OK
mailscanner_rules.aug
2.84 KB
Del
OK
masterpasswd.aug
4.36 KB
Del
OK
mcollective.aug
1.09 KB
Del
OK
mdadm_conf.aug
10.05 KB
Del
OK
memcached.aug
1.24 KB
Del
OK
mke2fs.aug
4.67 KB
Del
OK
modprobe.aug
3.34 KB
Del
OK
modules.aug
741 B
Del
OK
modules_conf.aug
1.04 KB
Del
OK
mongodbserver.aug
1.17 KB
Del
OK
monit.aug
2.13 KB
Del
OK
multipath.aug
4.21 KB
Del
OK
mysql.aug
1.95 KB
Del
OK
nagioscfg.aug
2.09 KB
Del
OK
nagiosobjects.aug
1.57 KB
Del
OK
netmasks.aug
1.69 KB
Del
OK
networkmanager.aug
2 KB
Del
OK
networks.aug
1.09 KB
Del
OK
nginx.aug
3.65 KB
Del
OK
nrpe.aug
1.75 KB
Del
OK
nslcd.aug
9.87 KB
Del
OK
nsswitch.aug
2.33 KB
Del
OK
ntp.aug
5.29 KB
Del
OK
ntpd.aug
4.75 KB
Del
OK
odbc.aug
1.42 KB
Del
OK
opendkim.aug
3.08 KB
Del
OK
openshift_config.aug
2.46 KB
Del
OK
openshift_http.aug
1.03 KB
Del
OK
openshift_quickstarts.aug
1.02 KB
Del
OK
openvpn.aug
22.28 KB
Del
OK
oz.aug
1.35 KB
Del
OK
pagekite.aug
2.6 KB
Del
OK
pam.aug
2.58 KB
Del
OK
pamconf.aug
1.23 KB
Del
OK
passwd.aug
3.52 KB
Del
OK
pbuilder.aug
638 B
Del
OK
pg_hba.aug
2.97 KB
Del
OK
pgbouncer.aug
1.43 KB
Del
OK
php.aug
2.34 KB
Del
OK
phpvars.aug
3.85 KB
Del
OK
postfix_access.aug
771 B
Del
OK
postfix_main.aug
1.52 KB
Del
OK
postfix_master.aug
1.9 KB
Del
OK
postfix_passwordmap.aug
1.28 KB
Del
OK
postfix_sasl_smtpd.aug
697 B
Del
OK
postfix_transport.aug
1.48 KB
Del
OK
postfix_virtual.aug
1.32 KB
Del
OK
postgresql.aug
2.1 KB
Del
OK
properties.aug
2.3 KB
Del
OK
protocols.aug
1.05 KB
Del
OK
puppet.aug
1.52 KB
Del
OK
puppet_auth.aug
1.95 KB
Del
OK
puppetfile.aug
2.27 KB
Del
OK
puppetfileserver.aug
3.12 KB
Del
OK
pylonspaste.aug
2.3 KB
Del
OK
pythonpaste.aug
1.99 KB
Del
OK
qpid.aug
670 B
Del
OK
quote.aug
6.71 KB
Del
OK
rabbitmq.aug
4.69 KB
Del
OK
radicale.aug
1.48 KB
Del
OK
rancid.aug
927 B
Del
OK
redis.aug
4.96 KB
Del
OK
reprepro_uploaders.aug
5.47 KB
Del
OK
resolv.aug
3.87 KB
Del
OK
rhsm.aug
1.1 KB
Del
OK
rmt.aug
788 B
Del
OK
rsyncd.aug
1.97 KB
Del
OK
rsyslog.aug
3.17 KB
Del
OK
rtadvd.aug
854 B
Del
OK
rx.aug
4.06 KB
Del
OK
samba.aug
1.71 KB
Del
OK
schroot.aug
1.79 KB
Del
OK
securetty.aug
450 B
Del
OK
semanage.aug
859 B
Del
OK
sep.aug
1.28 KB
Del
OK
services.aug
2.82 KB
Del
OK
shadow.aug
2.35 KB
Del
OK
shells.aug
745 B
Del
OK
shellvars.aug
11.97 KB
Del
OK
shellvars_list.aug
1.74 KB
Del
OK
simplelines.aug
1.13 KB
Del
OK
simplevars.aug
1.34 KB
Del
OK
sip_conf.aug
1.61 KB
Del
OK
slapd.aug
5.2 KB
Del
OK
smbusers.aug
781 B
Del
OK
solaris_system.aug
3.15 KB
Del
OK
soma.aug
1.14 KB
Del
OK
spacevars.aug
1.42 KB
Del
OK
splunk.aug
1.64 KB
Del
OK
squid.aug
15.95 KB
Del
OK
ssh.aug
3.91 KB
Del
OK
sshd.aug
4.01 KB
Del
OK
sssd.aug
861 B
Del
OK
star.aug
941 B
Del
OK
strongswan.aug
1.63 KB
Del
OK
stunnel.aug
2.21 KB
Del
OK
subversion.aug
2.75 KB
Del
OK
sudoers.aug
20.03 KB
Del
OK
sysconfig.aug
2.49 KB
Del
OK
sysconfig_route.aug
2.55 KB
Del
OK
sysctl.aug
923 B
Del
OK
syslog.aug
7.33 KB
Del
OK
systemd.aug
5.88 KB
Del
OK
termcap.aug
1.03 KB
Del
OK
thttpd.aug
1.31 KB
Del
OK
tmpfiles.aug
3.03 KB
Del
OK
toml.aug
4.06 KB
Del
OK
trapperkeeper.aug
4.01 KB
Del
OK
tuned.aug
387 B
Del
OK
up2date.aug
2.21 KB
Del
OK
updatedb.aug
1.13 KB
Del
OK
util.aug
4.85 KB
Del
OK
vfstab.aug
1.71 KB
Del
OK
vmware_config.aug
702 B
Del
OK
vsftpd.aug
2.72 KB
Del
OK
webmin.aug
1.23 KB
Del
OK
wine.aug
1.92 KB
Del
OK
xendconfsxp.aug
1.07 KB
Del
OK
xinetd.aug
4.02 KB
Del
OK
xml.aug
6.33 KB
Del
OK
xorg.aug
10.43 KB
Del
OK
xymon.aug
2.26 KB
Del
OK
xymon_alerting.aug
6.11 KB
Del
OK
yaml.aug
1.54 KB
Del
OK
yum.aug
2.19 KB
Del
OK
Edit: inifile.aug
(* Module: IniFile Generic module to create INI files lenses Author: Raphael Pinson <raphink@gmail.com> About: License This file is licensed under the LGPL v2+, like the rest of Augeas. About: TODO Things to add in the future - Support double quotes in value About: Lens usage This lens is made to provide generic primitives to construct INI File lenses. See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it. About: Examples The <Test_IniFile> file contains various examples and tests. *) module IniFile = (************************************************************************ * Group: USEFUL PRIMITIVES *************************************************************************) (* Group: Internal primitives *) (* Variable: eol End of line, inherited from <Util.eol> *) let eol = Util.doseol (* Group: Separators *) (* Variable: sep Generic separator Parameters: pat:regexp - the pattern to delete default:string - the default string to use *) let sep (pat:regexp) (default:string) = Sep.opt_space . del pat default (* Variable: sep_noindent Generic separator, no indentation Parameters: pat:regexp - the pattern to delete default:string - the default string to use *) let sep_noindent (pat:regexp) (default:string) = del pat default (* Variable: sep_re The default regexp for a separator *) let sep_re = /[=:]/ (* Variable: sep_default The default separator value *) let sep_default = "=" (* Group: Stores *) (* Variable: sto_to_eol Store until end of line *) let sto_to_eol = Sep.opt_space . store Rx.space_in (* Variable: to_comment_re Regex until comment *) let to_comment_re = /[^";# \t\n][^";#\n]*[^";# \t\n]|[^";# \t\n]/ (* Variable: sto_to_comment Store until comment *) let sto_to_comment = Sep.opt_space . store to_comment_re (* Variable: sto_multiline Store multiline values *) let sto_multiline = Sep.opt_space . store (to_comment_re . (/[ \t]*\n/ . Rx.space . to_comment_re)*) (* Variable: sto_multiline_nocomment Store multiline values without an end-of-line comment *) let sto_multiline_nocomment = Sep.opt_space . store (Rx.space_in . (/[ \t]*\n/ . Rx.space . Rx.space_in)*) (* Group: Define comment and defaults *) (* View: comment_noindent Map comments into "#comment" nodes, no indentation allowed Parameters: pat:regexp - pattern to delete before commented data default:string - default pattern before commented data Sample Usage: (start code) let comment = IniFile.comment_noindent "#" "#" let comment = IniFile.comment_noindent IniFile.comment_re IniFile.comment_default (end code) *) let comment_noindent (pat:regexp) (default:string) = Util.comment_generic_seteol (pat . Rx.opt_space) default eol (* View: comment Map comments into "#comment" nodes Parameters: pat:regexp - pattern to delete before commented data default:string - default pattern before commented data Sample Usage: (start code) let comment = IniFile.comment "#" "#" let comment = IniFile.comment IniFile.comment_re IniFile.comment_default (end code) *) let comment (pat:regexp) (default:string) = Util.comment_generic_seteol (Rx.opt_space . pat . Rx.opt_space) default eol (* Variable: comment_re Default regexp for <comment> pattern *) let comment_re = /[;#]/ (* Variable: comment_default Default value for <comment> pattern *) let comment_default = ";" (* View: empty_generic Empty line, including empty comments Parameters: indent:regexp - the indentation regexp comment_re:regexp - the comment separator regexp *) let empty_generic (indent:regexp) (comment_re:regexp) = Util.empty_generic_dos (indent . comment_re? . Rx.opt_space) (* View: empty Empty line *) let empty = empty_generic Rx.opt_space comment_re (* View: empty_noindent Empty line, without indentation *) let empty_noindent = empty_generic "" comment_re (************************************************************************ * Group: ENTRY *************************************************************************) (* Group: entry includes comments *) (* View: entry_generic_nocomment A very generic INI File entry, not including comments It allows to set the key lens (to set indentation or subnodes linked to the key) as well as the comment separator regexp, used to tune the store regexps. Parameters: kw:lens - lens to match the key, including optional indentation sep:lens - lens to use as key/value separator comment_re:regexp - comment separator regexp comment:lens - lens to use as comment Sample Usage: > let entry = IniFile.entry_generic (key "setting") sep IniFile.comment_re comment *) let entry_generic_nocomment (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) = let bare_re_noquot = (/[^" \t\r\n]/ - comment_re) in let bare_re = (/[^\r\n]/ - comment_re)+ in let no_quot = /[^"\r\n]*/ in let bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?)) in let quoted = Quote.do_dquote (store (no_quot . comment_re+ . no_quot)) in [ kw . sep . (Sep.opt_space . bare)? . (comment|eol) ] | [ kw . sep . Sep.opt_space . quoted . (comment|eol) ] (* View: entry_generic A very generic INI File entry It allows to set the key lens (to set indentation or subnodes linked to the key) as well as the comment separator regexp, used to tune the store regexps. Parameters: kw:lens - lens to match the key, including optional indentation sep:lens - lens to use as key/value separator comment_re:regexp - comment separator regexp comment:lens - lens to use as comment Sample Usage: > let entry = IniFile.entry_generic (key "setting") sep IniFile.comment_re comment *) let entry_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) = entry_generic_nocomment kw sep comment_re comment | comment (* View: entry Generic INI File entry Parameters: kw:regexp - keyword regexp for the label sep:lens - lens to use as key/value separator comment:lens - lens to use as comment Sample Usage: > let entry = IniFile.entry setting sep comment *) let entry (kw:regexp) (sep:lens) (comment:lens) = entry_generic (key kw) sep comment_re comment (* View: indented_entry Generic INI File entry that might be indented with an arbitrary amount of whitespace Parameters: kw:regexp - keyword regexp for the label sep:lens - lens to use as key/value separator comment:lens - lens to use as comment Sample Usage: > let entry = IniFile.indented_entry setting sep comment *) let indented_entry (kw:regexp) (sep:lens) (comment:lens) = entry_generic (Util.indent . key kw) sep comment_re comment (* View: entry_multiline_generic A very generic multiline INI File entry It allows to set the key lens (to set indentation or subnodes linked to the key) as well as the comment separator regexp, used to tune the store regexps. Parameters: kw:lens - lens to match the key, including optional indentation sep:lens - lens to use as key/value separator comment_re:regexp - comment separator regexp comment:lens - lens to use as comment eol:lens - lens for end of line Sample Usage: > let entry = IniFile.entry_generic (key "setting") sep IniFile.comment_re comment comment_or_eol *) let entry_multiline_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) (eol:lens) = let newline = /\r?\n[ \t]+/ in let bare = let word_re_noquot = (/[^" \t\r\n]/ - comment_re)+ in let word_re = (/[^\r\n]/ - comment_re)+ in let base_re = (word_re_noquot . (word_re* . word_re_noquot)?) in let sto_re = base_re . (newline . base_re)* | (newline . base_re)+ in Quote.do_dquote_opt_nil (store sto_re) in let quoted = let no_quot = /[^"\r\n]*/ in let base_re = (no_quot . comment_re+ . no_quot) in let sto_re = base_re . (newline . base_re)* | (newline . base_re)+ in Quote.do_dquote (store sto_re) in [ kw . sep . (Sep.opt_space . bare)? . eol ] | [ kw . sep . Sep.opt_space . quoted . eol ] | comment (* View: entry_multiline Generic multiline INI File entry Parameters: kw:regexp - keyword regexp for the label sep:lens - lens to use as key/value separator comment:lens - lens to use as comment *) let entry_multiline (kw:regexp) (sep:lens) (comment:lens) = entry_multiline_generic (key kw) sep comment_re comment (comment|eol) (* View: entry_multiline_nocomment Generic multiline INI File entry without an end-of-line comment Parameters: kw:regexp - keyword regexp for the label sep:lens - lens to use as key/value separator comment:lens - lens to use as comment *) let entry_multiline_nocomment (kw:regexp) (sep:lens) (comment:lens) = entry_multiline_generic (key kw) sep comment_re comment eol (* View: entry_list Generic INI File list entry Parameters: kw:regexp - keyword regexp for the label sep:lens - lens to use as key/value separator sto:regexp - store regexp for the values list_sep:lens - lens to use as list separator comment:lens - lens to use as comment *) let entry_list (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) (comment:lens) = let list = counter "elem" . Build.opt_list [ seq "elem" . store sto ] list_sep in Build.key_value_line_comment kw sep (Sep.opt_space . list) comment (* View: entry_list_nocomment Generic INI File list entry without an end-of-line comment Parameters: kw:regexp - keyword regexp for the label sep:lens - lens to use as key/value separator sto:regexp - store regexp for the values list_sep:lens - lens to use as list separator *) let entry_list_nocomment (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) = let list = counter "elem" . Build.opt_list [ seq "elem" . store sto ] list_sep in Build.key_value_line kw sep (Sep.opt_space . list) (* Variable: entry_re Default regexp for <entry> keyword *) let entry_re = ( /[A-Za-z][A-Za-z0-9._-]*/ ) (************************************************************************ * Group: RECORD *************************************************************************) (* Group: Title definition *) (* View: title Title for <record>. This maps the title of a record as a node in the abstract tree. Parameters: kw:regexp - keyword regexp for the label Sample Usage: > let title = IniFile.title IniFile.record_re *) let title (kw:regexp) = Util.del_str "[" . key kw . Util.del_str "]". eol (* View: indented_title Title for <record>. This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace Parameters: kw:regexp - keyword regexp for the label Sample Usage: > let title = IniFile.title IniFile.record_re *) let indented_title (kw:regexp) = Util.indent . title kw (* View: title_label Title for <record>. This maps the title of a record as a value in the abstract tree. Parameters: name:string - name for the title label kw:regexp - keyword regexp for the label Sample Usage: > let title = IniFile.title_label "target" IniFile.record_label_re *) let title_label (name:string) (kw:regexp) = label name . Util.del_str "[" . store kw . Util.del_str "]". eol (* View: indented_title_label Title for <record>. This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace Parameters: name:string - name for the title label kw:regexp - keyword regexp for the label Sample Usage: > let title = IniFile.title_label "target" IniFile.record_label_re *) let indented_title_label (name:string) (kw:regexp) = Util.indent . title_label name kw (* Variable: record_re Default regexp for <title> keyword pattern *) let record_re = ( /[^]\r\n\/]+/ - /#comment/ ) (* Variable: record_label_re Default regexp for <title_label> keyword pattern *) let record_label_re = /[^]\r\n]+/ (* Group: Record definition *) (* View: record_noempty INI File Record with no empty lines allowed. Parameters: title:lens - lens to use for title. Use either <title> or <title_label>. entry:lens - lens to use for entries in the record. See <entry>. *) let record_noempty (title:lens) (entry:lens) = [ title . entry* ] (* View: record Generic INI File record Parameters: title:lens - lens to use for title. Use either <title> or <title_label>. entry:lens - lens to use for entries in the record. See <entry>. Sample Usage: > let record = IniFile.record title entry *) let record (title:lens) (entry:lens) = record_noempty title ( entry | empty ) (************************************************************************ * Group: GENERIC LENSES *************************************************************************) (* Group: Lens definition View: lns_noempty Generic INI File lens with no empty lines Parameters: record:lens - record lens to use. See <record_noempty>. comment:lens - comment lens to use. See <comment>. Sample Usage: > let lns = IniFile.lns_noempty record comment *) let lns_noempty (record:lens) (comment:lens) = comment* . record* (* View: lns Generic INI File lens Parameters: record:lens - record lens to use. See <record>. comment:lens - comment lens to use. See <comment>. Sample Usage: > let lns = IniFile.lns record comment *) let lns (record:lens) (comment:lens) = lns_noempty record (comment|empty) (************************************************************************ * Group: READY-TO-USE LENSES *************************************************************************) let record_anon (entry:lens) = [ label "section" . value ".anon" . ( entry | empty )+ ] (* View: lns_loose A loose, ready-to-use lens, featuring: - sections as values (to allow '/' in names) - support empty lines and comments - support for [#;] as comment, defaulting to ";" - .anon sections - don't allow multiline values - allow indented titles - allow indented entries *) let lns_loose = let l_comment = comment comment_re comment_default in let l_sep = sep sep_re sep_default in let l_entry = indented_entry entry_re l_sep l_comment in let l_title = indented_title_label "section" (record_label_re - ".anon") in let l_record = record l_title l_entry in (record_anon l_entry)? . l_record* (* View: lns_loose_multiline A loose, ready-to-use lens, featuring: - sections as values (to allow '/' in names) - support empty lines and comments - support for [#;] as comment, defaulting to ";" - .anon sections - allow multiline values *) let lns_loose_multiline = let l_comment = comment comment_re comment_default in let l_sep = sep sep_re sep_default in let l_entry = entry_multiline entry_re l_sep l_comment in let l_title = title_label "section" (record_label_re - ".anon") in let l_record = record l_title l_entry in (record_anon l_entry)? . l_record*
Save