Debian Codegraph @

bin/csaf-rolie

raw
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use utf8;
6
7 use App::CSAF::ROLIE;
8
9 exit App::CSAF::ROLIE->run(@ARGV) unless caller();
10
11 1;
12
13 __END__
14 =encoding utf-8
15
16 =head1 NAME
17
18 csaf-rolie - Build ROLIE (Resource-Oriented Lightweight Information Exchange) feed
19
20 =head1 SYNOPSIS
21
22 csaf-rolie --csaf DIRECTORY [--tlp-label STRING|--feed-id STRING|--feed-title STRING|--base-url URL|--output PATH]
23 csaf-rolie [--help|--man|-v]
24
25 Options:
26 -c, --conf PATH YAML config path
27 -d, --csaf DIR CSAF documents directory
28 --output PATH Feed output file path (default {csaf}/{feed-id}.json)
29 --tlp-label TLP (Traffic Light Protocol) label (default "WHITE")
30 --base-url Feed base URL (default "https://psirt.domain.tld/advisories/csaf")
31 --feed-id Feed ID (default "csaf-feed-tlp-{tlp-label}")
32 --feed-title Feed title (default "CSAF feed (TLP:{tlp-label})")
33 --stdout Write ROLIE feed in STDOUT
34 --verbose Print verbose messages
35 --test Test the configuration and exit
36 --help Brief help message
37 --man Full documentation
38 -v, --version Print version
39
40
41 =head1 DESCRIPTION
42
43 C<csaf-rolie> build a ROLIE (Resource-Oriented Lightweight Information Exchange)
44 feed using the CSAF documents.
45
46 L<https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html>
47
48 The Resource Oriented Lightweight Information Exchange (ROLIE) is standard (RFC-8322)
49 for exchanging security automation information between two machines, or between
50 a machine and a human operator.
51
52 L<https://tools.ietf.org/html/rfc8322>
53
54
55 =head1 EXAMPLES
56
57 =head2 Create a new ROLIE feed
58
59 $ csaf-rolie --csaf /var/www/html/advisories/csaf \
60 --base-url https://security.acme.tld/advisories/csaf \
61 --feed-title "ACME CSAF feed (TLP:WHITE)" \
62 --verbose
63
64 CSAF directory : /var/www/html/advisories/csaf
65 TLP label : WHITE
66 Base URL : https://security.acme.tld/advisories/csaf
67 Feed ID : csaf-feed-tlp-white
68 Feed title : CSAF feed (TLP:WHITE)
69 Feed filename : csaf-feed-tlp-white.json
70 Output file : /var/www/html/advisories/csaf/csaf-feed-tlp-white.json
71
72 [*] Add ACMESA-2024:0001 in ROLIE feed
73 [*] Add ACMESA-2024:1337 in ROLIE feed
74
75 [...]
76
77 ROLIE feed saved in /var/www/html/advisories/csaf/csaf-feed-tlp-white.json
78
79
80 =head2 Create a new ROLIE feed using a config file
81
82 Available config items:
83
84 =over
85
86 =item C<csaf> CSAF documents directory
87
88 =item C<output> Feed output file path (default {csaf}/{feed-id}.json)
89
90 =item C<tlp-label> TLP (Traffic Light Protocol) label (default "WHITE")
91
92 =item C<base-url> Feed base URL (default "https://psirt.domain.tld/advisories/csaf")
93
94 =item C<feed-id> Feed ID (default "csaf-feed-tlp-{tlp-label}")
95
96 =item C<feed-title> Feed title (default "CSAF feed (TLP:{tlp-label})")
97
98 =back
99
100
101 ROLIE config file (F<rolie.conf>):
102
103 ---
104 csaf: /var/www/html/advisories/csaf
105 base_url: https://security.acme.tld/advisories/csaf
106 tlp_label: WHITE
107 feed_id: acme-csaf-feed-tlp-white
108 feed_title: ACME CSAF feed (TLP:WHITE)
109
110 Use F<rolie.conf> with C<csaf-rolie> command:
111
112 $ csaf-rolie --config /etc/csaf/rolie.conf
113
114 Schedule the refresh of ROLIE feed in L<crontab>:
115
116 */2 * * * * csaf-rolie --config /etc/csaf/rolie.conf 2> /dev/null
117
118 =head1 SEE ALSO
119
120 L<csaf-validator>
121
122
123 =head1 AUTHOR
124
125 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
126
127 =head1 COPYRIGHT AND LICENSE
128
129 Copyright © 2023-2025 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
130
131 You may use and distribute this module according to the same terms
132 that Perl is distributed under.