-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c485cf9
commit 7c93f1b
Showing
61 changed files
with
5,662 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
use utf8; | ||
|
||
use App::CSAF::Downloader; | ||
|
||
exit App::CSAF::Downloader->run(@ARGV) unless caller(); | ||
|
||
1; | ||
|
||
__END__ | ||
=encoding utf-8 | ||
|
||
=head1 NAME | ||
|
||
csaf-downloader - CSAF Downloader | ||
|
||
=head1 SYNOPSIS | ||
|
||
csaf-downloader --url URL | ||
csaf-downloader --config FILE | ||
csaf-downloader [--help|--man|--version] | ||
|
||
Options: | ||
-u, --url=URL "provider-metadata.json", "index.txt" or ROLIE feed URL | ||
-k, --insecure Skip TLS verification | ||
--parallel-downloads=NUM Number of parallel downloads (default: 10) | ||
|
||
--validate=[type] Validate CSAF document (type: schema, mandatory, optional, informative) | ||
--signature-check Enable GPG signature chec | ||
--integrity-check Enable SHA-(256|512) integrity check | ||
|
||
--include=REGEXP Include file | ||
--exclude=REGEXP Exclude file | ||
|
||
-v, --verbose Verbose | ||
|
||
--config=FILE Configuration file | ||
|
||
--help Brief help message | ||
--man Full documentation | ||
--version Print version | ||
|
||
=head1 DESCRIPTION | ||
|
||
C<csaf-downloader> CSAF Downloader | ||
|
||
=head1 EXAMPLES | ||
|
||
Download using C<index.txt> file | ||
|
||
$ csaf-downloader -u https://security.acme.tld/advisories/csaf/index.txt | ||
|
||
Download using C<provider-metadata.json> with ROLIE feed document: | ||
|
||
$ csaf-downloader -u https://psirt.domain.tld/advisories/csaf/provider-metadata.json | ||
|
||
Download using ROLIE feed document: | ||
|
||
$ csaf-downloader -u https://psirt.domain.tld/advisories/csaf/feed-tlp-white.json | ||
|
||
=head1 SEE ALSO | ||
|
||
L<csaf-rolie> | ||
|
||
=head1 AUTHOR | ||
|
||
L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt> | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
|
||
Copyright © 2023-2024 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt> | ||
|
||
You may use and distribute this module according to the same terms | ||
that Perl is distributed under. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
use utf8; | ||
|
||
use App::CSAF::ROLIE; | ||
|
||
exit App::CSAF::ROLIE->run(@ARGV) unless caller(); | ||
|
||
1; | ||
|
||
__END__ | ||
=encoding utf-8 | ||
|
||
=head1 NAME | ||
|
||
csaf-rolie - Build ROLIE (Resource-Oriented Lightweight Information Exchange) feed | ||
|
||
=head1 SYNOPSIS | ||
|
||
csaf-rolie --csaf DIRECTORY [--tlp-label STRING|--feed-id STRING|--feed-title STRING|--base-url URL|--output PATH] | ||
csaf-rolie [--help|--man|-v] | ||
|
||
Options: | ||
-c, --conf PATH YAML config path | ||
-d, --csaf DIR CSAF documents directory | ||
--output PATH Feed output file path (default {csaf}/{feed-id}.json) | ||
--tlp-label TLP (Traffic Light Protocol) label (default "WHITE") | ||
--base-url Feed base URL (default "https://psirt.domain.tld/advisories/csaf") | ||
--feed-id Feed ID (default "csaf-feed-tlp-{tlp-label}") | ||
--feed-title Feed title (default "CSAF feed (TLP:{tlp-label})") | ||
--stdout Write ROLIE feed in STDOUT | ||
--verbose Print verbose messages | ||
--test Test the configuration and exit | ||
--help Brief help message | ||
--man Full documentation | ||
-v, --version Print version | ||
|
||
|
||
=head1 DESCRIPTION | ||
|
||
C<csaf-rolie> build a ROLIE (Resource-Oriented Lightweight Information Exchange) | ||
feed using the CSAF documents. | ||
|
||
L<https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html> | ||
|
||
The Resource Oriented Lightweight Information Exchange (ROLIE) is standard (RFC-8322) | ||
for exchanging security automation information between two machines, or between | ||
a machine and a human operator. | ||
|
||
L<https://tools.ietf.org/html/rfc8322> | ||
|
||
|
||
=head1 EXAMPLES | ||
|
||
=head2 Create a new ROLIE feed | ||
|
||
$ csaf-rolie --csaf /var/www/html/advisories/csaf \ | ||
--base-url https://security.acme.tld/advisories/csaf \ | ||
--feed-title "ACME CSAF feed (TLP:WHITE)" \ | ||
--verbose | ||
|
||
CSAF directory : /var/www/html/advisories/csaf | ||
TLP label : WHITE | ||
Base URL : https://security.acme.tld/advisories/csaf | ||
Feed ID : csaf-feed-tlp-white | ||
Feed title : CSAF feed (TLP:WHITE) | ||
Feed filename : csaf-feed-tlp-white.json | ||
Output file : /var/www/html/advisories/csaf/csaf-feed-tlp-white.json | ||
|
||
[*] Add ACMESA-2024:0001 in ROLIE feed | ||
[*] Add ACMESA-2024:1337 in ROLIE feed | ||
|
||
[...] | ||
|
||
ROLIE feed saved in /var/www/html/advisories/csaf/csaf-feed-tlp-white.json | ||
|
||
|
||
=head2 Create a new ROLIE feed using a config file | ||
|
||
Available config items: | ||
|
||
=over | ||
|
||
=item C<csaf> CSAF documents directory | ||
|
||
=item C<output> Feed output file path (default {csaf}/{feed-id}.json) | ||
|
||
=item C<tlp-label> TLP (Traffic Light Protocol) label (default "WHITE") | ||
|
||
=item C<base-url> Feed base URL (default "https://psirt.domain.tld/advisories/csaf") | ||
|
||
=item C<feed-id> Feed ID (default "csaf-feed-tlp-{tlp-label}") | ||
|
||
=item C<feed-title> Feed title (default "CSAF feed (TLP:{tlp-label})") | ||
|
||
=back | ||
|
||
|
||
ROLIE config file (F<rolie.conf>): | ||
|
||
--- | ||
csaf: /var/www/html/advisories/csaf | ||
base_url: https://security.acme.tld/advisories/csaf | ||
tlp_label: WHITE | ||
feed_id: acme-csaf-feed-tlp-white | ||
feed_title: ACME CSAF feed (TLP:WHITE) | ||
|
||
Use F<rolie.conf> with C<csaf-rolie> command: | ||
|
||
$ csaf-rolie --config /etc/csaf/rolie.conf | ||
|
||
Schedule the refresh of ROLIE feed in L<crontab>: | ||
|
||
*/2 * * * * csaf-rolie --config /etc/csaf/rolie.conf 2> /dev/null | ||
|
||
=head1 SEE ALSO | ||
|
||
L<csaf-validator> | ||
|
||
|
||
=head1 AUTHOR | ||
|
||
L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt> | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
|
||
Copyright © 2023-2024 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt> | ||
|
||
You may use and distribute this module according to the same terms | ||
that Perl is distributed under. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.