Skip to content

Commit 1b3bad6

Browse files
author
Rafael Grigorian
committed
Fixed #45
1 parent 256207d commit 1b3bad6

File tree

9 files changed

+242
-119
lines changed

9 files changed

+242
-119
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\SslTls\CertificateTransparencyMonitoring;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Getter;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a getter model. This action
10+
* simply loads the initial value through the Cloudflare API. The rest of
11+
* this class extends on that functionality and adds more endpoints.
12+
* @version 1.2.6
13+
* @package JetRails® Cloudflare
14+
* @author Rafael Grigorian <[email protected]>
15+
* @copyright © 2018 JETRAILS, All rights reserved
16+
* @license MIT https://opensource.org/licenses/MIT
17+
*/
18+
class Index extends Getter {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\SslTls\CertificateTransparencyMonitoring;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Toggle as BaseToggle;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a switch section. This section
10+
* simply loads the initial value through the Cloudflare API as well as
11+
* gives the ability to change the value of said section to be on or off
12+
* though the 'toggle' action.
13+
* @version 1.2.6
14+
* @package JetRails® Cloudflare
15+
* @author Rafael Grigorian <[email protected]>
16+
* @copyright © 2018 JETRAILS, All rights reserved
17+
* @license MIT https://opensource.org/licenses/MIT
18+
*/
19+
class Toggle extends BaseToggle {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Model\Adminhtml\Api\SslTls;
4+
5+
use JetRails\Cloudflare\Model\Adminhtml\Api\Setter;
6+
7+
/**
8+
* This model class inherits from the Setter model. It essentially wraps
9+
* that class in order to send passed data to the Cloudflare API endpoint.
10+
* @version 1.2.6
11+
* @package JetRails® Cloudflare
12+
* @author Rafael Grigorian <[email protected]>
13+
* @copyright © 2018 JETRAILS, All rights reserved
14+
* @license MIT https://opensource.org/licenses/MIT
15+
*/
16+
class CertificateTransparencyMonitoring
17+
extends Setter {
18+
19+
/**
20+
* @var string _endpoint Appended to zone endpoint
21+
* @var string _dataKey Key name used for value
22+
* @var integer _settingType Value cast type before sending
23+
*/
24+
protected $_endpoint = "ct/alerting";
25+
protected $_dataKey = "enabled";
26+
protected $_settingType = self::TYPE_BOOLEAN;
27+
28+
}

src/app/code/JetRails/Cloudflare/etc/acl.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
<resource
8888
id="JetRails_Cloudflare::automatic_https_rewrites"
8989
title="Automatic HTTPS Rewrites" />
90+
<resource
91+
id="JetRails_Cloudflare::certificate_transparency_monitoring"
92+
title="Certificate Transparency Monitoring" />
9093
<resource
9194
id="JetRails_Cloudflare::disable_universal_ssl"
9295
title="Disable Universal SSL" />

src/app/code/JetRails/Cloudflare/view/adminhtml/templates/ssl_tls.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"minimum_tls_version",
1313
"tls_13",
1414
"automatic_https_rewrites",
15+
"certificate_transparency_monitoring",
1516
"disable_universal_ssl"
1617
));
1718

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<section
2+
class="cloudflare ssl_tls certificate_transparency_monitoring initialize loading"
3+
data-endpoint="<?php echo $block->getApiEndpoint () ?>"
4+
data-form-key="<?php echo $block->getFormKey () ?>"
5+
data-tab-name="ssl_tls"
6+
data-section-name="certificate_transparency_monitoring" >
7+
<div class="row" >
8+
<div class="wrapper_left" >
9+
<span class="section_title" >Certificate Transparency Monitoring</span>
10+
<p>Receive an email when a Certificate Authority issues a certificate for your domain.</p>
11+
</div>
12+
<div class="wrapper_right" >
13+
<div>
14+
<label class="switch" >
15+
<input class="trigger" type="checkbox" name="mode" data-target="toggle" />
16+
<span class="knob" ></span>
17+
</label>
18+
</div>
19+
<div class="lightbox" style="background-image: url(<?php echo $block->getViewFileUrl ('JetRails_Cloudflare/images/loading.svg') ?>)" ></div>
20+
</div>
21+
</div>
22+
<div class="row collapsable" >
23+
<div class="wrapper_bottom" >
24+
<a data-tab="help" >Help</a>
25+
</div>
26+
<div data-tab-content="help" >
27+
<h4>What is Certificate Transparency Monitoring?</h4>
28+
<p>Every day, millions of certificates are issued for domains. Each certificate is recorded in a set of public logs for transparency. With Certificate Transparency Monitoring, we crawl these logs and send you an email when we find a certificate for your domain. If you manage example.com, we'll catch *.example.com to help you spot malicious or unexpected certificates.</p>
29+
<h4>Why should I enable Certificate Transparency Monitoring?</h4>
30+
<p>In rare cases, attackers will obtain certificates for websites they do not own. If an attacker gets a certificate for your website, they can serve content on your behalf that looks legitimate but is actually malicious. Some customers also lose track of certificates and like to be notified when new ones are issued. We encourage all customers to enable monitoring and look for suspicious activity.</p>
31+
<h4>Who will receive these email alerts?</h4>
32+
<p>If you're on a Free or Pro account and have enabled this feature, we will send alerts to your Cloudflare account email address (and those with Shared Account Access). If you're on a Business or Enterprise account, we will only send alerts to the emails you specifically enroll above.</p>
33+
<h4>What should I do if I find a malicious certificate?</h4>
34+
<p>We have created a detailed article to help in this situation. It can be found <a href="https://support.cloudflare.com/hc/articles/360031379012" >here</a>.</p>
35+
</div>
36+
</div>
37+
</section>

0 commit comments

Comments
 (0)