我使用HTML在 elasticsearch watcher 中构建电子邮件提醒,我还配置了在elasticsearch.yml
watcher.actions.email.html.sanitization:
allow: _tables, _blocks, _formatting, _links, _styles
但在我的警报中,我看到表已构建,但构造表时未考虑表属性。例如,边框,cellpadding和colspan从未在我的桌子上应用。表格示例如下所示
<table border='1' cellpadding='5' style='font-family:sans-serif;font-size:13px'><thead><tr><th>Type</th><th colspan='5'>Version</th></tr></thead><tbody> etc.
我仍然可以通过完全禁用下面的HTML清理来实现它,但不建议这样做,因为它涉及安全风险。
watcher.actions.email.html.sanitization.enabled: false
我甚至试图使用allow: _tables:all
,但它不起作用,它似乎不正确。
有没有办法通过只启用少量标签及其属性来实现它?
答案 0 :(得分:0)
根据elastic forum的讨论
现在,border
和cellpadding
属性始终被删除。您可以通过在清理程序配置中允许style
来使_styles
属性正常工作。